dabo Commit
Revision 5059
Date: 2009-02-13 19:53:42 -0800 (Fri, 13 Feb 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5059

Changed:
U   trunk/dabo/lib/DesignerXmlConverter.py

Log:
Fixed a problem where default values in custom properties were being 
incorrectly set in the class.


Diff:
Modified: trunk/dabo/lib/DesignerXmlConverter.py
===================================================================
--- trunk/dabo/lib/DesignerXmlConverter.py      2009-02-11 23:23:42 UTC (rev 
5058)
+++ trunk/dabo/lib/DesignerXmlConverter.py      2009-02-14 03:53:42 UTC (rev 
5059)
@@ -169,7 +169,7 @@
                propInit = ""
                for prop, propDef in propDefs.items():
                        val = propDef["defaultValue"]
-                       if not val:
+                       if val == "" and propDef["defaultType"] != "string":
                                continue
                        if propDef["defaultType"] == "string":
                                val = "\"" + val + "\""
@@ -584,7 +584,6 @@
                """Define a class that will be used to create an instance of
                an object that contains its own method code and/or Properties.
                """
-
                try:
                        modpath, shortClsName = nm.rsplit(".", 1)
                except ValueError:
@@ -596,6 +595,8 @@
                propInit = ""
                for prop, propDef in custProps.items():
                        val = propDef["defaultValue"]
+                       if val == "" and propDef["defaultType"] != "string":
+                               continue
                        if propDef["defaultType"] == "string":
                                val = "\"" + val + "\""
                        propInit += "self._%s%s = %s" % (prop[0].lower(), 
prop[1:], val) + LINESEP



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to