summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-06-22 08:39:45 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-06-22 08:39:45 +0200
commit2a609152115bb183421db045ef0e8d7bb36e1836 (patch)
tree126246b9542b4ed13e6e523edb8f6a8228f119e6
parent3148cff680c3f09978881a2b19f079ce2b555712 (diff)
downloadxdd2esi-2a609152115bb183421db045ef0e8d7bb36e1836.tar.gz
xdd2esi-2a609152115bb183421db045ef0e8d7bb36e1836.zip
Make _is_reserved in xddlib a function, not a method
-rw-r--r--xddlib.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/xddlib.py b/xddlib.py
index cda1704..8a3d7cc 100644
--- a/xddlib.py
+++ b/xddlib.py
@@ -106,15 +106,10 @@ class XDDFile:
children = []
for child in xmlobject:
childattr = dict(child.attrib)
- if not self._is_reserved(childattr):
+ if not _is_reserved(childattr):
children.append(childattr)
return children
- def _is_reserved(self, objdict):
- """ Returns true if an object is reserved """
- match = re.match('^reserved[0-9a-fA_F]*$', objdict['name'])
- return bool(match)
-
def _setobjects(self, tree):
""" Fill objlist with the objects """
# XPath to extract the objects
@@ -342,3 +337,9 @@ class XDDFile:
def _convert_cast_nop(self, value):
""" Doesn't convert anything """
return value
+
+
+def _is_reserved(objdict):
+ """ Returns true if an object is reserved """
+ match = re.match('^reserved[0-9a-fA_F]*$', objdict['name'])
+ return bool(match)