Пример #1
0
 def xmlsave(self,xml,zipfw):
     xml.name='image'
     xml['id']=id(self)
     #xml['ext']=self.ext
     filename='images/%d.%s'%(id(self),self.ext)
     zipfw.writestr(str(filename),self.data)
     #xml['imgwi']=self.imgwi
     #xml['imghi']=self.imghi
     #xml['preserveratio']=int(self.preserveratio)
     utils.xml_generic_save_attrs(self,xml)
Пример #2
0
 def xmlsavedata(self,xml):
     xml.clear()
     utils.xml_generic_save_attrs(self,xml)
     for f in self.fontnames: utils.fontdicttoxml(self.fonts[f],xml/'fonts'/f)
     for attr,anchor in self.features: xml[attr]=getattr(self,attr).name