Ejemplo n.º 1
0
 def __init__(self, name, a_type, a_decl, a_def=None):
     self.name = name
     self._is_enumeration = False
     a_type_type = type(a_type)
     if a_type_type is int:  # from the generated file
         self.a_type = POM._ATTRCLASSMAP.get(a_type, a_type)
     elif a_type_type is unicode:  # from the parser
         self.a_type = _ATTRTYPEMAP.get(a_type, a_type)
     elif issubclass(a_type_type, list):
         self.a_type = POM.Enumeration(a_type)
         self._is_enumeration = True
     else:
         self.a_type = a_type
     # declaration
     # convert string to int value when generating, just use the int
     # when imported from Python dtd format.
     self.a_decl = _DEFAULTMAP.get(a_decl, a_decl)
     self.default = a_def