Exemple #1
0
 def toxml(self, filename):
     root = ET.Element("container")
     for modelClass in self.MODELCLASSES:
         models = []
         for model in self.__modelsByClass[modelClass]:
             models.append(model)
         MODELS.toxml(modelClass.__name__, models, root, parseModel=True)
     tree = ET.ElementTree(root)
     tree.write(filename)
Exemple #2
0
 def toxml(self,filename):
     root = ET.Element("container")
     for modelClass in self.MODELCLASSES:
         models=[]
         for model in self.__modelsByClass[modelClass]:
             models.append(model)
         MODELS.toxml(modelClass.__name__,models,root,parseModel=True)
     tree = ET.ElementTree(root)
     tree.write(filename)
Exemple #3
0
 def fromxml(self, filename):
     tree = ET.ElementTree(file=filename)
     root = tree.getroot()
     for et in root:
         models = MODELS.fromxml(et, container=self)
         for model in models:
             self.register(model)
     return ET.ElementTree(root)
Exemple #4
0
 def fromxml(self,filename):        
     tree = ET.ElementTree(file=filename)
     root = tree.getroot()
     for et in root:
         models = MODELS.fromxml(et,container=self)
         for model in models:
             self.register(model)
     return ET.ElementTree(root)