class Plot(Element): def __init__(self, name, master, xml=None): '''Initiate Plot object''' Element.__init__(self, name, master, xml) def init(self): '''Init default attribute value''' Element.init(self) self.premise = Premise(self) def fromXML(self, xml): '''load Plot from XML backup''' Element.fromXML(self, xml) root = xml.firstChild self.premise = Premise(self, xml) def toXML(self, ident, xml=None ): '''save Plot in XML syntax''' xml = dom.parseString('<?xml version="1.0" ?><plot id="'+ident+'"/>') root = xml.firstChild xml = Element.toXML(self, xml=xml) self.premise.toXML(xml) return xml def show(self, event, master = None): '''show Plot editing page''' # display Element common editing part and get main frame and first column mainFrame, col1 = Element.showCompact(self, event, master, self.name!='Main Plot') # display content of the first column self.premise.populateCol1( col1 ) # create the second column col2 = Frame(mainFrame) col2.place( relx=0.25, relheight=1, relwidth=0.25, width = -100)
def fromXML(self, xml): '''load Plot from XML backup''' Element.fromXML(self, xml) root = xml.firstChild self.premise = Premise(self, xml)
def init(self): '''Init default attribute value''' Element.init(self) self.premise = Premise(self)