--- a/Beremiz_service.py Wed Mar 06 09:40:28 2013 +0900
+++ b/Beremiz_service.py Wed Mar 06 10:30:55 2013 +0900
@@ -389,28 +389,27 @@
self.pyroserver.Restart()
+ def _LiveShellLocals(self): + if self.pyroserver.plcobj is not None: + return {"locals":self.pyroserver.plcobj.python_threads_vars} def OnTaskBarLiveShell(self, evt):
- if self.pyroserver.plcobj is not None and self.pyroserver.plcobj.python_threads_vars is not None:
- #frame = py.shell.ShellFrame(locals=self.pyroserver.plcobj.python_threads_vars)
- frame = py.crust.CrustFrame(locals=self.pyroserver.plcobj.python_threads_vars)
- wx.MessageBox(_("No running PLC"), _("Error"))
+ frame = py.crust.CrustFrame(**self._LiveShellLocals()) def OnTaskBarWXInspector(self, evt):
# Activate the widget inspection tool
from wx.lib.inspection import InspectionTool
if not InspectionTool().initialized:
- InspectionTool().Init(locals=self.pyroserver.plcobj.python_threads_vars)
- # Find a widget to be selected in the tree. Use either the
- # one under the cursor, if any, or this frame.
- wnd = wx.FindWindowAtPointer()
+ InspectionTool().Init(**self._LiveShellLocals()) InspectionTool().Show(wnd, True)
def OnTaskBarQuit(self, evt):