@@ -4,7 +4,7 @@ Generate address space code from xml file specification
...
@@ -4,7 +4,7 @@ Generate address space code from xml file specification
fromxml.etreeimportElementTree
fromxml.etreeimportElementTree
fromloggingimportgetLogger
fromloggingimportgetLogger
fromdataclassesimportdataclass,field
fromdataclassesimportdataclass,field
fromtypingimportAny,List
fromtypingimportAny,List,Optional
importre
importre
frompathlibimportPath
frompathlibimportPath
...
@@ -96,7 +96,7 @@ class Field:
...
@@ -96,7 +96,7 @@ class Field:
@dataclass
@dataclass
classStruct:
classStruct:
name:str=None
name:str=None
basetype:str=None
basetype:Optional[str]=None
node_id:str=None
node_id:str=None
doc:str=""
doc:str=""
fields:List[Field]=field(default_factory=list)
fields:List[Field]=field(default_factory=list)
...
@@ -123,7 +123,7 @@ class Enum:
...
@@ -123,7 +123,7 @@ class Enum:
data_type:str=None
data_type:str=None
fields:List[Field]=field(default_factory=list)
fields:List[Field]=field(default_factory=list)
doc:str=""
doc:str=""
is_option_set:bool=False
is_option_set:bool=False
...
@@ -210,6 +210,8 @@ def reorder_structs(model):
...
@@ -210,6 +210,8 @@ def reorder_structs(model):
ok=False
ok=False
ifok:
ifok:
_add_struct(s,newstructs,waiting_structs,types)
_add_struct(s,newstructs,waiting_structs,types)
iflen(model.structs)!=len(newstructs):
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))
_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))