dabo Commit
Revision 4904
Date: 2009-01-03 08:52:55 -0800 (Sat, 03 Jan 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/4904
Changed:
U trunk/ide/ClassDesigner.py
U trunk/ide/ClassDesignerComponents.py
U trunk/ide/ClassDesignerFormMixin.py
Log:
Improved the DE Wizard so that newly-created bizobjs are added to the app's biz
module namespace.
Fixed a bug that would incorrectly store a CxnName if happened to be the same
as an existing directory or file.
Diff:
Modified: trunk/ide/ClassDesigner.py
===================================================================
--- trunk/ide/ClassDesigner.py 2009-01-02 01:53:02 UTC (rev 4903)
+++ trunk/ide/ClassDesigner.py 2009-01-03 16:52:55 UTC (rev 4904)
@@ -411,6 +411,22 @@
return ret
+ def updateNamespace(self, startFile=None):
+ """When classes are added to the application being edited, we
need to re-create the
+ application namespaces.
+ """
+ stdBiz = self.Application.getStandardAppDirectory("biz",
startFile)
+ stdHome = os.path.split(stdBiz)[0]
+ hd = self.Application.HomeDirectory
+ if stdHome != hd:
+ self.Application.HomeDirectory = stdHome
+ if stdHome not in sys.path:
+ sys.path.append(stdHome)
+ self._initModuleNames()
+ if stdHome != hd:
+ self.Application.HomeDirectory = hd
+
+
def onEditUndo(self, evt):
dabo.infoLog.write(_("Not implemented yet"))
def onEditRedo(self, evt):
Modified: trunk/ide/ClassDesignerComponents.py
===================================================================
--- trunk/ide/ClassDesignerComponents.py 2009-01-02 01:53:02 UTC (rev
4903)
+++ trunk/ide/ClassDesignerComponents.py 2009-01-03 16:52:55 UTC (rev
4904)
@@ -189,7 +189,7 @@
# 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",
+ if not prop in ("Alignment", "Caption", "CxnName",
"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_")):
Modified: trunk/ide/ClassDesignerFormMixin.py
===================================================================
--- trunk/ide/ClassDesignerFormMixin.py 2009-01-02 01:53:02 UTC (rev 4903)
+++ trunk/ide/ClassDesignerFormMixin.py 2009-01-03 16:52:55 UTC (rev 4904)
@@ -852,6 +852,8 @@
cd["createBizobjs"] = currCode
rep[self] = cd
self.Controller.updateCodeEditor()
+ # Add the classes to the app's namespace
+
self.Controller.updateNamespace(os.path.abspath(self._classFile))
def onAddControl(self, evt):
_______________________________________________
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]