@@ -57,9 +57,15 @@ def localname(xname):
57
57
return xname if rcurly == - 1 else xname [rcurly + 1 :]
58
58
59
59
def load (text , match = None ):
60
- """Load the given XML text into a Python structure, optionally loading
61
- only the matching sub-elements if a match string is given. The match
62
- string consists of either a tag name or path."""
60
+ """Load the given XML text into a native Python structure (dict or list),
61
+ optionally loading nly the matching sub-elements if a match string is
62
+ given. The match string consists of either a tag name or path.
63
+
64
+ :param `text`: text (XML) to load
65
+ :type `text`: string
66
+ :param `match`: tag name or path (optional)
67
+ :type `match`: string
68
+ """
63
69
if text is None : return None
64
70
text = text .strip ()
65
71
if len (text ) == 0 : return None
@@ -165,8 +171,8 @@ def load_value(element, nametable=None):
165
171
166
172
# A generic utility that enables "dot" access to dicts
167
173
class Record (dict ):
168
- """A generic utiliity class that enables * dot* access to members of
169
- a Python dict .
174
+ """A generic utiliity class that enables dot access to members of
175
+ a Python dictionary .
170
176
"""
171
177
def __call__ (self , * args ):
172
178
if len (args ) == 0 : return self
@@ -191,7 +197,11 @@ def fromkv(k, v):
191
197
return result
192
198
193
199
def record (value = None ):
194
- """Returns a record instance constructed using the given value."""
200
+ """Returns a record instance constructed using the given value.
201
+
202
+ :param `value`: initial record value
203
+ :type `value`: dict
204
+ """
195
205
if value is None : value = {}
196
206
return Record (value )
197
207
0 commit comments