# __aTest.py_____________________________________________________ from ASGNode import * from ATOM3Type import * from ATOM3String import * from ATOM3Integer import * from graph_aTest import * class aTest(ASGNode, ATOM3Type): def __init__(self, parent = None): ASGNode.__init__(self) ATOM3Type.__init__(self) self.graphClass_ = graph_aTest self.parent = parent self.aString=ATOM3String('init') self.keyword_= self.aString self.aNumber=ATOM3Integer(0) self.generatedAttributes = {'aString': ('ATOM3String', ), 'aNumber': ('ATOM3Integer', ) } self.realOrder = ['aString','aNumber'] def clone(self): cloneObject = aTest( self.parent ) for atr in self.realOrder: cloneObject.setAttrValue(atr, self.getAttrValue(atr).clone() ) cloneObject.keyword_ = cloneObject.aString ASGNode.cloneActions(self, cloneObject) return cloneObject def copy(self, other): ATOM3Type.copy(self, other) for atr in self.realOrder: self.setAttrValue(atr, other.getAttrValue(atr) ) self.keyword_ = self.aString ASGNode.copy(self, other) def preCondition (self, actionID, * params): if self.graphObject_: return self.graphObject_.preCondition(actionID, params) else: return None def postCondition (self, actionID, * params): if actionID == self.EDIT: res = self.lessThan1000(params) if res: return res if self.graphObject_: return self.graphObject_.postCondition(actionID, params) else: return None def lessThan1000(self, params): ivalue = self.aNumber.getValue() if ivalue >= 1000: return ("The value you entered("+str(ivalue)+") is too big", self) return None