summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-06-22 08:49:50 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-06-22 08:49:50 +0200
commit21167c14b498df4f00e6eafc566b7db7411947f7 (patch)
tree4494c350cab288b3cf822be28ee5665110fd2ac6
parentf07d4ac9d53ccea1848221f612f6460420cba543 (diff)
downloadxdd2esi-21167c14b498df4f00e6eafc566b7db7411947f7.tar.gz
xdd2esi-21167c14b498df4f00e6eafc566b7db7411947f7.zip
Make _convert_objecttypes() in xddlib a function, not a method
-rw-r--r--xddlib.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/xddlib.py b/xddlib.py
index 85a452a..5581c20 100644
--- a/xddlib.py
+++ b/xddlib.py
@@ -68,7 +68,7 @@ class XDDFile:
# Convert datatype-numbers
self._convert_datatypes(obj)
# Convert numeric object types to datatype objects
- self._convert_objecttypes(obj)
+ _convert_objecttypes(obj)
# Cast strings to ints/...
self._convert_cast(obj)
@@ -118,16 +118,6 @@ class XDDFile:
_setattributes(subobject, child)
self.objlist.append(canobject)
- def _convert_objecttypes(self, obj):
- """ Converts the numeric objecttype to a more meaningful string """
- objecttypes = {
- '7': 'var',
- '8': 'arr',
- '9': 'rec',
- }
- if obj.objecttype is not None:
- obj.objecttype = objecttypes[obj.objecttype]
-
def _convert_datatypes(self, obj):
""" Converts numeric XDD datatypes to datatype-objects """
# toplevel-objects of subobjects don't have a dataType
@@ -343,3 +333,15 @@ def _get_py_datatype(obj):
xdd_datatype)]
py_datatype = canlib.Datatype(*list_datatype)
return py_datatype
+
+def _convert_objecttypes(obj):
+ """ Converts the numeric objecttype to a more meaningful string """
+ objecttypes = {
+ '7': 'var',
+ '8': 'arr',
+ '9': 'rec',
+ }
+ if obj.objecttype is not None:
+ obj.objecttype = objecttypes[obj.objecttype]
+
+