def changebase(self,newbase): #oldname=self.name xml=xmlnode.XmlNode() self.xmlsavediff(xml,True) bxml=xmlnode.XmlNode() newbase.xmlsavedata(bxml) xmltools.xmlmerge(bxml,xml) self.xmlloaddata(bxml) #self.name=oldname self.basetype=newbase.name
def xmlload(self,xml): myxml=xml self.name=xml.attrs.get('name',u'') self.saveonlydiff=xml['saveonlydiff']=='1' self.basetype=xml['basetype'] if self.saveonlydiff and self.basetype: btype=searchsbtype(xml['basetype']) if btype: myxml=xmlnode.XmlNode() self.basetype.xmlsave(myxml) xmltools.xmlmerge(myxml,xml) myxml['saveonlydiff']=1 self.xmlloaddata(myxml)