File tree 1 file changed +13
-6
lines changed 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -64,20 +64,27 @@ class Sectioned:
64
64
"""
65
65
A simple entry point config parser for performance
66
66
67
+ >>> for item in Sectioned.read(Sectioned._sample):
68
+ ... print(item)
69
+ Pair(name='sec1', value='# comments ignored')
70
+ Pair(name='sec1', value='a = 1')
71
+ Pair(name='sec1', value='b = 2')
72
+ Pair(name='sec2', value='a = 2')
73
+
67
74
>>> res = Sectioned.section_pairs(Sectioned._sample)
68
75
>>> item = next(res)
69
76
>>> item.name
70
77
'sec1'
71
- >>> tuple( item.value)
72
- ( 'a', '1')
78
+ >>> item.value
79
+ Pair(name= 'a', value= '1')
73
80
>>> item = next(res)
74
- >>> tuple( item.value)
75
- ( 'b', '2')
81
+ >>> item.value
82
+ Pair(name= 'b', value= '2')
76
83
>>> item = next(res)
77
84
>>> item.name
78
85
'sec2'
79
- >>> tuple( item.value)
80
- ( 'a', '2')
86
+ >>> item.value
87
+ Pair(name= 'a', value= '2')
81
88
>>> list(res)
82
89
[]
83
90
"""
You can’t perform that action at this time.
0 commit comments