dabo Commit
Revision 6971
Date: 2011-11-23 08:46:58 -0800 (Wed, 23 Nov 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6971

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

Log:
Refactored the internal _Shell class so that it is only exposed via the dShell 
class.



Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2011-11-18 11:10:19 UTC (rev 6970)
+++ trunk/dabo/ui/uiwx/__init__.py      2011-11-23 16:46:58 UTC (rev 6971)
@@ -167,6 +167,7 @@
 from dPage import dPage
 from dPdfWindow import dPdfWindow
 from dSearchBox import dSearchBox
+from dShell import dShell
 from dSizer import dSizer
 from dSizer import dSizerV
 from dSizer import dSizerH
@@ -184,7 +185,6 @@
 from dTreeView import dTreeView
 from dLed import dLed
 import dUICursors as dUICursors
-import dShell
 import gridRenderers
 from dPageFrameMixin import dPageFrameMixin
 

Modified: trunk/dabo/ui/uiwx/dShell.py
===================================================================
--- trunk/dabo/ui/uiwx/dShell.py        2011-11-18 11:10:19 UTC (rev 6970)
+++ trunk/dabo/ui/uiwx/dShell.py        2011-11-23 16:46:58 UTC (rev 6971)
@@ -359,6 +359,8 @@
        def _beforeInit(self, pre):
                # Set the sash
                self._sashPct = 0.6
+               # Class to use for creating the interactive shell
+               self._shellClass = _Shell
                super(dShell, self)._beforeInit(pre)
 
 
@@ -400,7 +402,7 @@
                self.pgCode.Caption = _("Code")
                cp.Sizer.append1x(pgf)
 
-               self.shell = _Shell(self.pgShell, DroppedTextHandler=self, 
DroppedFileHandler=self)
+               self.shell = self.ShellClass(self.pgShell, 
DroppedTextHandler=self, DroppedFileHandler=self)
                self.pgShell.Sizer.append1x(self.shell, border=4)
                # Configure the shell's behavior
                self.shell.AutoCompSetIgnoreCase(True)
@@ -725,6 +727,11 @@
                self.shell.SetZoom(self.shell.GetZoom()-1)
 
 
+       @classmethod
+       def getBaseShellClass(cls):
+               return _Shell
+
+
        def _getFontSize(self):
                return self.shell.FontSize
 
@@ -760,6 +767,16 @@
                return self._historyPanel
 
 
+       def _getShellClass(self):
+               return self._shellClass
+
+       def _setShellClass(self, val):
+               if self._constructed():
+                       self._shellClass = val
+               else:
+                       self._properties["ShellClass"] = val
+
+
        def _getSplitState(self):
                return self._splitState
 
@@ -785,6 +802,9 @@
        _HistoryPanel = property(_getHistoryPanel, None, None,
                        _("Popup to display the command history  (read-only) 
(dDialog)"))
 
+       ShellClass = property(_getShellClass, _setShellClass, None,
+                       _("Class to use for the interactive shell  (dShell)"))
+
        SplitState = property(_getSplitState, _setSplitState, None,
                        _("""Controls whether the output is in a separate pane 
(default)
                        or intermixed with the commands.  (bool)"""))

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



_______________________________________________
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