@@ -4,7 +4,7 @@ Generate address space code from xml file specification
fromxml.etreeimportElementTree
fromloggingimportgetLogger
fromdataclassesimportdataclass,field
fromtypingimportAny,List
fromtypingimportAny,List,Optional
importre
frompathlibimportPath
...
...
@@ -96,7 +96,7 @@ class Field:
@dataclass
classStruct:
name:str=None
basetype:str=None
basetype:Optional[str]=None
node_id:str=None
doc:str=""
fields:List[Field]=field(default_factory=list)
...
...
@@ -123,7 +123,7 @@ class Enum:
data_type:str=None
fields:List[Field]=field(default_factory=list)
doc:str=""
is_option_set:bool=False
is_option_set:bool=False
...
...
@@ -210,6 +210,8 @@ def reorder_structs(model):
ok=False
ifok:
_add_struct(s,newstructs,waiting_structs,types)
iflen(model.structs)!=len(newstructs):
_logger.warning('Error while reordering structs, some structs could not be reinserted: had %s structs, we now have %s structs',len(model.structs),len(newstructs))