rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
EVT_STC_MODIFIED(self, wxID_PYTHONSOURCEVIEW, self.OnModified)
def __init__(self, parent, model): a1 = (('-', None, '', ''), ('Comment', self.OnComment, '-', 'Comment'), ('Uncomment', self.OnUnComment, '-', 'Uncomment'), ('Indent', self.OnIndent, '-', 'Indent'), ('Dedent', self.OnDedent, '-', 'Dedent'), ('-', None, '-', ''), ('Run to cursor', self.OnRunToCursor, self.runCrsBmp, ''...
if modType == (wxSTC_MOD_CHANGEMARKER): pass
def OnModified(self, event): modType = event.GetModificationType() if modType == (wxSTC_MOD_CHANGEMARKER): pass linesAdded = event.GetLinesAdded() textAdded = event.GetText()
return if self._blockUpdate: return update = false if linesAdded: line = self.LineFromPosition(event.GetPosition()) self.breaks.moveBreakpoint(line, line + linesAdded) if update and self.model.editor.debugger: self.model.editor.debugger.breakpts.refreshList()
def OnModified(self, event): modType = event.GetModificationType() if modType == (wxSTC_MOD_CHANGEMARKER): pass linesAdded = event.GetLinesAdded() textAdded = event.GetText()
return 'wxBitmap(%s, %s)'%(`self.bmpPath`, self.extTypeMap[os.path.splitext(self.bmpPath)[-1].lower()])
return 'wxBitmap(%s, %s)'%(`path`, self.extTypeMap[os.path.splitext(path)[-1].lower()])
def valueAsExpr(self): if self.bmpPath: path, tpe = os.path.split(self.bmpPath) dir, name = os.path.split(path) if tpe == 'Bitmap': return 'wxBitmap(%s, %s)'%(`self.bmpPath`, self.extTypeMap[os.path.splitext(self.bmpPath)[-1].lower()]) elif tpe == 'ResourceModule': return self.getSrcForResPath(dir, name) else: raise Ex...
ctrl.SplitVertically(window1, window2, sp)
splitMeth = ctrl.SplitVertically
def splitWindow(self, window1, window2): ctrl = self.control sm = ctrl.GetSplitMode() sp = ctrl.GetSashPosition()
ctrl.SplitHorizontally(window1, window2, sp)
splitMeth = ctrl.SplitHorizontally else: return if window1 and window2: splitMeth(window1, window2, sp) elif window1 or window2: if window1: ctrl.Initialize(window1) else: ctrl.Initialize(window2)
def splitWindow(self, window1, window2): ctrl = self.control sm = ctrl.GetSplitMode() sp = ctrl.GetSashPosition()
return ['', ' parent.Realize()']
return ['', sourceconst.bodyIndent+'parent.Realize()']
def finaliser(self): return ['', ' parent.Realize()']
return [' parent.SetFieldsCount(%d)'%self.getCount()]+CollectionDTC.initialiser(self)
return [sourceconst.bodyIndent+'parent.SetFieldsCount(%d)'%( self.getCount())]+CollectionDTC.initialiser(self)
def initialiser(self): return [' parent.SetFieldsCount(%d)'%self.getCount()]+CollectionDTC.initialiser(self)
return ['', ' parent.SetStatusWidths(%s)'%`self.widths`]
return ['', sourceconst.bodyIndent+'parent.SetStatusWidths(%s)'%`self.widths`]
def finaliser(self): return ['', ' parent.SetStatusWidths(%s)'%`self.widths`]
def spawnChild(monitor, process):
def spawnChild(monitor, process, args=''):
def spawnChild(monitor, process): """Returns an xmlrpclib.Server, a connection to an xml-rpc server, and the input and error streams. """ # Start ChildProcessServerStart.py in a new process. script_fn = os.path.join(os.path.dirname(__file__), 'ChildProcessServerStart.py') os.environ['PYTHONPATH'] = string.join(sys.path...
cmd = '%s "%s"' % (sys.executable, script_fn)
cmd = '%s "%s" %s' % (sys.executable, script_fn, args)
def spawnChild(monitor, process): """Returns an xmlrpclib.Server, a connection to an xml-rpc server, and the input and error streams. """ # Start ChildProcessServerStart.py in a new process. script_fn = os.path.join(os.path.dirname(__file__), 'ChildProcessServerStart.py') os.environ['PYTHONPATH'] = string.join(sys.path...
def run_tcpwatch(port): os.system("tcpwatch -L9100:%d" % int(port)) start_new_thread(run_tcpwatch, (port,)) time.sleep(1) port = 9100
new_port = 9100 def run_tcpwatch(port1, port2): os.system("tcpwatch -L %d:%d" % (int(port1), int(port2))) start_new_thread(run_tcpwatch, (new_port, port)) time.sleep(3) port = new_port
def run_tcpwatch(port): os.system("tcpwatch -L9100:%d" % int(port))
def __init__(self, win):
def __init__(self, win, process_args=''): self.process_args = process_args
def __init__(self, win): DebugClient.__init__(self, win) EVT_DEBUGGER_START(win, self.win_id, self.OnDebuggerStart)
self.server, self.input_stream, self.error_stream, \ self.processId = spawnChild(self, process)
(self.server, self.input_stream, self.error_stream, self.processId) = spawnChild( self, process, self.process_args)
def OnDebuggerStart(self, evt): try: wx.wxBeginBusyCursor() try: if self.server is None: # Start the subprocess. process = wx.wxProcess(self.event_handler, self.win_id) process.Redirect() self.process = process wx.EVT_END_PROCESS(self.event_handler, self.win_id, self.OnProcessEnded) self.server, self.input_stream, self...
style = wxLC_REPORT | wxLC_SINGLE_SEL )
style = wxLC_REPORT)
def __init__(self, parent, images, debugger): wxListCtrl.__init__(self, parent, wxID_WATCHVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Attribute', wxLIST_FORMAT_LEFT, 125) self.InsertColumn(1, 'Value', wxLIST_FORMAT_LEFT, 200)
id = NewId()
id = wxNewId() self.menu.Append(id, 'Add') EVT_MENU(self, id, self.OnAdd) id = wxNewId() self.menu.Append(id, 'Edit') EVT_MENU(self, id, self.OnEdit) id = wxNewId()
def __init__(self, parent, images, debugger): wxListCtrl.__init__(self, parent, wxID_WATCHVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Attribute', wxLIST_FORMAT_LEFT, 125) self.InsertColumn(1, 'Value', wxLIST_FORMAT_LEFT, 200)
id = NewId()
id = wxNewId()
def __init__(self, parent, images, debugger): wxListCtrl.__init__(self, parent, wxID_WATCHVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Attribute', wxLIST_FORMAT_LEFT, 125) self.InsertColumn(1, 'Value', wxLIST_FORMAT_LEFT, 200)
self.watches.append((name, local))
self.watches.append([name, local])
def add_watch(self, name, local): if name: self.watches.append((name, local)) else: dlg = wxTextEntryDialog(self, 'Enter name:', 'Add a watch:', '') try: if dlg.ShowModal() == wxID_OK: self.watches.append((dlg.GetValue(), local)) finally: dlg.Destroy()
self.watches.append((dlg.GetValue(), local))
self.watches.append([dlg.GetValue(), local])
def add_watch(self, name, local): if name: self.watches.append((name, local)) else: dlg = wxTextEntryDialog(self, 'Enter name:', 'Add a watch:', '') try: if dlg.ShowModal() == wxID_OK: self.watches.append((dlg.GetValue(), local)) finally: dlg.Destroy()
del self.watches[self.selected] self.DeleteItem(self.selected)
selItems = self.getSelection() selItems.sort() selItems.reverse() for idx in selItems: del self.watches[idx] self.DeleteItem(idx)
def OnDelete(self, event): if self.selected != -1: del self.watches[self.selected] self.DeleteItem(self.selected)
self.PopupMenu(self.menu, wxPoint(self.x, self.y))
if self.selected != -1: local = self.watches[self.selected][1] self.menu.Check(self.localId, local) self.menu.Check(self.globalId, not local) self.PopupMenu(self.menu, wxPoint(self.x, self.y)) def OnEvalLocal(self, event): if self.selected != -1: for idx in self.getSelection(): self.watches[idx][1] = true self.debugg...
def OnRightClick(self, event): self.PopupMenu(self.menu, wxPoint(self.x, self.y))
self.app = self.model.editor.app
def __init__(self, model, stack = None): bdb.Bdb.__init__(self) wxFrame.__init__(self, model.editor, -1, 'Debugger - %s - %s' \ % (path.basename(model.filename), model.filename), wxPoint(0, Preferences.paletteHeight), wxSize(Preferences.inspWidth, Preferences.bottomHeight))
Utils.AddToolButtonBmpIS(self, self.toolbar,
self.runId = Utils.AddToolButtonBmpIS(self, self.toolbar,
def __init__(self, model, stack = None): bdb.Bdb.__init__(self) wxFrame.__init__(self, model.editor, -1, 'Debugger - %s - %s' \ % (path.basename(model.filename), model.filename), wxPoint(0, Preferences.paletteHeight), wxSize(Preferences.inspWidth, Preferences.bottomHeight))
Utils.AddToolButtonBmpIS(self, self.toolbar,
self.stepId = Utils.AddToolButtonBmpIS(self, self.toolbar,
def __init__(self, model, stack = None): bdb.Bdb.__init__(self) wxFrame.__init__(self, model.editor, -1, 'Debugger - %s - %s' \ % (path.basename(model.filename), model.filename), wxPoint(0, Preferences.paletteHeight), wxSize(Preferences.inspWidth, Preferences.bottomHeight))
Utils.AddToolButtonBmpIS(self, self.toolbar,
self.overId = Utils.AddToolButtonBmpIS(self, self.toolbar,
def __init__(self, model, stack = None): bdb.Bdb.__init__(self) wxFrame.__init__(self, model.editor, -1, 'Debugger - %s - %s' \ % (path.basename(model.filename), model.filename), wxPoint(0, Preferences.paletteHeight), wxSize(Preferences.inspWidth, Preferences.bottomHeight))
Utils.AddToolButtonBmpIS(self, self.toolbar,
self.outId = Utils.AddToolButtonBmpIS(self, self.toolbar,
def __init__(self, model, stack = None): bdb.Bdb.__init__(self) wxFrame.__init__(self, model.editor, -1, 'Debugger - %s - %s' \ % (path.basename(model.filename), model.filename), wxPoint(0, Preferences.paletteHeight), wxSize(Preferences.inspWidth, Preferences.bottomHeight))
Utils.AddToolButtonBmpIS(self, self.toolbar,
self.stopId = Utils.AddToolButtonBmpIS(self, self.toolbar,
def __init__(self, model, stack = None): bdb.Bdb.__init__(self) wxFrame.__init__(self, model.editor, -1, 'Debugger - %s - %s' \ % (path.basename(model.filename), model.filename), wxPoint(0, Preferences.paletteHeight), wxSize(Preferences.inspWidth, Preferences.bottomHeight))
Utils.AddToolButtonBmpIS(self, self.toolbar,
self.sourceTraceId = Utils.AddToolButtonBmpIS(self, self.toolbar,
def __init__(self, model, stack = None): bdb.Bdb.__init__(self) wxFrame.__init__(self, model.editor, -1, 'Debugger - %s - %s' \ % (path.basename(model.filename), model.filename), wxPoint(0, Preferences.paletteHeight), wxSize(Preferences.inspWidth, Preferences.bottomHeight))
self.model.editor.app.MainLoop()
self.app.MainLoop()
def startMainLoop(self): self.model.editor.app.MainLoop() self.mlc = self.mlc + 1
self.model.editor.app.ExitMainLoop()
self.app.ExitMainLoop()
def stopMainLoop(self): self.model.editor.app.ExitMainLoop() self.mlc = self.mlc - 1
print 'interaction'
def interaction(self, frame, info=None): print 'interaction' self.frame = frame code = frame.f_code file = code.co_filename base = os.path.basename(file) lineno = frame.f_lineno
if self.stackView.stack:
if self.stackView.stack and self.toolbar.GetToolState(self.sourceTraceId):
def selectSourceLine(self): if self.stackView.stack: stack = self.stackView.stack
print 'ssl', lineno
def selectSourceLine(self): if self.stackView.stack: stack = self.stackView.stack
def enableTools(self, enable = true): self.toolbar.EnableTool(self.runId, enable) self.toolbar.EnableTool(self.stepId, enable) self.toolbar.EnableTool(self.overId, enable) self.toolbar.EnableTool(self.outId, enable) self.toolbar.EnableTool(self.stopId, enable)
def selectSourceLine(self): if self.stackView.stack: stack = self.stackView.stack
self._destroyed = 0
def __init__(self, editor, filename=None, slave_mode=1): wxFrame.__init__(self, editor, -1, 'Debugger')
if self._destroyed: return
if self._destroyed: return self._destroyed = 1
def destroy(self): if self._destroyed: return self.breakpts.destroy() self.watches.destroy() self.locs.destroy() self.globs.destroy() self.sb.stateCols = None self.stream_timer = None self._destroyed = 1
self.stream_timer = None self._destroyed = 1
if self.stream_timer is not None: self.stream_timer.Stop() self.stream_timer = None
def destroy(self): if self._destroyed: return self.breakpts.destroy() self.watches.destroy() self.locs.destroy() self.globs.destroy() self.sb.stateCols = None self.stream_timer = None self._destroyed = 1
else: self.debug_client = None
def killDebugger(self): if self._destroyed: return self.running = 0 if self.debug_client: try: self.debug_client.kill() except: print 'Error on killing debugger: %s: %s'%sys.exc_info()[:2] else: self.debug_client = None self.clearViews()
if show_dialog:
if self._closing: self.destroy() self.Destroy() elif show_dialog:
def OnDebuggerStopped(self, event): """Called when a debugger process stops.""" show_dialog = 0 if self.running: show_dialog = 1 self.killDebugger() if show_dialog: wxMessageBox('The debugger process stopped prematurely.', 'Debugger stopped', wxOK | wxICON_EXCLAMATION | wxCENTRE) self.Close() self.Destroy()
self.Close() self.Destroy() def OnStreamTimer(self, event=None, force_timer=0):
def OnStreamTimer(self, event=None):
def OnDebuggerStopped(self, event): """Called when a debugger process stops.""" show_dialog = 0 if self.running: show_dialog = 1 self.killDebugger() if show_dialog: wxMessageBox('The debugger process stopped prematurely.', 'Debugger stopped', wxOK | wxICON_EXCLAMATION | wxCENTRE) self.Close() self.Destroy()
if not self.stream_timer.IsRunning(): self.stream_timer.Start(100)
def OnStreamTimer(self, event=None, force_timer=0): if self.stream_timer: if not self.stream_timer.IsRunning(): self.stream_timer.Start(100) # One-shot mode. self.updateOutputWindow()
while self.debug_client:
if self.debug_client:
def updateOutputWindow(self): while self.debug_client: info = self.debug_client.pollStreams() if info: errout = self.editor.erroutFrm stdout_text, stderr_text = info if stdout_text: errout.appendToOutput(stdout_text) #self.appendToOutputWindow(stdout_text) if stderr_text: errout.appendToErrors(stderr_text) #self.append...
if info: errout = self.editor.erroutFrm
if info and self.editor:
def updateOutputWindow(self): while self.debug_client: info = self.debug_client.pollStreams() if info: errout = self.editor.erroutFrm stdout_text, stderr_text = info if stdout_text: errout.appendToOutput(stdout_text) #self.appendToOutputWindow(stdout_text) if stderr_text: errout.appendToErrors(stderr_text) #self.append...
errout.appendToOutput(stdout_text)
self.editor.erroutFrm.appendToOutput(stdout_text)
def updateOutputWindow(self): while self.debug_client: info = self.debug_client.pollStreams() if info: errout = self.editor.erroutFrm stdout_text, stderr_text = info if stdout_text: errout.appendToOutput(stdout_text) #self.appendToOutputWindow(stdout_text) if stderr_text: errout.appendToErrors(stderr_text) #self.append...
errout.appendToErrors(stderr_text) if not stdout_text and not stderr_text: break else: break
self.editor.erroutFrm.appendToErrors(stderr_text)
def updateOutputWindow(self): while self.debug_client: info = self.debug_client.pollStreams() if info: errout = self.editor.erroutFrm stdout_text, stderr_text = info if stdout_text: errout.appendToOutput(stdout_text) #self.appendToOutputWindow(stdout_text) if stderr_text: errout.appendToErrors(stderr_text) #self.append...
if self._destroyed: return self.restoreDebugger()
if self._destroyed: return
def OnDebuggerException(self, event): if self._destroyed: return
self.clearStepPos() self.enableStepping() self.invalidatePanes() self.updateSelectedPane(do_request=0) self.proceedAndRequestStatus('set_quit')
if STOP_GENTLY: self.clearStepPos() self.enableStepping() self.invalidatePanes() self.updateSelectedPane(do_request=0) self.proceedAndRequestStatus('set_quit') else: self.killDebugger()
def OnStop(self, event): self.clearStepPos() self.enableStepping() self.invalidatePanes() self.updateSelectedPane(do_request=0) self.proceedAndRequestStatus('set_quit')
self.destroy()
def OnCloseWindow(self, event): try: self.killDebugger() finally: self.destroy() # closing must succeed if self.editor: try: if self.isInShellNamepace(): self.editor.shell.debugShell(0, None) except: pass #cls, err = sys.exc_info()[:2] #print 'close shell debug failed', cls, str(err) self.editor.debugger = None self.ed...
self.Hide()
if not was_alive: self.destroy() self.Destroy()
def OnCloseWindow(self, event): try: self.killDebugger() finally: self.destroy() # closing must succeed if self.editor: try: if self.isInShellNamepace(): self.editor.shell.debugShell(0, None) except: pass #cls, err = sys.exc_info()[:2] #print 'close shell debug failed', cls, str(err) self.editor.debugger = None self.ed...
def writeImports(self): return 'from wxPython.lib.maskededit import *'
def writeImports(self): return 'from wxPython.lib.maskededit import *'
return {'Editable': ('CtrlRoute',
props = WindowDTC.properties(self) props.update({'Editable': ('CtrlRoute',
def properties(self): return {'Editable': ('CtrlRoute', wxGridPtr.IsEditable, wxGridPtr.EnableEditing), 'GridLinesEnabled': ('CtrlRoute', wxGridPtr.GridLinesEnabled, wxGridPtr.EnableGridLines)}
'GridLinesEnabled': ('CtrlRoute', wxGridPtr.GridLinesEnabled, wxGridPtr.EnableGridLines)}
'GridLinesEnabled': ('CtrlRoute', wxGridPtr.GridLinesEnabled, wxGridPtr.EnableGridLines)}) return props
def properties(self): return {'Editable': ('CtrlRoute', wxGridPtr.IsEditable, wxGridPtr.EnableEditing), 'GridLinesEnabled': ('CtrlRoute', wxGridPtr.GridLinesEnabled, wxGridPtr.EnableGridLines)}
tbMenus.extend(menuLst)
tbMenus.extend(list(menuLst))
def addTools(self, toolbar): if self.list.node and self.controllers.has_key(self.list.node.protocol): prot = self.list.node.protocol tbMenus = [] for menuLst in self.controllers[prot].toolbarMenus: tbMenus.extend(menuLst) for wID, name, meth, bmp in tbMenus: if name == '-' and not bmp: toolbar.AddSeparator() elif bmp ...
nd = self.list.node
def OnOpen(self, event): if self.list.selected != -1: name = self.list.GetItemText(self.list.selected) if name == '..': nd = self.list.node if not nd.openParent(self.editor): self.tree.SelectItem(self.tree.GetItemParent(self.tree.GetSelection())) else: item = self.list.items[self.list.selected-1] if item.isFolderish():...
self.tree.SelectItem(self.tree.GetItemParent(self.tree.GetSelection()))
treeItem = self.tree.GetItemParent(self.tree.GetSelection()) if treeItem.IsOk(): self.tree.SelectItem(treeItem)
def OnOpen(self, event): if self.list.selected != -1: name = self.list.GetItemText(self.list.selected) if name == '..': nd = self.list.node if not nd.openParent(self.editor): self.tree.SelectItem(self.tree.GetItemParent(self.tree.GetSelection())) else: item = self.list.items[self.list.selected-1] if item.isFolderish():...
def getDefaultData(self): return sourceconst.defSig %(self.modelIdentifier, '')
def getDefaultData(self): return sourceconst.defSig %(self.modelIdentifier, '')
def run(self, args = ''):
def findAppInModules(self, args):
def run(self, args = ''): # find app module for name, Model in self.moduleModels.items(): if Model.modelIdentifier in Controllers.appModelIdReg: filepath = self.moduleFilename(name) if self.editor.modules.has_key(filepath): model = self.editor.modules[filepath].model else: model = Model('', filepath, '', self.editor, 0...
model.run(args) return
return model return None
def run(self, args = ''): # find app module for name, Model in self.moduleModels.items(): if Model.modelIdentifier in Controllers.appModelIdReg: filepath = self.moduleFilename(name) if self.editor.modules.has_key(filepath): model = self.editor.modules[filepath].model else: model = Model('', filepath, '', self.editor, 0...
wxLogWarning('No Application module found in modules list to link to')
def run(self, args = ''): app = self.findAppInModules(args) if app: app.run(args) else: wxLogWarning('No Application module found in modules list to link to') def debug(self, params=None, cont_if_running=0, cont_always=0, temp_breakpoint=None): app = self.findAppInModules(params) if app: app.debug(params, cont_if_runn...
def run(self, args = ''): # find app module for name, Model in self.moduleModels.items(): if Model.modelIdentifier in Controllers.appModelIdReg: filepath = self.moduleFilename(name) if self.editor.modules.has_key(filepath): model = self.editor.modules[filepath].model else: model = Model('', filepath, '', self.editor, 0...
self.SetItemData(i, i)
self.SetItemData(i-1, i-1)
def refreshCtrl(self): ListCtrlView.refreshCtrl(self) if self.stats: self.statKeyList = self.stats.keys() self.statKeyList.sort() i = 0 for filename, lineno, funcname in self.statKeyList: stats = self.stats[(filename, lineno, funcname)] i = self.addReportItems(i, (os.path.basename(filename), str(lineno), funcname, '%d'...
self.queue.put(name)
if string.strip(name): self.queue.put(name)
def run(self, host='127.0.0.1', port=socketPort): #print 'running listner thread %d'%id(self) import socket from select import select # Open a socket and listen. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.bind((host, port)) except socket.error, err: ##print 'Socket error', str(err) # printing from thr...
doDebug = constricted = 0
doDebug = constricted = emptyEditor = 0
def sendToRunningBoa(names, host='127.0.0.1', port=50007): import socket try: if names: print 'Sent', for name in names: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) # do not change files of form [prot]://[path] if string.find(name, '://') == -1: name = os.path.abspath(name) s.send(name...
_doDebug = _constricted = 0
_doDebug = _doRemoteDebugSvr = _constricted = _emptyEditor = 0
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version'])
optlist, args = getopt.getopt(argv, 'CDTSBO:ERhv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'EmptyEditor', 'RemoteDebugServer', 'help', 'version'])
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
return _doDebug, _startupfile, _startupModules, _constricted, optlist, args
return (_doDebug, _startupfile, _startupModules, _constricted, _emptyEditor, _doRemoteDebugSvr, optlist, args)
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
doDebug, startupfile, startupModules, constricted, opts, args = \ processArgs(sys.argv[1:])
(doDebug, startupfile, startupModules, constricted, emptyEditor, doDebugSvr, opts, args) = processArgs(sys.argv[1:]) if doDebugSvr and startupModules: print 'Running as a Remote Debug Server' from Debugger.RemoteServer import start start(username='', password='') sys.argv = startupModules execfile(sys.argv[0], {'__n...
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
if (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) < __version__.wx_version:
if wxVERSION < __version__.wx_version:
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
wxMessageBox('Sorry! This version of Boa requires at least wxPython %d.%d.%d'%ver_required,
wxMessageBox('Sorry! This version of Boa requires at least '\ 'wxPython %d.%d.%d'%__version__.ver_required,
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
'Module for in-process debugging of wxPython and Python apps',
'Module for out-of-process debugging of Python apps',
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
'ExtraZopeCompanions.plug-in': [0, '', 'Plug-ins/ExtraZopeCompanions.plug-in.py'],
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
'PascalSupport.plug-in': [0, '', 'Plug-ins/PascalSupport.plug-in.py'],
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
'ProdFormulator.plug-in': [0, '', 'Plug-ins/ProdFormulator.plug-in.py'], 'ProdPageTemplates.plug-in': [0, '', 'Plug-ins/ProdPageTemplates.plug-in.py'],
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
'UserCompanions.plug-in': [0, '', 'Plug-ins/UserCompanions.plug-in.py'],
def processArgs(argv): _doDebug = _constricted = 0 _startupfile = '' _startupModules = () import getopt optlist, args = getopt.getopt(argv, 'CDTSBO:hv', ['Constricted', 'Debug', 'Trace', 'StartupFile', 'BlockHomePrefs', 'OverridePrefsDirName', 'help', 'version']) if (('-D', '') in optlist or ('--Debug', '') in optlist)...
editor.restoreEditorState()
if not emptyEditor: editor.restoreEditorState()
def OnInit(self): wxInitAllImageHandlers()
ListCtrlView.__init__(self, parent, model, wx.wxLC_REPORT,
ListCtrlView.__init__(self, parent, model, wx.LC_REPORT,
def __init__(self, parent, model): ListCtrlView.__init__(self, parent, model, wx.wxLC_REPORT, (('Start', self.OnStart, '-', ''), ('End', self.OnEnd, '-', ''), ('Delete', self.OnDelete, '-', ''), ), 1)
dlg = wx.wxTextEntryDialog(self, 'Start time :%s\nEnd time :%s\n\n'\
dlg = wx.TextEntryDialog(self, 'Start time :%s\nEnd time :%s\n\n'\
def OnEnd(self, event): selIdx = self.getSelectedIndex() start, end, desc = self.times[selIdx]
if dlg.ShowModal() == wx.wxID_OK:
if dlg.ShowModal() == wx.ID_OK:
def OnEnd(self, event): selIdx = self.getSelectedIndex() start, end, desc = self.times[selIdx]
dlg = wx.wxMessageDialog(self, 'Are you sure?', 'Delete', wx.wxOK | wx.wxCANCEL | wx.wxICON_QUESTION)
dlg = wx.MessageDialog(self, 'Are you sure?', 'Delete', wx.OK | wx.CANCEL | wx.ICON_QUESTION)
def OnDelete(self, event): selIdx = self.getSelectedIndex()
if dlg.ShowModal() == wx.wxID_OK:
if dlg.ShowModal() == wx.ID_OK:
def OnDelete(self, event): selIdx = self.getSelectedIndex()
time.strftime(self.timeFmt, time.gmtime(value))) )
time.strftime(self.timeFmt, time.localtime(value))) )
def getPropertyItems(self): res = [] attrs = self.fsNode.stdAttrs
self.SetText(self.getModelData()) self.EmptyUndoBuffer() self.GotoPos(self.pos) curVsblLn = self.GetFirstVisibleLine() self.ScrollBy(0, prevVsblLn - curVsblLn)
self._blockUpdate = true try: newData = self.getModelData() txtLen = self.GetTextLength() if txtLen and newData != self.GetText() or not txtLen: self.SetText(newData) if not txtLen: self.EmptyUndoBuffer() self.GotoPos(self.pos) curVsblLn = self.GetFirstVisibleLine() self.LineScroll(0, prevVsblLn - curVsblLn) self.SetSa...
def refreshCtrl(self): if wxPlatform == '__WXGTK__': self.NoUpdateUI = 1 ## disable event handler # set whole document to current EOL style fixing mixed CRLF/LF code that # can be introduced by pasting from the clipboard
self.InsertText(self.GetTextLength(), ' ')
def refreshModel(self): if self.isModified(): self.model.modified = true self.nonUserModification = false
self.EmptyUndoBuffer()
self.SetSavePoint()
def refreshModel(self): if self.isModified(): self.model.modified = true self.nonUserModification = false
self.ScrollBy(0, lineno - vl) if offset != -1: self.SetCurrentPosition(self.GetCurrentPos()+offset+1)
self.LineScroll(0, lineno - vl) if offset != -1: self.SetCurrentPos(self.GetCurrentPos()+offset+1)
def gotoLine(self, lineno, offset = -1): self.GotoLine(lineno) vl = self.GetFirstVisibleLine() self.ScrollBy(0, lineno - vl) if offset != -1: self.SetCurrentPosition(self.GetCurrentPos()+offset+1)
startPos = self.GetLineStartPos(lineno) + start
startPos = self.PositionFromLine(lineno) + start
def selectSection(self, lineno, start, word): self.gotoLine(lineno) length = len(word) startPos = self.GetLineStartPos(lineno) + start endPos = startPos + length self.SetSelection(startPos, endPos)
sp = self.GetLineStartPos(lineno) ep = self.GetLineStartPos(lineno+1)-1
sp = self.PositionFromLine(lineno) ep = self.PositionFromLine(lineno+1)-1
def selectLine(self, lineno): self.GotoLine(lineno) sp = self.GetLineStartPos(lineno) ep = self.GetLineStartPos(lineno+1)-1 self.SetSelection(sp, ep)
ln = self.GetLineFromPos(pos) st = pos - self.GetLineStartPos(ln)
ln = self.LineFromPosition(pos) st = pos - self.PositionFromLine(ln)
def updateStatusBar(self): pos = self.GetCurrentPos() ln = self.GetLineFromPos(pos) st = pos - self.GetLineStartPos(ln)
ln = self.GetLineFromPos(cp) indent = cp - self.GetLineStartPos(ln)
ln = self.LineFromPosition(cp) indent = cp - self.PositionFromLine(ln)
def insertCodeBlock(self, text): cp = self.GetCurrentPos() ln = self.GetLineFromPos(cp) indent = cp - self.GetLineStartPos(ln) lns = string.split(text, self.eol) text = string.join(lns, self.eol+indent*' ')
return self.GetModified() or self.nonUserModification
return self.GetModify() or self.nonUserModification
def isModified(self): return self.GetModified() or self.nonUserModification
selStartLine = self.GetLineFromPos(selStartPos) startPos = self.GetLineStartPos(selStartLine) selEndLine = self.GetLineFromPos(selEndPos) if selEndPos != self.GetLineStartPos(selEndLine):
selStartLine = self.LineFromPosition(selStartPos) startPos = self.PositionFromLine(selStartLine) selEndLine = self.LineFromPosition(selEndPos) if selEndPos != self.PositionFromLine(selEndLine):
def reselectSelectionAsBlock(self): selStartPos, selEndPos = self.GetSelection() selStartLine = self.GetLineFromPos(selStartPos) startPos = self.GetLineStartPos(selStartLine) selEndLine = self.GetLineFromPos(selEndPos) if selEndPos != self.GetLineStartPos(selEndLine): selEndLine = selEndLine + 1 endPos = self.GetLineSt...
endPos = self.GetLineStartPos(selEndLine)
endPos = self.PositionFromLine(selEndLine)
def reselectSelectionAsBlock(self): selStartPos, selEndPos = self.GetSelection() selStartLine = self.GetLineFromPos(selStartPos) startPos = self.GetLineStartPos(selStartLine) selEndLine = self.GetLineFromPos(selEndPos) if selEndPos != self.GetLineStartPos(selEndLine): selEndLine = selEndLine + 1 endPos = self.GetLineSt...
self.SetSelection(self.GetLineStartPos(sls), self.GetLineStartPos(sle)-1)
self.SetSelection(self.PositionFromLine(sls), self.PositionFromLine(sle)-1)
def processSelectionBlock(self, func): self.BeginUndoAction() try: sls, sle = self.reselectSelectionAsBlock() textLst = func(string.split(self.GetSelectedText(), self.eol))[:-1] self.ReplaceSelection(string.join(textLst, self.eol)+self.eol) if sle > sls: self.SetSelection(self.GetLineStartPos(sls), self.GetLineStartPos...
lineno = self.GetLineFromPos(self.GetCurrentPos())
lineno = self.LineFromPosition(self.GetCurrentPos())
def OnMarkPlace(self, event): lineno = self.GetLineFromPos(self.GetCurrentPos()) self.MarkerAdd(lineno, markPlaceMrk) self.model.editor.addBrowseMarker(lineno) # Encourage a redraw wxYield() self.MarkerDelete(lineno, markPlaceMrk)
self.ScrollBy(0, prevVsblLn - curVsblLn)
self.LineScroll(0, prevVsblLn - curVsblLn)
def refreshCtrl(self): self.pos = self.GetCurrentPos() prevVsblLn = self.GetFirstVisibleLine()
self.bindShortcuts()
def __init__(self, parent, wId): StyledTextCtrls.wxStyledTextCtrl.__init__(self, parent, wId, style = wxCLIP_CHILDREN | wxSUNKEN_BORDER) StyledTextCtrls.CallTipCodeHelpSTCMix.__init__(self) StyledTextCtrls.AutoCompleteCodeHelpSTCMix.__init__(self) StyledTextCtrls.PythonStyledTextCtrlMix.__init__(self, wId, ())
self.SetAcceleratorTable(wxAcceleratorTable( [ (keyDefs['HistoryUp'][0], keyDefs['HistoryUp'][1], wxID_SHELL_HISTORYUP), (keyDefs['HistoryDown'][0], keyDefs['HistoryDown'][1], wxID_SHELL_HISTORYDOWN), (keyDefs['CodeComplete'][0], keyDefs['CodeComplete'][1], wxID_SHELL_CODECOMP), (keyDefs['CallTips'][0], keyDefs['CallTi...
self.sc = {} self.sc[(keyDefs['HistoryUp'][0], keyDefs['HistoryUp'][1])] = self.OnHistoryUp self.sc[(keyDefs['HistoryDown'][0], keyDefs['HistoryDown'][1])] = self.OnHistoryDown self.sc[(keyDefs['CodeComplete'][0], keyDefs['CodeComplete'][1])] = self.OnShellCodeComplete self.sc[(keyDefs['CallTips'][0], keyDefs['CallTips...
def bindShortcuts(self): self.SetAcceleratorTable(wxAcceleratorTable( [ (keyDefs['HistoryUp'][0], keyDefs['HistoryUp'][1], wxID_SHELL_HISTORYUP), (keyDefs['HistoryDown'][0], keyDefs['HistoryDown'][1], wxID_SHELL_HISTORYDOWN), (keyDefs['CodeComplete'][0], keyDefs['CodeComplete'][1], wxID_SHELL_CODECOMP), (keyDefs['CallT...
else: if kk == 8:
elif kk == 8:
def OnKeyDown(self, event): #if Preferences.handleSpecialEuropeanKeys: # self.handleSpecialEuropeanKeys(event, Preferences.euroKeysCountry)
if self.lines.current == self.lines.count -1 and \ self.lines.pos - self.PositionFromLine(self.lines.current) < 5: return
if self.lines.current == self.lines.count -1 and \ self.lines.pos - self.PositionFromLine(self.lines.current) < 5: return elif controlDown: if shiftDown and self.sc.has_key((wxACCEL_CTRL|wxACCEL_SHIFT, kk)): self.sc[(wxACCEL_CTRL|wxACCEL_SHIFT, kk)](self) elif self.sc.has_key((wxACCEL_CTRL, kk)): self.sc[(wxACCEL_CTRL,...
def OnKeyDown(self, event): #if Preferences.handleSpecialEuropeanKeys: # self.handleSpecialEuropeanKeys(event, Preferences.euroKeysCountry)
zi.date_time = time.gmtime(fsNode.stdAttrs['modify-date'])[:6]
zi.date_time = time.localtime(fsNode.stdAttrs['modify-date'])[:6]
def copyFromFS(self, fsNode, fn=''): if not fn: fn = os.path.basename(fsNode.resourcepath)
zi.date_time = time.gmtime()[:6]
zi.date_time = time.localtime()[:6]
def newFolder(self, name): zf = self.ArchiveClass(self.zipFileNode.resourcepath, 'a', self.compression) try: ad = self.getArcDir() if ad: ad +='/' newArcName = '%s%s/'%(ad, name) zi = self.newInfoClass(newArcName) zi.file_size = 0 zi.flag_bits = 0x02 zi.date_time = time.gmtime()[:6] zf.writestr(zi, '') self.zipFileNode...