dabo Commit
Revision 6973
Date: 2011-11-23 10:09:43 -0800 (Wed, 23 Nov 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6973

Changed:
U   trunk/dabo/dApp.py
U   trunk/dabo/ui/uiwx/__init__.py
U   trunk/dabo/ui/uiwx/dDockForm.py
U   trunk/dabo/ui/uiwx/dShell.py
U   trunk/dabo/ui/uiwx/object_inspector.py
U   trunk/dabo/ui/uiwx/uiApp.py

Log:
Renamed the 'dShell' class to 'dShellForm', and the '_Shell' class to 'dShell'. 
The earlier choice of the whole form being the class was becoming very limiting 
as far as being able to embed interactive interpreters in Dabo apps. Please let 
me know if this breaks anything.

Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py  2011-11-23 16:47:02 UTC (rev 6972)
+++ trunk/dabo/dApp.py  2011-11-23 18:09:43 UTC (rev 6973)
@@ -1193,7 +1193,7 @@
                app.ShowCommandWindowMenu in production, perhaps leaving 
backdoor
                access to this function.
 
-               The context argument tells dShell what object becomes 'self'. 
If not
+               The context argument tells dShellForm what object becomes 
'self'. If not
                passed, context will be app.ActiveForm.
                """
                self.uiApp.showCommandWindow(context)

Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2011-11-23 16:47:02 UTC (rev 6972)
+++ trunk/dabo/ui/uiwx/__init__.py      2011-11-23 18:09:43 UTC (rev 6973)
@@ -168,6 +168,7 @@
 from dPdfWindow import dPdfWindow
 from dSearchBox import dSearchBox
 from dShell import dShell
+from dShell import dShellForm
 from dSizer import dSizer
 from dSizer import dSizerV
 from dSizer import dSizerH

Modified: trunk/dabo/ui/uiwx/dDockForm.py
===================================================================
--- trunk/dabo/ui/uiwx/dDockForm.py     2011-11-23 16:47:02 UTC (rev 6972)
+++ trunk/dabo/ui/uiwx/dDockForm.py     2011-11-23 18:09:43 UTC (rev 6973)
@@ -882,7 +882,7 @@
 
 
        def onChildBorn(self, evt):
-               ok = isinstance(evt.child, (dDockPanel, dabo.ui.dStatusBar, 
dabo.ui.dShell.dShell))
+               ok = isinstance(evt.child, (dDockPanel, dabo.ui.dStatusBar, 
dabo.ui.dShellForm))
                if not ok:
                        # This should never happen; if so, log the error
                        dabo.log.error(_("Unmanaged object added to a Dock 
Form: %s") %evt.child)

Modified: trunk/dabo/ui/uiwx/dShell.py
===================================================================
--- trunk/dabo/ui/uiwx/dShell.py        2011-11-23 16:47:02 UTC (rev 6972)
+++ trunk/dabo/ui/uiwx/dShell.py        2011-11-23 18:09:43 UTC (rev 6973)
@@ -10,7 +10,7 @@
 from dabo.dLocalize import _
 from dSplitForm import dSplitForm
 from dabo.ui import makeDynamicProperty
-from dPemMixin import dPemMixin
+from dControlMixin import dControlMixin
 
 dabo.ui.loadUI("wx")
 from dabo.ui import dKeys
@@ -140,20 +140,20 @@
 
 
 
-class _Shell(dPemMixin, wx.py.shell.Shell):
+class dShell(dControlMixin, wx.py.shell.Shell):
        def __init__(self, parent, properties=None, attProperties=None,
                                *args, **kwargs):
                self._isConstructed = False
                self._fontSize = 10
                self._fontFace = ""
-               self._baseClass = _Shell
+               self._baseClass = dShell
                preClass = wx.py.shell.Shell
-               dPemMixin.__init__(self, preClass, parent, 
properties=properties,
+               dControlMixin.__init__(self, preClass, parent, 
properties=properties,
                                attProperties=attProperties, *args, **kwargs)
 
 
        def _afterInit(self):
-               super(_Shell, self)._afterInit()
+               super(dShell, self)._afterInit()
                # Set some font defaults
                self.plat = self.Application.Platform
                if self.plat == "GTK":
@@ -173,19 +173,19 @@
                gets processed into our internal stack.
                """
                edt = self.CanEdit()
-               super(_Shell, self).processLine()
+               super(dShell, self).processLine()
                if edt:
                        # push the latest command into the stack
                        try:
                                self.Form.addToHistory()
                        except AttributeError:
-                               # Not running in dShell
+                               # Not running in dShellForm
                                pass
 
 
        def push(self, command, silent=False):
                """Need to raise an event when the interpreter executes a 
command."""
-               super(_Shell, self).push(command, silent=silent)
+               super(dShell, self).push(command, silent=silent)
                if not self.more:
                        self.raiseEvent(dEvents.ShellCommandRun)
 
@@ -263,7 +263,7 @@
        def OnKeyDown(self, evt):
                """Override on the Mac, as the navigation defaults are 
different than on Win/Lin"""
                if self.plat != "Mac":
-                       return super(_Shell, self).OnKeyDown(evt)
+                       return super(dShell, self).OnKeyDown(evt)
                key = evt.GetKeyCode()
                # If the auto-complete window is up let it do its thing.
                if self.AutoCompActive():
@@ -313,7 +313,7 @@
                                start = endpos
                        self.SetSelection(start, endpos)
                        return
-               return super(_Shell, self).OnKeyDown(evt)
+               return super(dShell, self).OnKeyDown(evt)
 
 
        def _getFontSize(self):
@@ -350,7 +350,7 @@
 
 
 
-class dShell(dSplitForm):
+class dShellForm(dSplitForm):
        def _onDestroy(self, evt):
                self._clearOldHistory()
                __builtin__.raw_input = self._oldRawInput
@@ -360,12 +360,12 @@
                # Set the sash
                self._sashPct = 0.6
                # Class to use for creating the interactive shell
-               self._shellClass = _Shell
-               super(dShell, self)._beforeInit(pre)
+               self._shellClass = dShell
+               super(dShellForm, self)._beforeInit(pre)
 
 
        def _afterInit(self):
-               super(dShell, self)._afterInit()
+               super(dShellForm, self)._afterInit()
                self.cmdHistKey = self.PreferenceManager.command_history
                self._historyPanel = None
                self._lastCmd = None
@@ -470,7 +470,7 @@
                        ns = self.Parent
                self.shell.interp.locals['self'] = ns
 
-               self.Caption = _("dShell: self is %s") % ns.Name
+               self.Caption = _("dShellForm: self is %s") % ns.Name
                self.setStatusText(_("Use this shell to interact with the 
runtime environment"))
                self.fillMenu()
                self.shell.SetFocus()
@@ -729,7 +729,7 @@
 
        @classmethod
        def getBaseShellClass(cls):
-               return _Shell
+               return dShell
 
 
        def _getFontSize(self):
@@ -815,8 +815,8 @@
 
 
 def main():
-       app = dabo.dApp(BasePrefKey="dabo.ui.dShell")
-       app.MainFormClass = dShell
+       app = dabo.dApp(BasePrefKey="dabo.ui.dShellForm")
+       app.MainFormClass = dShellForm
        app.setup()
        app.start()
 

Modified: trunk/dabo/ui/uiwx/object_inspector.py
===================================================================
--- trunk/dabo/ui/uiwx/object_inspector.py      2011-11-23 16:47:02 UTC (rev 
6972)
+++ trunk/dabo/ui/uiwx/object_inspector.py      2011-11-23 18:09:43 UTC (rev 
6973)
@@ -256,8 +256,7 @@
 def afterInitAll(self):
        objnote = "NOTE: The 'obj' variable refers to the object selected in 
the tree."
        intro = "%s\\n%s" % (dabo.ui.getSystemInfo(), objnote)
-       shellClass = dabo.ui.dShell.getBaseShellClass()
-       self.shell = shellClass(self.shellPanel, showInterpIntro=False,
+       self.shell = dabo.ui.dShell(self.shellPanel, showInterpIntro=False,
                        introText=intro)
        self.shell.interp.locals['self'] = self
        sz = self.shellPanel.Sizer = dabo.ui.dBorderSizer(self.shellPanel, 
Caption="Interactive Interpreter")

Modified: trunk/dabo/ui/uiwx/uiApp.py
===================================================================
--- trunk/dabo/ui/uiwx/uiApp.py 2011-11-23 16:47:02 UTC (rev 6972)
+++ trunk/dabo/ui/uiwx/uiApp.py 2011-11-23 18:09:43 UTC (rev 6973)
@@ -528,7 +528,7 @@
                """Display a command window for debugging."""
                if context is None:
                        context = self.ActiveForm
-               dlg = dabo.ui.dShell.dShell(context)
+               dlg = dabo.ui.dShellForm(context)
                dlg.show()
 
 



_______________________________________________
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