[Modeling-cvs] ProjectModeling/Modeling CHANGES,1.79,1.80 Attribute.py,1.9,1.10
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2003-03-14 14:27:30
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv24049 Modified Files: CHANGES Attribute.py Log Message: Fixed Attribute.initWithXMLDOMNode(): it was possible that the defaultValue was set prior to the attribute's type, hence it didn't get the right value (e.g. a default value being string '0' instead of integer 0 for a type=='int') Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** CHANGES 14 Mar 2003 10:01:06 -0000 1.79 --- CHANGES 14 Mar 2003 14:27:25 -0000 1.80 *************** *** 8,11 **** --- 8,16 ---- -------------------------------------------------------- + * Fixed Attribute.initWithXMLDOMNode(): it was possible that the + defaultValue was set prior to the attribute's type, hence it didn't get + the right value (e.g. a default value being string '0' instead of integer + 0 for a type=='int') + 0.9-pre-4 (2002/03/14) Second release candidate for 0.9 --------- Index: Attribute.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/Attribute.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Attribute.py 14 Mar 2003 11:40:01 -0000 1.9 --- Attribute.py 14 Mar 2003 14:27:25 -0000 1.10 *************** *** 524,528 **** _attrDict=self.xmlAttributesDict() _attrNode=aNode.attributes ! for attributeName in [attr.name for attr in aNode.attributes]: # Iterate on attributes declared in node attrType=self.xmlAttributeType(attributeName) --- 524,539 ---- _attrDict=self.xmlAttributesDict() _attrNode=aNode.attributes ! attributes=[attr.name for attr in aNode.attributes] ! ! # Now we must make sure that the type is initialized BEFORE the default ! # value is set --> we simply make sure that this will be the first one ! # to be initialized ! try: ! t=[a for a in attributes if a=='type'][0] #IndexError ! attributes.remove(t) ! attributes=[t]+attributes ! except IndexError: pass ! ! for attributeName in attributes: # Iterate on attributes declared in node attrType=self.xmlAttributeType(attributeName) *************** *** 595,598 **** --- 606,611 ---- self.setIsRequired, self.isRequired), + # defaultValue must be loaded AFTER type is set, or we will get the + # wrong value 'defaultValue' : ('string', self.setDefaultValue, |