daboide Commit
Revision 748
Date: 2007-01-11 05:29:21 -0800 (Thu, 11 Jan 2007)
Author: Ed

Changed:
U   trunk/ClassDesignerComponents.py

Log:
Fixed the over-zealous conversion of strings to paths. As reported in Tracker 
#0279, any string value that happened to be the name of a file or directory was 
converted to a path value. This blocks that from happening for any property 
that never contains path info.


Diff:
Modified: trunk/ClassDesignerComponents.py
===================================================================
--- trunk/ClassDesignerComponents.py    2007-01-10 14:31:56 UTC (rev 747)
+++ trunk/ClassDesignerComponents.py    2007-01-11 13:29:21 UTC (rev 748)
@@ -133,16 +133,21 @@
                        if prop == "RegID" and not val:
                                continue
                        
-                       
-                       if isinstance(val, basestring) and os.path.exists(val):
-                               # It's a path; convert it to a relative path
-                               if isinstance(self, dabo.ui.dForm):
-                                       ref = self._classFile
-                               else:
-                                       ref = self.Form._classFile
-                               ref = os.path.abspath(ref)
-                               val = dabo.lib.utils.getPathAttributePrefix() + 
\
-                                               
dabo.lib.utils.relativePath(val, ref)
+                       # Convert any paths, but ignore the string properties 
that may
+                       # accidentally contain a legal path but which do not 
represent paths.
+                       if not prop in ("Alignment", "Caption", "DataField", 
"DataSource", 
+                                       "FontFace", "HAlign", "Name", "RegID", 
"SelectionMode", 
+                                       "ToolTipText", "VAlign", "Value") and 
(not prop.startswith("Border")
+                                       and not prop.startswith("Header") and 
not prop.startswith("Sizer_")):
+                               if isinstance(val, basestring) and 
os.path.exists(val):
+                                       # It's a path; convert it to a relative 
path
+                                       if isinstance(self, dabo.ui.dForm):
+                                               ref = self._classFile
+                                       else:
+                                               ref = self.Form._classFile
+                                       ref = os.path.abspath(ref)
+                                       val = 
dabo.lib.utils.getPathAttributePrefix() + \
+                                                       
dabo.lib.utils.relativePath(val, ref)
                                
                        # If it hasn't changed from the default, skip it
                        if not allProps:
@@ -377,10 +382,6 @@
        def __init__(self, parent, properties=None, *args, **kwargs):
                self._autoSizer = self._extractKey(kwargs, "AutoSizer", True)
                kwargs["Size"] = (20,20)
-#-             if self.Application.platform == "Win":
-#-                     kwargs["BackColor"] = "cornsilk"
-#-             else:
-#-                     kwargs["BackColor"] = "azure"
                super(LayoutPanel, self).__init__(parent, properties, *args, 
**kwargs)
                # Let the framework know that this is just a placeholder object
                self._placeholder = True
@@ -488,7 +489,7 @@
                                                # Add option to delete the 
entire pageframe
                                                pop.prependSeparator()
                                                sepAdded =True
-                                               pop.prepend(_("Delete the 
entire Paged Control"), self.onDeleteGrandParent)
+                                               pop.prepend(_("Delete the 
entire Paged Control"), OnHit=self.onDeleteGrandParent)
                                                prmpt = _("Delete this Page")
                                        elif isinstance(self.Parent, 
dabo.ui.dPanel):
                                                prmpt = _("Delete this Panel")
@@ -508,7 +509,7 @@
                pop.append(_("Edit Sizer Settings"), OnHit=self.onEditSizer)
                pop.appendSeparator()
                pop.append(_("Add Controls from Data Environment"), 
-                               self.Form.onRunLayoutWiz)
+                               OnHit=self.Form.onRunLayoutWiz)
                return pop
 
 




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to