rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
impPos = self.data.find(sourceconst.defImport) | impPos = self.data.find(sourceconst.defImport.strip()) | def findImports(self): impPos = self.data.find(sourceconst.defImport) impPos = self.data.find('import', impPos + 1) |
absPath = appProt+'://'+self.convertToUnixPath(os.path.normpath(os.path.join(\ os.path.dirname(appFilename), modFilename))) else: absPath = name + ModuleModel.ext | absPath = appProt+'://'+self.convertToUnixPath(os.path.normpath( os.path.join(os.path.dirname(appFilename), modFilename))) else: absPath = self.modules[name][2] | def moduleFilename(self, name): """ Return absolute filename of the given module """ if not self.modules.has_key(name): raise 'No such module in application: '+name |
return self.editor.openOrGotoModule(self.moduleFilename(name), self) | from Explorers.Explorer import TransportError try: return self.editor.openOrGotoModule(self.moduleFilename(name), self) except TransportError, err: if str(err) == 'Unhandled transport' and err[1][0] == 'none': if wx.wxMessageBox('Unsaved file no longer open in the Editor.\n' 'Remove it from application modules ?', 'Mis... | def openModule(self, name): return self.editor.openOrGotoModule(self.moduleFilename(name), self) |
if not self.savedAs: | if not self.savedAs or relFilename.startswith('none://'): | def normaliseModuleRelativeToApp(self, relFilename): """ Normalise relative paths to absolute paths """ if not self.savedAs: return relFilename else: protsplit = self.filename.split('://') if len(protsplit) == 1: prot, appFilename = 'file', self.filename elif len(protsplit) == 2: prot, appFilename = protsplit elif len(... |
palettePage.addButton('Package', None, None, self.OnNewPackage, self.OnHint, self.OnHintLeave, wxGenBitmapButton) | palettePage.addButton('Package', None, None, self.OnNewPackagePost, self.OnHint, self.OnHintLeave, wxGenBitmapButton) | def __init__(self, parent, id, app): |
def OnClick(self, event): self.componentSB.SetStatusText('Palette Click'+`event.GetId()`) | def OnClick(self, event): self.componentSB.SetStatusText('Palette Click'+`event.GetId()`) | |
def OnNewWidget(self, event): pass | def OnNewPackagePost(self, event): wxPostEvent(self, NewPackageEvent()) | def OnNewWidget(self, event): pass |
pass | def OnNewPackage(self, event): self.editor.addNewPackage() pass | |
startupfile = os.environ.get('PYTHONSTARTUP') try: execfile(startupfile) except Exception, error: print 'Unable to load startup script', startupfile, ':', str(error) else: print 'Executed PYTHONSTARTUP' | pass | def get_current_frame(): try: 1 + '' # raise an exception except: return sys.exc_info()[2].tb_frame |
startupErrors = [] | if ('-s', '') in optlist: startupfile = os.environ.get('BOASTARTUP') or \ os.environ.get('PYTHONSTARTUP') | def get_current_frame(): try: 1 + '' # raise an exception except: return sys.exc_info()[2].tb_frame |
sys.boa_ide = self.main.editor | self.main.editor.shell.execStartupScript(startupfile) | def OnInit(self): wxInitAllImageHandlers() |
wxPostEvent(self.tabsSplitter, wx.SizeEvent(self.tabsSplitter.GetSize())) | wx.PostEvent(self.tabsSplitter, wx.SizeEvent(self.tabsSplitter.GetSize())) | def __init__(self, parent, id, inspector, newMenu, componentPalette, app, palette): self._created = False self._init_ctrls(parent) |
self.data = self.setDataFromLines(lines) | self.setDataFromLines(lines) | def applyChangeBlock(self, conflict, blockIdx): rev, start, size = conflict lines = self.getDataAsLines() |
def debug(self, params = None): | def debug(self, params=None, cont_if_running=0, cont_always=0, temp_breakpoint=None): | def debug(self, params = None): if self.savedAs: if self.editor.debugger: self.editor.debugger.Show(true) else: self.editor.debugger = Debugger.DebuggerFrame(self) self.editor.debugger.Show(true) if params is None: params = [] self.editor.debugger.debug_file(self.editor.debugger.filename, params) |
if self.editor.debugger: self.editor.debugger.Show(true) else: self.editor.debugger = Debugger.DebuggerFrame(self) self.editor.debugger.Show(true) if params is None: params = [] self.editor.debugger.debug_file(self.editor.debugger.filename, params) | debugger = self.editor.debugger if Preferences.useDebugger == 'old': if debugger: debugger.Show(true) else: self.editor.debugger = Debugger.DebuggerFrame(self) debugger = self.editor.debugger debugger.Show(true) if params is None: params = [] debugger.debug_file(debugger.filename, params) elif Preferences.useDebugger =... | def debug(self, params = None): if self.savedAs: if self.editor.debugger: self.editor.debugger.Show(true) else: self.editor.debugger = Debugger.DebuggerFrame(self) self.editor.debugger.Show(true) if params is None: params = [] self.editor.debugger.debug_file(self.editor.debugger.filename, params) |
will generate the creation code for the object the constructor | will generate the creation code for the object, the constructor | def readCustomClasses(self, mod, cls): """ Read definition for Custom Classes Custom Classes can be defined as a class attribute named _custom_classes containing a dictionary defining wxPython classes and their custom equivalents, e.g. _custom_classes = {'wxTreeCtrl': ['MyTreeCtrl', 'AdvancedTreeCtrl']} These custom ... |
else: print 'could not find unsaved module', absPath, self.editor.modules | def idModel(self, name): absPath = self.normaliseModuleRelativeToApp(self.modules[name][2]) if os.path.exists(absPath): self.moduleModels[name], main = identifyFile(absPath) else: if self.editor.modules.has_key(absPath): self.moduleModels[name], main = identifySource( self.editor.modules[absPath].model.getModule().sour... | |
id = NewId() | id = wxNewId() | def __init__(self, parent, model): id = NewId() wxTreeCtrl.__init__(self, parent, id)#, style = wxTR_HAS_BUTTONS | wxSUNKEN_BORDER) EditorView.__init__(self, model, (('Goto line', self.OnGoto, self.gotoLineBmp, ''),), 0) |
parent.AddPage(bSelect=false, imageId=-1, pPage=self.panel1, strText='Pages0') parent.AddPage(bSelect=false, imageId=-1, pPage=self.panel2, strText='Pages1') parent.AddPage(bSelect=true, imageId=-1, pPage=self.panel3, strText='Pages2') | parent.AddPage(select=false, imageId=-1, page=self.panel1, text='Pages0') parent.AddPage(select=false, imageId=-1, page=self.panel2, text='Pages1') parent.AddPage(select=true, imageId=-1, page=self.panel3, text='Pages2') | def _init_coll_notebook1_Pages(self, parent): # generated method, don't edit |
self.killDebugger() | if not self._destroyed: self.killDebugger() | def OnDebuggerStopped(self, event): """Called when a debugger process stops.""" show_dialog = 0 if self.running: show_dialog = 1 self.killDebugger() if show_dialog: wxMessageDialog( self, 'The debugger process stopped prematurely.', 'Debugger stopped', wxOK | wxICON_EXCLAMATION | wxCENTRE).ShowModal() |
wxMessageDialog( self, 'The debugger process stopped prematurely.', 'Debugger stopped', wxOK | wxICON_EXCLAMATION | wxCENTRE).ShowModal() | wxMessageBox('The debugger process stopped prematurely.', 'Debugger stopped', wxOK | wxICON_EXCLAMATION | wxCENTRE) self.Destroy() | def OnDebuggerStopped(self, event): """Called when a debugger process stops.""" show_dialog = 0 if self.running: show_dialog = 1 self.killDebugger() if show_dialog: wxMessageDialog( self, 'The debugger process stopped prematurely.', 'Debugger stopped', wxOK | wxICON_EXCLAMATION | wxCENTRE).ShowModal() |
if not self.stream_timer.IsRunning(): self.stream_timer.Start(100, 1) | def OnStreamTimer(self, event=None, force_timer=0): if self.stream_timer: self.updateOutputWindow() # A non polling stream can block a process ## The user is looking at the output page. ## if (force_timer or self.nbTop.GetSelection() == 2) \ if not self.stream_timer.IsRunning(): self.stream_timer.Start(100, 1) # One-s... | |
self._destroyed = 1 | def OnCloseWindow(self, event): try: self.killDebugger() finally: self.debug_client = None self.destroy() self._destroyed = 1 try: self.editor.debugger = None except: pass self.editor = None #event.Skip() self.Destroy() | |
self.Destroy() | self.Hide() | def OnCloseWindow(self, event): try: self.killDebugger() finally: self.debug_client = None self.destroy() self._destroyed = 1 try: self.editor.debugger = None except: pass self.editor = None #event.Skip() self.Destroy() |
getattr(self, command)(*args) | apply(getattr(self, command), args) | def proceedAndRequestStatus(self, command, temp_breakpoint=0, args=()): """Executes one non-blocking command then returns getStatusSummary(). Blocking.""" if temp_breakpoint: self.addBreakpoint(temp_breakpoint[0], temp_breakpoint[1], 1) if command: allowed = ('set_continue', 'set_step', 'set_step_over', 'set_step_out'... |
except Exception, e: | except: | def run(self, cmd, globals=None, locals=None): try: self._running = 1 try: Bdb.run(self, cmd, globals, locals) except (BdbQuit, SystemExit): pass except Exception, e: # Provide post-mortem analysis. import traceback traceback.print_exc() self.exc_info = sys.exc_info() self.frame = self.exc_info[2].tb_frame self.quittin... |
self.entries[-Preferences.exRecentFilesListSize:] = [] | self.entries[Preferences.exRecentFilesListSize:] = [] | def add(self, respath): if respath in self.entries: self.entries.remove(respath) |
self.data = self.data[:start]+pprint.pformat(dct).replace('\r', eol)+\ | self.data = self.data[:start]+pprint.pformat(dct).replace('\n', eol)+\ | def writeGlobalDict(self, name, dct): start, end = self.findGlobalDict(name) eol = Utils.getEOLMode(self.data) self.data = self.data[:start]+pprint.pformat(dct).replace('\r', eol)+\ self.data[end:] |
kk = event.KeyCode() | kk = event.GetKeyCode() | def OnKeyDown(self, event): if Preferences.handleSpecialEuropeanKeys: self.handleSpecialEuropeanKeys(event, Preferences.euroKeysCountry) |
if line is None: raise 'Terminate' | if line is None: raise Exception, 'Terminate' | def readline(self): self._reading = True self._output.AddText('\n'+Preferences.ps4) self._output.EnsureCaretVisible() try: while not self._buffer: # XXX with safe yield once the STC loses focus there is no way # XXX to give it back the focus # wxSafeYield() time.sleep(0.001) wx.Yield() line = self._buffer.pop() if line... |
prog = 0 totLOC = 0 classCnt = 0 for module in modules: self.editor.statusBar.progress.SetValue(prog) prog = prog + 1 self.editor.statusBar.setHint('Parsing '+module+'...') if module[:7] != 'file://': print '%s skipped, only local files supported for Imports View' else: module = module[7:] try: f = open(module) exce... | try: prog = 0 totLOC = 0 classCnt = 0 for module in modules: self.editor.statusBar.progress.SetValue(prog) prog = prog + 1 self.editor.setStatus('Parsing '+module+'...') if module[:7] != 'file://': print '%s skipped, only local files supported for Imports View' else: module = module[7:] try: f = open(module) except ... | def buildImportRelationshipDict(self, modules): relationships = {} |
addTool(self.editor, toolbar, self.debugBmp, 'Debug module', self.OnDebug) | addTool(self.editor, toolbar, self.debugBmp, 'Debug application', self.OnDebugApp) | def addTools(self, toolbar, model): SourceController.addTools(self, toolbar, model) toolbar.AddSeparator() addTool(self.editor, toolbar, self.profileBmp, 'Profile', self.OnProfile) addTool(self.editor, toolbar, self.compileBmp, 'Check source', self.OnCheckSource) if hasattr(model, 'app') and model.app: addTool(self.edi... |
newMod.views['Documentation'].focus() | view = newMod.editor.addNewView(ModuleDocView.viewName, ModuleDocView) view.refreshCtrl() view.focus() | def OnLinkClicked(self, linkinfo): url = linkinfo.GetHref() |
} return self.genClassesSect(page + modBody, classNames) | 'FunctionList': funcList, } return self.genFunctionsSect(\ self.genClassesSect(page + modBody, classNames), funcNames) | def genModuleSect(self, page): classList, classNames = self.genClassListSect() module = self.model.getModule() modBody = wxwAppModuleTemplate % { \ 'ModuleSynopsis': module.getModuleDoc(), 'Module': self.model.moduleName, 'ModuleList': self.genModuleListSect()[0], 'ClassList': classList, } |
host, filepath, meta = segs[0], segs[1:-1], segs[-1] | host, filepaths, meta = segs[0], segs[1:-1], segs[-1] | def uriSplitZopeDebug(filename, filepath): # zopedebug://[host[:port]]/[path]/[meta type] # magically maps zopedebug urls to Boa zope uris segs = string.split(filepath, '/') if len(segs) < 3: raise ExplorerNodes.TransportCategoryError( 'Zope debug path invalid', filepath) host, filepath, meta = segs[0], segs[1:-1], seg... |
filepath = string.join(filepath, '/') | path = string.join(filepaths, '/') | def uriSplitZopeDebug(filename, filepath): # zopedebug://[host[:port]]/[path]/[meta type] # magically maps zopedebug urls to Boa zope uris segs = string.split(filepath, '/') if len(segs) < 3: raise ExplorerNodes.TransportCategoryError( 'Zope debug path invalid', filepath) host, filepath, meta = segs[0], segs[1:-1], seg... |
return 'zope', '%s|%s' %(name, meta), filepath, \ 'zope://%s/<%s>/%s'%(name, meta, filepath) | return 'zope', '%s|%s' %(name, meta), path, \ 'zope://%s/<%s>/%s'%(name, meta, path) | def uriSplitZopeDebug(filename, filepath): # zopedebug://[host[:port]]/[path]/[meta type] # magically maps zopedebug urls to Boa zope uris segs = string.split(filepath, '/') if len(segs) < 3: raise ExplorerNodes.TransportCategoryError( 'Zope debug path invalid', filepath) host, filepath, meta = segs[0], segs[1:-1], seg... |
def write(s): | def write(self, s): | def write(s): pass |
self.printData = pdd.GetPrintData() | self.printData = wxPrintData(pdd.GetPrintData()) | def OnPrintSetup(self, event): printerDlg = wxPrintDialog(self) pdd = printerDlg.GetPrintDialogData() pdd.SetPrintData(self.printData) pdd.SetSetupDialog(true) printerDlg.ShowModal() self.printData = pdd.GetPrintData() printerDlg.Destroy() |
self.printData = printer.GetPrintDialogData().GetPrintData() | self.printData = wxPrintData(printer.GetPrintDialogData().GetPrintData()) | def OnDoPrint(self, event): pdd = wxPrintDialogData() pdd.SetPrintData(self.printData) printer = wxPrinter(pdd) printout = self.createSTCPrintout() if not printer.Print(self.parentFrame, printout): wxLogError('An error occured while printing.') else: self.printData = printer.GetPrintDialogData().GetPrintData() printou... |
style = wxLC_REPORT | wxLC_SINGLE_SEL ) | style = wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES|wxCLIP_CHILDREN) | def __init__(self, parent, flist, debugger): wxListCtrl.__init__(self, parent, wxID_STACKVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Frame', wxLIST_FORMAT_LEFT, 150) self.InsertColumn(1, 'Line', wxLIST_FORMAT_LEFT, 35) self.InsertColumn(2, 'Code', wxLIST_FORMAT_LEFT, 300) EVT_LIST_ITEM_SELECTED(... |
style = wxLC_REPORT | wxLC_SINGLE_SEL ) | style = wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES|wxCLIP_CHILDREN) | def __init__(self, parent, debugger):#, flist, browser): wxListCtrl.__init__(self, parent, wxID_BREAKVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Module', wxLIST_FORMAT_LEFT, 90) self.InsertColumn(1, 'Line', wxLIST_FORMAT_CENTER, 40) self.InsertColumn(2, 'Ignore', wxLIST_FORMAT_CENTER, 45) self.I... |
self.menu.Append(wxID_BREAKENABLED, 'Enabled', checkable = true) | self.menu.Append(wxID_BREAKENABLED, 'Enabled', '', true) | def __init__(self, parent, debugger):#, flist, browser): wxListCtrl.__init__(self, parent, wxID_BREAKVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Module', wxLIST_FORMAT_LEFT, 90) self.InsertColumn(1, 'Line', wxLIST_FORMAT_CENTER, 40) self.InsertColumn(2, 'Ignore', wxLIST_FORMAT_CENTER, 45) self.I... |
style = wxLC_REPORT | wxLC_SINGLE_SEL ) | style=wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES|wxCLIP_CHILDREN) | def __init__(self, parent, add_watch, is_local, name): # , dict=None): wxListCtrl.__init__(self, parent, wxID_NSVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Attribute', wxLIST_FORMAT_LEFT, 125) self.InsertColumn(1, 'Value', wxLIST_FORMAT_LEFT, 200) |
if self.rightsel != -1: name = self.names[self.rightsel] | if self.selected != -1: name = self.names[self.selected] | def OnAddAsWatch(self, event): if self.rightsel != -1: name = self.names[self.rightsel] self.add_watch(name, self.is_local) |
sel = self.HitTest(self.pos)[0] if sel != -1: self.rightsel = sel | if self.selected != -1: | def OnRightClick(self, event): if not self.pos: return sel = self.HitTest(self.pos)[0] if sel != -1: self.rightsel = sel self.PopupMenu(self.menu, self.pos) |
style = wxLC_REPORT | wxLC_SINGLE_SEL ) | style=wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES|wxCLIP_CHILDREN) | 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) |
EVT_COMMAND_RIGHT_CLICK(self, -1, self.OnRightClick) | 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.stateCols = {'except': wxNamedColour('yellow'), | self.stateCols = {'except': wxColour(0xFF, 0xFF, 0x44), | def __init__(self, parent): wxStatusBar.__init__(self, parent, -1, style=0) self.SetFieldsCount(2) self.SetMinHeight(30) #self.SetStatusWidths([-1, -1, 16]) |
'break': wxNamedColour('red'), | 'break': wxColour(0xFF, 0x44, 0x44), | def __init__(self, parent): wxStatusBar.__init__(self, parent, -1, style=0) self.SetFieldsCount(2) self.SetMinHeight(30) #self.SetStatusWidths([-1, -1, 16]) |
wxFrame.__init__(self, editor, -1, 'Debugger') | wxFrame.__init__(self, editor, -1, 'Debugger', style=wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN) | def __init__(self, editor, filename=None, slave_mode=1): wxFrame.__init__(self, editor, -1, 'Debugger') |
style=wxSP_NOBORDER | wxSP_3DSASH | wxSP_FULLSASH) | style=wxSP_NOBORDER|wxSP_3DSASH|wxSP_FULLSASH|\ wxSP_LIVE_UPDATE|wxCLIP_CHILDREN) | def __init__(self, editor, filename=None, slave_mode=1): wxFrame.__init__(self, editor, -1, 'Debugger') |
self.nbBottom = wxNotebook(self.splitter, wxID_PAGECHANGED) | self.nbBottom = wxNotebook(self.splitter, wxID_PAGECHANGED, style=wxCLIP_CHILDREN) | def __init__(self, editor, filename=None, slave_mode=1): wxFrame.__init__(self, editor, -1, 'Debugger') |
self.breakpts.refreshList() | self.breakpts.selectBreakpoint(filename, lineno) | def receiveDebuggerStatus(self, info): # Get stdout and stderr if available. errout = self.editor.erroutFrm data = info.get('stdout', None) if data: errout.appendToOutput(data) #self.appendToOutputWindow(data) data = info.get('stderr', None) if data: errout.appendToErrors(data) #self.appendToOutputWindow(data) |
if self.editor.palette.IsShown(): if self.editor.palette.IsIconized(): self.editor.palette.restore() | if self.editor: if self.editor.palette.IsShown(): if self.editor.palette.IsIconized(): self.editor.palette.restore() self.editor.restore() elif self.editor.IsIconized(): | def restoreDebugger(self): if self.editor.palette.IsShown(): if self.editor.palette.IsIconized(): self.editor.palette.restore() self.editor.restore() elif self.editor.IsIconized(): self.editor.restore() |
elif self.editor.IsIconized(): self.editor.restore() | def restoreDebugger(self): if self.editor.palette.IsShown(): if self.editor.palette.IsIconized(): self.editor.palette.restore() self.editor.restore() elif self.editor.IsIconized(): self.editor.restore() | |
wxDialog.__init__(self, id = wxID_FINDREPLACEDLG, name = 'FindReplaceDlg', parent = prnt, pos = wxPoint(394, 361), size = wxSize(372, 234), style = wxDEFAULT_DIALOG_STYLE, title = 'Find/Replace Dialog') | wxDialog.__init__(self, id = wxID_FINDREPLACEDLG, name = 'FindReplaceDlg', parent = prnt, pos = wxPoint(394, 361), size = wxSize(372, 234), style = wxDEFAULT_DIALOG_STYLE, title = 'Find/Replace') | def _init_ctrls(self, prnt): wxDialog.__init__(self, id = wxID_FINDREPLACEDLG, name = 'FindReplaceDlg', parent = prnt, pos = wxPoint(394, 361), size = wxSize(372, 234), style = wxDEFAULT_DIALOG_STYLE, title = 'Find/Replace Dialog') self._init_utils() self.SetAutoLayout(true) self.SetClientSize(wxSize(364, 207)) |
self.addMenu(menu, EditorHelper.wxID_SETUPBUILD, 'build', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPCLEAN, 'clean', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPINSTALL, 'install', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPSDIST, 'sdist', accls, ()) self.addMenu(menu, EditorHelper.wxID_SET... | self.addMenu(menu, EditorHelper.wxID_SETUPBUILD, 'setup.py build', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPCLEAN, 'setup.py clean', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPINSTALL, 'setup.py install', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPSDIST, 'setup.py sdist', accls, ()) self... | def addMenus(self, menu, model): accls = ModuleController.addMenus(self, menu, model) menu.AppendSeparator() self.addMenu(menu, EditorHelper.wxID_SETUPBUILD, 'build', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPCLEAN, 'clean', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPINSTALL, 'install', accls, ()) ... |
self.addMenu(menu, EditorHelper.wxID_SETUPPY2EXE, 'py2exe', accls, ()) | self.addMenu(menu, EditorHelper.wxID_SETUPPY2EXE, 'setup.py py2exe', accls, ()) | def addMenus(self, menu, model): accls = ModuleController.addMenus(self, menu, model) menu.AppendSeparator() self.addMenu(menu, EditorHelper.wxID_SETUPBUILD, 'build', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPCLEAN, 'clean', accls, ()) self.addMenu(menu, EditorHelper.wxID_SETUPINSTALL, 'install', accls, ()) ... |
shutil.copy(node.resourcepath, self.resourcepath) | def copyFileFrom(self, node): """ Copy node into self (only called for folders)""" import shutil if not node.isDir(): if node.resourcepath == os.path.join(self.resourcepath, node.name): newNameBase = os.path.join(self.resourcepath, 'copy%s_of_'+node.name) num = '' while 1: newName = newNameBase%num if os.path.exists(n... | |
def load(self): return open(self.resourcepath, 'rb').read() def save(self, filename, data): | def load(self, mode='rb'): return open(self.resourcepath, mode).read() def save(self, filename, data, mode='wb'): | def load(self): return open(self.resourcepath, 'rb').read() |
f = open(self.resourcepath, 'wb') | f = open(self.resourcepath, mode) | def save(self, filename, data): # XXX move dialog to gui layer if self.resourcepath != filename: self.resourcepath = filename self.name = os.path.basename(self.resourcepath) try: f = open(self.resourcepath, 'wb') except IOError, message: dlg = wx.wxMessageDialog(self.editor, 'Could not save\n'+message.strerror, 'Error'... |
sys.boa_debugger = self | def __init__(self): Bdb.__init__(self) self.fncache = {} | |
if filename[:1] == '<' and filename[-1:] == '>': | if ((filename[:1] == '<' and filename[-1:] == '>') or filename.find('://') >= 0): | def canonic(self, filename): canonic = self.fncache.get(filename, None) if not canonic: if filename[:1] == '<' and filename[-1:] == '>': canonic = filename else: # Should we deal with URL's here? (we are...) if filename[:12] == 'zopedebug://': canonic = filename else: canonic = path.abspath(filename) self.fncache[file... |
if filename[:12] == 'zopedebug://': canonic = filename else: canonic = path.abspath(filename) | canonic = path.abspath(filename) | def canonic(self, filename): canonic = self.fncache.get(filename, None) if not canonic: if filename[:1] == '<' and filename[-1:] == '>': canonic = filename else: # Should we deal with URL's here? (we are...) if filename[:12] == 'zopedebug://': canonic = filename else: canonic = path.abspath(filename) self.fncache[file... |
filename = frame.f_code.co_filename if filename == 'Script (Python)': filename, lineno = self.adjustedFrameInfo(frame)[-2:] else: filename = self.canonic(filename) lineno = frame.f_lineno | filename, lineno = self.getFilenameAndLine(frame) | def break_here(self, frame): # Redefine breaking :( filename = frame.f_code.co_filename if filename == 'Script (Python)': # XXX filename, lineno = self.adjustedFrameInfo(frame)[-2:] else: filename = self.canonic(filename) lineno = frame.f_lineno if not self.breaks.has_key(filename): return 0 if not lineno in self.bre... |
filename = frame.f_code.co_filename if filename == 'Script (Python)': filename = self.adjustedFrameInfo(frame)[2] else: filename = self.canonic(filename) | filename, lineno = self.getFilenameAndLine(frame) | def break_anywhere(self, frame): # Redefine breaking :( filename = frame.f_code.co_filename if filename == 'Script (Python)': # XXX filename = self.adjustedFrameInfo(frame)[2] else: filename = self.canonic(filename) return self.breaks.has_key(filename) |
modname, funcname, filename, lineno = self.adjustedFrameInfo(frame) | filename, lineno = self.getFilenameAndLine(frame) | def hard_break_here(self, frame): """Indicates whether the debugger should stop at a hard breakpoint. |
bp = bdb.Breakpoint(filename, lineno, temporary, cond) return bp | return bdb.Breakpoint(filename, lineno, temporary, cond) | def set_break(self, filename, lineno, temporary=0, cond=None): #orig_filename = filename filename = self.canonic(filename) # XXX zopedebug uris are now stored in bdb ##import linecache # Import as late as possible ##line = linecache.getline(filename, lineno) ##if not line: ## # XXX maybe should call linecache.checkc... |
modname, funcname, filename, lineno = self.adjustedFrameInfo(frame) | filename, lineno = self.getFilenameAndLine(frame) | def user_line(self, frame): # This method is called when we stop or break at a line if not self._lock.acquire(0): # Already working in another thread. return if self.autocont: self.autocont = 0 self.set_continue() return self.stopframe = () # Don't stop. self.ignore_stopline = -1 self.frame = frame self.exc_info = Non... |
def adjustedFrameInfo(self, frame): code = frame.f_code filename = code.co_filename funcname = code.co_name lineno = frame.f_lineno try: modname = frame.f_globals['__name__'] except: modname = '' if filename == 'Script (Python)': try: lineno = lineno+1 return (modname, funcname, 'zopedebug://'+\ frame.f_globals['s... | def adjustedFrameInfo(self, frame): code = frame.f_code filename = code.co_filename funcname = code.co_name lineno = frame.f_lineno try: modname = frame.f_globals['__name__'] except: modname = '' # Special case to package Python Scripts if filename == 'Script (Python)': try: # adjust for Boa's added def <name>(): line ... | |
modname, funcname, filename, lineno = \ self.adjustedFrameInfo(frame) | filename, lineno = self.getFilenameAndLine(frame) modname, funcname = self.getFrameNames(frame) | def getExtendedFrameInfo(self): try: (exc_type, exc_value, stack, frame_stack_len) = self.getStackInfo() stack_summary = [] for frame, lineno in stack: modname, funcname, filename, lineno = \ self.adjustedFrameInfo(frame) stack_summary.append( {'filename':filename, 'lineno':lineno, 'funcname':funcname, 'modname':modna... |
view.model.editor.setStatus(_('Search wrapped'), _('Warning'), ringBell=1) | view.model.editor.setStatus(_('Search wrapped'), 'Warning', ringBell=1) | def findInSource(self, view, pattern): region = self.getRegion(view) self.addFind(pattern) start = view.GetSelection()[not self.reverse] if self.selection: result = self._find(view.GetTextRange(*region), pattern, start, region[0]) else: result = self._find(view.GetText(), pattern, start, 0) if result is None: raise Fin... |
tmp = data[data.find(':')+2:], '\n'.split() | tmp = data[data.find(':')+2:].split('\n') | def getBody(self, data): tmp = data[data.find(':')+2:], '\n'.split() tmp2 = [] for l in tmp: # Handle comments which may be indented less if l[:4].strip(): l = l.lstrip() else: l = l[4:] tmp2.append(l) return '\n'.join(tmp2) |
self._lock = threading.RLock() | self._lock = ThreadChoiceLock() | def __init__(self): Bdb.__init__(self) self.fncache = {} |
def break_anywhere(self, frame): return 1 | def break_anywhere(self, frame): # Allow a stop anywhere, anytime. # todo: Optimize by stopping only when in one of the # files being debugged? Problem: callbacks don't get debugged. return 1 | |
import bcdb bcdb.waiting_debug_server = self | def set_continue(self, full_speed=0): # Only stop at breakpoints, exceptions or when finished self.stopframe = () self.returnframe = None self.quitting = 0 | |
while frame and frame is not self.botframe: | while frame: | def set_continue(self, full_speed=0): # Only stop at breakpoints, exceptions or when finished self.stopframe = () self.returnframe = None self.quitting = 0 |
frame.f_trace = None | del frame.f_trace if frame is self.botframe: break | def set_continue(self, full_speed=0): # Only stop at breakpoints, exceptions or when finished self.stopframe = () self.returnframe = None self.quitting = 0 |
if self._lock.acquire(0): self._lock.release() def runcall(self, func, *args, **kw): self.reset() sys.settrace(self.trace_dispatch) res = None try: try: res = apply(func, args, kw) except BdbQuit: pass finally: self.quitting = 1 sys.settrace(None) return res def set_trace(self, call_depth=1): """Start debugging from... | self._lock.releaseIfOwned() def set_trace(self): """Start debugging from the caller's frame. | def set_continue(self, full_speed=0): # Only stop at breakpoints, exceptions or when finished self.stopframe = () self.returnframe = None self.quitting = 0 |
root_frame = None | def set_trace(self, call_depth=1): """Start debugging from the caller frame. | |
frame = sys.exc_info()[2].tb_frame while call_depth: frame = frame.f_back call_depth = call_depth - 1 break_frame = frame | frame = sys.exc_info()[2].tb_frame.f_back | def set_trace(self, call_depth=1): """Start debugging from the caller frame. |
root_frame = frame | def set_trace(self, call_depth=1): """Start debugging from the caller frame. | |
self.set_next(break_frame) | if frame is self.botframe: break if self.botframe is None: self.botframe = root_frame self.set_step() | def set_trace(self, call_depth=1): """Start debugging from the caller frame. |
return self.trace_dispatch | def set_trace(self, call_depth=1): """Start debugging from the caller frame. | |
self.run("execfile(fn, d)", {'fn':fn, 'd':d}) | self.run("execfile(fn, d)", { 'fn':fn, 'd':d, '__debugger__': self}) | def runFile(self, filename, params, autocont, add_paths): d = {'__name__': '__main__', '__doc__': 'Debugging', '__builtins__': __builtins__,} |
self.exc_info = sys.exc_info() self.frame = self.exc_info[2].tb_frame self.quitting = 0 self.eventLoop() | if self._lock.acquire(0): self.exc_info = sys.exc_info() self.frame = self.exc_info[2].tb_frame self.quitting = 0 self.eventLoop() | def run(self, cmd, globals=None, locals=None): try: self._running = 1 try: Bdb.run(self, cmd, globals, locals) except (BdbQuit, SystemExit): pass except: # Provide post-mortem analysis. import traceback traceback.print_exc() self.exc_info = sys.exc_info() self.frame = self.exc_info[2].tb_frame self.quitting = 0 self.ev... |
sys.settrace(None) self.quitting = 1 self._running = 0 self.cleanupServer() def runFunc(self, func, *args, **kw): try: self._running = 1 try: return apply(self.runcall, (func,) + args, kw) except BdbQuit: pass except: self.exc_info = sys.exc_info() self.frame = self.exc_info[2].tb_frame self.quitting = 0 self.eventLo... | sys.settrace(None) | def run(self, cmd, globals=None, locals=None): try: self._running = 1 try: Bdb.run(self, cmd, globals, locals) except (BdbQuit, SystemExit): pass except: # Provide post-mortem analysis. import traceback traceback.print_exc() self.exc_info = sys.exc_info() self.frame = self.exc_info[2].tb_frame self.quitting = 0 self.ev... |
stack = stack[frame_stack_len + 2:] frame_stack_len = len(stack) | def getStackInfo(self): try: if self.exc_info is not None: exc_type, exc_value, exc_tb = self.exc_info try: exc_type = exc_type.__name__ except AttributeError: # Python 2.x -> ustr()? exc_type = "%s" % str(exc_type) if exc_value is not None: exc_value = str(exc_value) stack, frame_stack_len = self.get_stack( exc_tb.tb... | |
def reset(self): Bdb.reset(self) def descrframe(frame): if frame: return ('<frame:%s(%s)%s [%s]>'%(path.basename(frame.f_code.co_filename), frame.f_lineno, frame.f_code.co_name, id(frame)) ) else: return 'None' _settrace = sys.settrace def settrace_prx(func): print 'TRACE: %s set by %s'%(func, ... | def reset(self): Bdb.reset(self) #self.frame = None | |
if action == 'delete' and compn != self: compnSrcRef = Utils.srcRefFromCtrlName(compn.name) for constr in self.textConstrLst: if compnSrcRef == constr.params[0]: constr.params[0] = 'None' self.recreateSizers() return | if action == 'delete': if not isinstance(compn, CollectionDTC): compnSrcRef = Utils.srcRefFromCtrlName(compn.name) for constr in self.textConstrLst: if compnSrcRef == constr.params[0]: constr.params[0] = 'None' self.recreateSizers() return | def notification(self, compn, action): if action == 'delete' and compn != self: compnSrcRef = Utils.srcRefFromCtrlName(compn.name) for constr in self.textConstrLst: if compnSrcRef == constr.params[0]: constr.params[0] = 'None' self.recreateSizers() return |
self.icon = wxIcon(Preferences.toPyPath('Images\\Icons\\Debug.ico'), wxBITMAP_TYPE_ICO) self.SetIcon(self.icon) | self.SetIcon(IS.load('Images/Icons/Debug.ico')) | 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)) |
mod.__file__ = filename | try: mod.__file__ = filename except AttributeError: print "I''m frozen!" | def debug_file(self, filename, params = None): filename = path.join(pyPath, filename) saveout = sys.stdout saveerr = sys.stderr if params is None: params = [] |
self.editor.statusBar.setHint('Not a directory: %s'% node.resourcepath, 'Error') | self.editor.statusBar.setHint( 'Not a directory: %s'% node.resourcepath, 'Error') else: node = self.list.node if not nodes and node.bookmarks: node.bookmarks.add(node.getURI()) self.editor.statusBar.setHint( 'Bookmarked %s'% node.getURI(), 'Info') | def OnBookmarkItems(self, event): if self.list.node: nodes = self.getNodesForSelection(self.list.getMultiSelection()) for node in nodes: if node.bookmarks: if node.isFolderish(): node.bookmarks.add(node.getURI()) self.editor.statusBar.setHint('Bookmarked %s'% node.resourcepath, 'Info') else: self.editor.statusBar.setHi... |
'before quitting.\n\nClick Cancel to quit anyway.', 'Child processes running'), | 'before quitting.\n\nClick Cancel to quit anyway.'), _('Child processes running'), | def checkProcessesAtExit(self): if self.processesPage: self.checkProcesses() wx.Yield() cnt = self.processesPage.GetItemCount() if cnt: self.display() pageIdx = self.findPage(self.processesText) self.notebook.SetSelection(pageIdx) |
print 'no running dir for relative path' | def OnErrorstacktcTreeItemActivated(self, event): data = self.errorStackTC.GetPyData(event.GetItem()) if data is None: return if data.file.find('://') != -1 or os.path.isabs(data.file): fn = data.file | |
self.setModelData(self.GetText()) | self.setModelData(str(self.GetText())) | def refreshModel(self): if self.isModified(): self.model.modified = true self.nonUserModification = false |
def updatePageName(self): if hasattr(self, 'notebook'): currName = self.notebook.GetPageText(self.pageIdx) if self.isModified(): newName = '~%s~' % self.viewName else: newName = self.viewName if currName != newName: if newName == self.viewName: if self.model.viewsModified.count(self.viewName): self.model.viewsModifie... | def selectLine(self, lineno): self.GotoLine(lineno) sp = self.PositionFromLine(lineno) # Dont do whole screen selection ep = max(0, self.PositionFromLine(lineno+1)-1) self.SetSelection(sp, ep) | |
self.triggers.update({'ToolBar': self.ChangeToolBar, 'StatusBar': self.ChangeStatusBar}) | self.triggers.update({'ToolBar': self.ChangeToolBar}) | def __init__(self, name, designer, frameCtrl): BaseFrameDTC.__init__(self, name, designer, frameCtrl) |
if wxPlatform != '__WXGTK__': self.control.SetMenuBar(None) | self.control.SetMenuBar(None) | def updatePosAndSize(self): # XXX Delete links to frame bars so client size is accurate self.control.SetToolBar(None) self.control.SetStatusBar(None) if wxPlatform != '__WXGTK__': self.control.SetMenuBar(None) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.