bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def readObject(self):
def readObject(self):
30,000
def getModelData(self): try: code = compile(self.model.data, self.model.filename, 'exec') except: oldOut = sys.stdout sys.stdout = ShellEditor.PseudoFileOutStore() try: print "''' Code does not compile\n\n Disassembly of Traceback:\n'''" try: dis.distb(sys.exc_info()[2]) except: print "''' Could not disassemble trac...
def getModelData(self): try: code = compile(self.model.data, self.model.filename, 'exec') except: oldOut = sys.stdout sys.stdout = Utils.PseudoFileOutStore() try: print "''' Code does not compile\n\n Disassembly of Traceback:\n'''" try: dis.distb(sys.exc_info()[2]) except: print "''' Could not disassemble traceback ...
30,001
def getModelData(self): try: code = compile(self.model.data, self.model.filename, 'exec') except: oldOut = sys.stdout sys.stdout = ShellEditor.PseudoFileOutStore() try: print "''' Code does not compile\n\n Disassembly of Traceback:\n'''" try: dis.distb(sys.exc_info()[2]) except: print "''' Could not disassemble trac...
def getModelData(self): try: code = compile(self.model.data, self.model.filename, 'exec') except: oldOut = sys.stdout sys.stdout = Utils.PseudoFileOutStore() try: print "''' Code does not compile\n\n Disassembly of Traceback:\n'''" try: dis.distb(sys.exc_info()[2]) except: print "''' Could not disassemble traceback ...
30,002
def designTimeSource(self): return {'width': '16', 'height': '16'}
def designTimeSource(self): return {'width': '16', 'height': '16'}
30,003
def __init__(self, name, designer, parentCompanion, ctrl): CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl) self.editors.update({'Bitmap': BitmapConstrPropEdit, 'Mask': BitmapConstrPropEdit}) from Views.CollectionEdit import ImageListCollectionEditor self.CollEditorFrame = ImageListCollectionEditor
def __init__(self, name, designer, parentCompanion, ctrl): CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl) self.editors = {'Bitmap': BitmapConstrPropEdit, 'Mask': BitmapConstrPropEdit} from Views.CollectionEdit import ImageListCollectionEditor self.CollEditorFrame = ImageListCollectionEditor
30,004
def designTimeSource(self, wId): return {'bitmap': 'wxNullBitmap', 'mask': 'wxNullBitmap'}
def designTimeSource(self, wId): return {'bitmap': 'wxNullBitmap', 'mask': 'wxNullBitmap'}
30,005
def getDisplayProp(self): value = self.textConstrLst[self.index].params[self.displayProp] if value != 'wxNullBitmap': value = os.path.basename(value[10:-21]) return value
def getDisplayProp(self): value = self.textConstrLst[self.index].params[self.displayProp] if value != 'wxNullBitmap': value = os.path.basename(value[10:-21]) return value
30,006
def designTimeSource(self): return {}
def designTimeSource(self): return {}
30,007
def SetName(self, oldName, newName): print 'ATCollectionDTC' CollectionDTC.SetName(self, oldName, newName)
def SetName(self, oldName, newName): CollectionDTC.SetName(self, oldName, newName)
30,008
def applyDesignTimeDefaults(self, params): return
def applyDesignTimeDefaults(self, params): return
30,009
def designTimeSource(self, wId): newItemName = '%s%d'%(self.propName, wId) return {'id': self.newWinId(newItemName), 'item': `newItemName`, 'helpString': `newItemName`, 'checkable': 'false'}
def designTimeSource(self, wId): newItemName = '%s%d'%(self.propName, wId) return {'id': self.newWinId(newItemName), 'item': `newItemName`, 'helpString': `newItemName`, 'checkable': 'false'}
30,010
def designTimeDefaults(self, vals): dtd = {} for param in vals.keys(): if param == 'menu': name = vals[param] if name[:4] == 'self': dtd[param] = self.designer.objects[name[5:]][1] elif name == 'wxMenu()': dtd[param] = wxMenu() else: print name, name[:4] raise 'Invalid menu reference' else: try: dtd[param] = eval(vals[...
def designTimeDefaults(self, vals): dtd = {} for param in vals.keys(): if param == 'menu': name = vals[param] if name[:4] == 'self': dtd[param] = self.designer.objects[name[5:]][1] elif name == 'wxMenu()': dtd[param] = wxMenu() else: raise 'Invalid menu reference' else: try: dtd[param] = eval(vals[param]) except Except...
30,011
def GetMenu(self): print 'MenuBarMenusCDTC.GetMenu' return self.textConstrLst[self.index].params['menu']
def GetMenu(self): return self.textConstrLst[self.index].params['menu']
30,012
def SetMenu(self, value): print 'MenuBarMenusCDTC.SetMenu' self.textConstrLst[self.index].params['menu'] = value
def SetMenu(self, value): self.textConstrLst[self.index].params['menu'] = value
30,013
def SetName(self, oldName, newName): print 'OwnedCollectionDTC' CollectionDTC.SetName(self, oldName, newName)
def SetName(self, oldName, newName): CollectionDTC.SetName(self, oldName, newName)
30,014
def SetName(self, oldName, newName): print 'OwnedCollectionDTC' CollectionDTC.SetName(self, oldName, newName)
def SetName(self, oldName, newName): print 'OwnedCollectionDTC' CollectionDTC.SetName(self, oldName, newName)
30,015
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
def applyConstraints(self): nullConstr = ['wxUnconstrained'] if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validConstr + 1 if validConstr == 4: print 'appling constraints'...
30,016
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
30,017
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
30,018
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
30,019
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons...
30,020
def designTimeSource(self, wId): return {'rel': 'wxUnconstrained', 'otherWin': 'None', 'otherEdge': 'wxLeft', 'value': '0', 'margin': '0'}
def designTimeSource(self, wId): return {'rel': 'wxUnconstrained', 'otherWin': 'None', 'otherEdge': 'wxLeft', 'value': '0', 'margin': '0'}
30,021
def appendItem(self): print 'append item' if len(self.textConstrLst) == 4: raise 'Only 4 constraints allowed' ai = self.availableItems() if not ai: raise 'All constraints set' self.sourceObjName = '%s.%s'%(self.__class__.sourceObjName, ai[0]) OwnedCollectionDTC.appendItem(self) self.applyConstraints()
def appendItem(self): if len(self.textConstrLst) == 4: raise 'Only 4 constraints allowed' ai = self.availableItems() if not ai: raise 'All constraints set' self.sourceObjName = '%s.%s'%(self.__class__.sourceObjName, ai[0]) OwnedCollectionDTC.appendItem(self) self.applyConstraints()
30,022
def deleteItem(self, idx): # remove from ctrl if self.deletionMethod != '(None)': f = RTTI.getFunction(self.control, self.deletionMethod) print 'applying', f, self.control apply(f, [self.control, idx]) del self.textConstrLst[idx] # renumber items following deleted one if self.indexProp != '(None)': for constr in self....
def deleteItem(self, idx): # remove from ctrl if self.deletionMethod != '(None)': f = RTTI.getFunction(self.control, self.deletionMethod) apply(f, [self.control, idx]) del self.textConstrLst[idx] # renumber items following deleted one if self.indexProp != '(None)': for constr in self.textConstrLst[idx:]: constr.params...
30,023
def applyDesignTimeDefaults(self, params): return attr = getattr(self.constraints, string.split(self.textConstrLst[self.index].comp_name, '.')[1]) params = copy.copy(params) otherWin = params['otherWin'][5:] print 'adtd', otherWin if params['otherWin'] == 'None': params = self.designTimeDefaults(params) elif self.desi...
def applyDesignTimeDefaults(self, params): return attr = getattr(self.constraints, string.split(self.textConstrLst[self.index].comp_name, '.')[1]) params = copy.copy(params) otherWin = params['otherWin'][5:] if params['otherWin'] == 'None': params = self.designTimeDefaults(params) elif self.designer.objects.has_key(ot...
30,024
def applyDesignTimeDefaults(self, params): return attr = getattr(self.constraints, string.split(self.textConstrLst[self.index].comp_name, '.')[1]) params = copy.copy(params) otherWin = params['otherWin'][5:] print 'adtd', otherWin if params['otherWin'] == 'None': params = self.designTimeDefaults(params) elif self.desi...
def applyDesignTimeDefaults(self, params): return attr = getattr(self.constraints, string.split(self.textConstrLst[self.index].comp_name, '.')[1]) params = copy.copy(params) otherWin = params['otherWin'][5:] print 'adtd', otherWin if params['otherWin'] == 'None': params = self.designTimeDefaults(params) elif self.desi...
30,025
def GetEdge(self): print 'GetEdge', self.index, self.textConstrLst return self.textConstrLst[self.index].comp_name
def GetEdge(self): return self.textConstrLst[self.index].comp_name
30,026
def initCollection(self): print 'INITCOLLECTION' self.inited = true self.applyConstraints()
def initCollection(self): self.inited = true self.applyConstraints()
30,027
def refreshCtrl(self): ListCtrlView.refreshCtrl(self) from EditorModels import AppModel otherApp = AppModel('', self.compareTo, '', self.model.editor, true) otherApp.load() otherApp.readModules() i = 0
def refreshCtrl(self): ListCtrlView.refreshCtrl(self) from EditorModels import AppModel otherApp = AppModel('', self.compareTo, '', self.model.editor, true, {}) otherApp.load() otherApp.readModules() i = 0
30,028
def refreshCtrl(self): ListCtrlView.refreshCtrl(self) from EditorModels import AppModel otherApp = AppModel('', self.compareTo, '', self.model.editor, true) otherApp.load() otherApp.readModules() i = 0
def refreshCtrl(self): ListCtrlView.refreshCtrl(self) from EditorModels import AppModel otherApp = AppModel('', self.compareTo, '', self.model.editor, true) otherApp.load() otherApp.readModules() i = 0
30,029
def reverseDict(dict): rev = {} for k in dict.keys(): rev[dict[k]] = k return rev
def reverseDict(dict): rev = {} for k in dict.keys(): rev[dict[k]] = k return rev
30,030
def actions(self, model): actions = [ ('-', None, '', ''), ('Import module into Shell', self.OnImportInShell, '-', ''), ('Reload module in Shell', self.OnReloadInShell, '-', ''), ('-', None, '', ''), ('Set command-line parameters', self.OnSetRunParams, '-', ''), ('Run application', self.OnRunApp, self.runAppBmp, 'RunAp...
def actions(self, model): actions = [ ('-', None, '', ''), ('Import module into Shell', self.OnImportInShell, '-', ''), ('Reload module in Shell', self.OnReloadInShell, '-', ''), ('-', None, '', ''), ('Set command-line parameters', self.OnSetRunParams, '-', ''), ('Run application', self.OnRunApp, self.runAppBmp, 'RunAp...
30,031
def actions(self, model): actions = [ ('-', None, '', ''), ('Import module into Shell', self.OnImportInShell, '-', ''), ('Reload module in Shell', self.OnReloadInShell, '-', ''), ('-', None, '', ''), ('Set command-line parameters', self.OnSetRunParams, '-', ''), ('Run application', self.OnRunApp, self.runAppBmp, 'RunAp...
def actions(self, model): actions = [ ('-', None, '', ''), ('Import module into Shell', self.OnImportInShell, '-', ''), ('Reload module in Shell', self.OnReloadInShell, '-', ''), ('-', None, '', ''), ('Set command-line parameters', self.OnSetRunParams, '-', ''), ('Run application', self.OnRunApp, self.runAppBmp, 'RunAp...
30,032
def OnProfile(self, event): model = self.getModel() if self.checkUnsaved(model): return
def OnProfile(self, event): model = self.getModel() if self.checkUnsaved(model): return
30,033
def OnProfile(self, event): model = self.getModel() if self.checkUnsaved(model): return
def OnProfile(self, event): model = self.getModel() if self.checkUnsaved(model): return
30,034
def OnProfile(self, event): model = self.getModel() if self.checkUnsaved(model): return
defOnProfile(self,event):model=self.getModel()ifself.checkUnsaved(model):return
30,035
def OnSetRunParams(self, event): model = self.getModel() dlg = wxTextEntryDialog(self.editor, 'Parameters:', 'Command-line parameters', model.lastRunParams) try: if dlg.ShowModal() == wxID_OK: model.lastRunParams = dlg.GetValue() # update running debuggers debugging this module debugger = self.editor.debugger if debugg...
def OnSetRunParams(self, event): model = self.getModel() dlg = wxTextEntryDialog(self.editor, 'Parameters:', 'Command-line parameters', model.lastRunParams) try: if dlg.ShowModal() == wxID_OK: model.lastRunParams = dlg.GetValue() # update running debuggers debugging this module debugger = self.editor.debugger if debugg...
30,036
def OnSwitchApp(self, event): model = self.getModel() if model and isinstance(model, PythonEditorModels.ModuleModel) and model.app: # does this ensure correct app is reconnected? appmodel, controller = self.editor.openOrGotoModule(model.app.filename)
def OnSwitchApp(self, event): model = self.getModel() if model and isinstance(model, PythonEditorModels.ModuleModel) and model.app: # does this ensure correct app is reconnected? appmodel, controller = self.editor.openOrGotoModule(model.app.filename)
30,037
def OnConfigPyChecker(self, event): model = self.getModel() if model: home = os.environ.get('HOME') if home: appDir = home appConfig = home+'/.pycheckrc' else: filename = model.assertLocalFile() appDir = os.path.dirname(filename) appConfig = appDir+'/.pycheckrc' if not os.path.exists(appConfig): dlg = wxMessageDialog(s...
def OnConfigPyChecker(self, event): model = self.getModel() if model: home = os.environ.get('HOME') if home: appDir = home appConfig = home+'/.pycheckrc' else: filename = model.assertLocalFile() appDir = os.path.dirname(filename) appConfig = appDir+'/.pycheckrc' if not os.path.exists(appConfig): dlg = wxMessageDialog(s...
30,038
def OnTabNanny(self, event): model = self.getModel() if model: model.tabnanny()
def OnTabNanny(self, event): model = self.getModel() if model: model.tabnanny()
30,039
def runDistUtilsCmd(self, cmd): model = self.getModel() if not model.savedAs: wxLogError('Cannot run distutils on an unsaved module') return
def runDistUtilsCmd(self, cmd): model = self.getModel() if not model.savedAs: wxLogError('Cannot run distutils on an unsaved module') return
30,040
def OnSetupPy2Exe(self, event): self.runDistUtilsCmd('py2exe')
def OnSetupPy2Exe(self, event): self.runDistUtilsCmd('py2exe')
30,041
def isPackage(filename): return os.path.exists(os.path.join(filename, PythonEditorModels.PackageModel.pckgIdnt))
def isPackage(filename): return os.path.exists(os.path.join(filename, PythonEditorModels.PackageModel.pckgIdnt))
30,042
def newFileNode(self, defaultDir): return FileExplorer.PyFileNode(os.path.basename(defaultDir), defaultDir, None, EditorHelper.imgFolder, None, None)
def newFileNode(self, defaultDir): return FileExplorer.FileSysNode(os.path.basename(defaultDir), defaultDir, None, EditorHelper.imgFolder, None, None)
30,043
def openAndHandleCategoryErrors(self, uri, catFile=''): if catFile: openuri = os.path.join(uri, catFile) else: openuri = uri
def openAndHandleCategoryErrors(self, uri, catFile=''): if catFile: if uri.startswith('zip://') and uri.endswith('.zip'): openuri = uri +'://'+ catFile else: openuri = os.path.join(uri, catFile) else: openuri = uri
30,044
def OnFDEndLabelEdit(self, event): newText = event.GetText() event.Skip() if newText != self.oldLabelVal:# and isinstance(self.list.node, ZopeItemNode): self.node.renameItem(self.oldLabelVal, newText) self.refreshCurrent() self.selectItemNamed(newText) self.EnsureVisible(self.selected)
def OnFDEndLabelEdit(self, event): newText = event.GetText() event.Skip() if newText != self.oldLabelVal:# and isinstance(self.list.node, ZopeItemNode): self.node.renameItem(self.oldLabelVal, newText) self.refreshCurrent() self.selectItemNamed(newText) self.EnsureVisible(self.selected)
30,045
def OnFDEndLabelEdit(self, event): newText = event.GetText() event.Skip() if newText != self.oldLabelVal:# and isinstance(self.list.node, ZopeItemNode): self.node.renameItem(self.oldLabelVal, newText) self.refreshCurrent() self.selectItemNamed(newText) self.EnsureVisible(self.selected)
def OnFDEndLabelEdit(self, event): newText = event.GetText() event.Skip() if newText != self.oldLabelVal:# and isinstance(self.list.node, ZopeItemNode): self.node.renameItem(self.oldLabelVal, newText) self.refreshCurrent() self.selectItemNamed(newText) self.EnsureVisible(self.selected)
30,046
def set_quit(self): """Quits debugging, executing only the try/finally handlers. Non-blocking and immediate. """ self._ds.stopAnywhere() if self._ds.isRunning(): self._callNoWait('set_quit', 1)
def set_quit(self): """Quits debugging, executing only the try/finally handlers. Non-blocking and immediate. """ self._ds.stopAnywhere() if self._ds.isRunning(): self._callNoWait('set_quit', 1)
30,047
def set_continue(self, full_speed=0): # Only stop at breakpoints, exceptions or when finished self.stopframe = () self.returnframe = None self.quitting = 0
def set_continue(self, full_speed=0): # Only stop at breakpoints, exceptions or when finished self.stopframe = () self.returnframe = None self.quitting = 0
30,048
def pprintVarValue(self, expr, frameno): query_frame = self.getQueryFrame(frameno) if query_frame is None: return '' else: try: v = eval(expr, query_frame.f_globals, query_frame.f_locals) return pprint.pformat(v) except: t, v = sys.exc_info()[:2] return str(v)
def pprintVarValue(self, expr, frameno): query_frame = self.getQueryFrame(frameno) if query_frame is None: return '' else: try: v = eval(expr, query_frame.f_globals, query_frame.f_locals) return pprint.pformat(v) except: t, v = sys.exc_info()[:2] return str(v)
30,049
def dispatch_return(self, frame, arg): Bdb.dispatch_return(self, frame, arg) # XXX this can be used as a hook to detect when a debugging session is # XXX about to stop. frame.f_back will be None # XXX For the main thread this means the end of the program, but # XXX for threads I want to transfer control (tracing) back ...
# XXX this can be used as a hook to detect when a debugging session is # XXX about to stop. frame.f_back will be None # XXX For the main thread this means the end of the program, but # XXX for threads I want to transfer control (tracing) back to the # XXX main thread
30,050
def getFilenameAndLine(self, frame): """Returns the filename and line number for the frame. Invoked often.
def getFilenameAndLine(self, frame): """Returns the filename and line number for the frame. Invoked often.
30,051
def getFilenameAndLine(self, frame): """Returns the filename and line number for the frame. Invoked often.
def getFilenameAndLine(self, frame): """Returns the filename and line number for the frame. Invoked often.
30,052
def getTALPosition(self, frame): """If the frame is in TALInterpreter.interpret(), detects what template was being interpreted and where, but only for specific interpreter frames. Returns the source file and line number. """ # Get TAL frames. XXX brittle in many ways. if frame.f_globals.get('__name__') == TAL_INTERP_...
def getTALPosition(self, frame): """If the frame is in TALInterpreter.interpret(), detects what template was being interpreted and where, but only for specific interpreter frames. Returns the source file and line number. """ # Get TAL frames. XXX brittle in many ways. if frame.f_globals.get('__name__') == TAL_INTERP_...
30,053
def getFrameNames(self, frame): """Returns the module and function name for the frame. """ if frame.f_code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: return '', source_file.split('/')[-1] try: modname = frame.f_globals['__name__'] except KeyError: modname = '' funcname = frame....
def getFrameNames(self, frame): """Returns the module and function name for the frame. """ if isATALInterpeterFrame(frame): source_file, ln = self.getTALPosition(frame) if source_file: return '', source_file.split('/')[-1] try: modname = frame.f_globals['__name__'] except KeyError: modname = '' funcname = frame.f_code....
30,054
def getFrameNames(self, frame): """Returns the module and function name for the frame. """ if frame.f_code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: return '', source_file.split('/')[-1] try: modname = frame.f_globals['__name__'] except KeyError: modname = '' funcname = frame....
def getFrameNames(self, frame): """Returns the module and function name for the frame. """ if frame.f_code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: return '', source_file.split('/')[-1] try: modname = frame.f_globals['__name__'] except KeyError: modname = '' funcname = frame....
30,055
def isTraceable(self, frame): """Indicates whether the debugger should step into the given frame.
def isTraceable(self, frame): """Indicates whether the debugger should step into the given frame.
30,056
def isAScriptFrame(self, frame): """Indicates whether the given frame is a high-level script frame. """ code = frame.f_code if isPythonScriptMetaType(code.co_filename): return 1 if code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: return 1 return 0
def isAScriptFrame(self, frame): """Indicates whether the given frame is a high-level script frame. """ if isAPythonScriptMetaType(frame.f_code.co_filename): return 1 if code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: return 1 return 0
30,057
def isAScriptFrame(self, frame): """Indicates whether the given frame is a high-level script frame. """ code = frame.f_code if isPythonScriptMetaType(code.co_filename): return 1 if code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: return 1 return 0
def isAScriptFrame(self, frame): """Indicates whether the given frame is a high-level script frame. """ code = frame.f_code if isPythonScriptMetaType(code.co_filename): return 1 if isATALInterpeterFrame(frame): return 1 return 0
30,058
def getFrameNamespaces(self, frame): """Returns the locals and globals for a frame. """ code = frame.f_code if code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: # This is a TAL interpret() frame. Use special locals # and globals. interp = frame.f_locals.get('self') if interp is ...
def getFrameNamespaces(self, frame): """Returns the locals and globals for a frame. """ code = frame.f_code if code.co_name == 'interpret': source_file, ln = self.getTALPosition(frame) if source_file: # This is a TAL interpret() frame. Use special locals # and globals. interp = frame.f_locals.get('self') if interp is ...
30,059
def renameItem(self, name, newName): if self.entries.has_key(newName): raise Exception, 'Name exists' self.entries[newName] = newName del self.entries[name] self.updateConfig()
def renameItem(self, name, newName): if self.entries.has_key(newName): raise Exception, 'Name exists' self.entries[newName] = newName del self.entries[name] self.updateConfig()
30,060
def __init__(self, editor, list, cvsController = None): ExplorerNodes.Controller.__init__(self, editor) ExplorerNodes.ClipboardControllerMix.__init__(self) self.editor = editor
def __init__(self, editor, list, cvsController = None): ExplorerNodes.Controller.__init__(self, editor) ExplorerNodes.ClipboardControllerMix.__init__(self) self.editor = editor
30,061
def __init__(self, data, name, editor, saved): EditorModels.SourceModel.__init__(self, data, name, editor, saved)
def __init__(self, data, name, editor, saved): EditorModels.SourceModel.__init__(self, data, name, editor, saved)
30,062
def __init__(self, data, name, editor, saved): EditorModels.SourceModel.__init__(self, data, name, editor, saved)
def __init__(self, data, name, editor, saved): EditorModels.SourceModel.__init__(self, data, name, editor, saved)
30,063
def __call__(self,*args,**kw): method=self.method if method=='PUT' and len(args)==1 and not kw: query=[args[0]] args=() else: query=[] for i in range(len(args)): try: k=self.args[i] if kw.has_key(k): raise TypeError, 'Keyword arg redefined' kw[k]=args[i] except IndexError: raise TypeError, 'Too many arguments'
def __call__(self,*args,**kw): method=self.method if method=='PUT' and len(args)==1 and not kw: query=[args[0]] args=() else: query=[] for i in range(len(args)): try: k=self.args[i] if kw.has_key(k): raise TypeError, 'Keyword arg redefined' kw[k]=args[i] except IndexError: raise TypeError, 'Too many arguments'
30,064
def _mp_call(self,kw, type2suffix={ type(1.0): ':float', type(1): ':int', type(1L): ':long', type([]): ':list', type(()): ':tuple', } ): # Call a function using the file-upload protcol
def _mp_call(self,kw, type2suffix={ type(1.0): ':float', type(1): ':int', type(1L): ':long', type([]): ':list', type(()): ':tuple', } ): # Call a function using the file-upload protcol
30,065
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
30,066
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
30,067
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
30,068
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
30,069
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
30,070
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
def __init__(self, line=None, comp_name='', class_name='', params=None): self.comp_name = comp_name self.class_name = class_name if params is None: self.params = {} else: self.params = params self.factory = None
30,071
def checkError(self, err, caption, out = None): if err or out: self.esf.updateCtrls(err, out) self.esf.Show(true) print 'MR shown' return self.esf else: return None
def checkError(self, err, caption, out = None): if err or out: self.esf.updateCtrls(err, out) self.esf.Show(true) return self.esf else: return None
30,072
def run(self, cmd): import ProcessProgressDlg, ErrorStack dlg = ProcessProgressDlg.ProcessProgressDlg(self.editor, cmd, 'Execute module') try: dlg.ShowModal() serr = ErrorStack.buildErrorList(dlg.errors) if len(serr): return self.checkError(serr, 'Ran', dlg.output) else: return None
def run(self, cmd): import ProcessProgressDlg, ErrorStack dlg = ProcessProgressDlg.ProcessProgressDlg(None, cmd, 'Execute module') try: dlg.ShowModal() serr = ErrorStack.buildErrorList(dlg.errors) if len(serr): return self.checkError(serr, 'Ran', dlg.output) else: return None
30,073
def run(self, cmd): from popen2import import popen3 import ErrorStack inp, outp, errp = popen3(cmd)
def run(self, cmd): from popen2import import popen3 import ErrorStack inp, outp, errp = popen3(cmd)
30,074
def saveSizes(self, filename): '''Build a picklable dictionary of sizes/positions and save.''' persProps = {}
def saveSizes(self, filename): """ Build a picklable dictionary of sizes/positions and save. """ persProps = {}
30,075
def initObjectsAndCompanions(self, creators, objColl, dependents, depLinks): DataView.initObjectsAndCompanions(self, creators, objColl, dependents, depLinks)
def initObjectsAndCompanions(self, creators, objColl, dependents, depLinks): DataView.initObjectsAndCompanions(self, creators, objColl, dependents, depLinks)
30,076
def inspectorEdit(self): if self.value.IsValid(): PropertyEditors.BITPropEditor.inspectorEdit(self)
def inspectorEdit(self): if self.value.IsValid(): PropertyEditors.BITPropEditor.inspectorEdit(self)
30,077
def events(self): return BaseCompanions.WindowDTC.events(self) + ['DatePickerCtrlEvent']
def events(self): return BaseCompanions.WindowDTC.events(self) + ['DatePickerCtrlEvent']
30,078
def getNameSig(self, name, method, module, codeBlock=None): if codeBlock: locals = codeBlock.localnames() if name in locals: objType = codeBlock.locals[name].objtype res = self.getTypeSig(objType, method, module) if res is not None: return res if name in module.globals: objType = module.globals[name].signature res = se...
def getNameSig(self, name, method, module, codeBlock=None): if codeBlock: if name in codeBlock.locals: objType = codeBlock.locals[name].objtype res = self.getTypeSig(objType, method, module) if res is not None: return res if name in module.globals: objType = module.globals[name].signature res = self.getTypeSig(objType,...
30,079
def getNameAttribs(self, name, module, codeBlock=None): if codeBlock: locals = codeBlock.localnames() if name in locals: objType = codeBlock.locals[name].objtype res = self.getTypeAttribs(objType, module) if res is not None: return res if name in module.globals: objType = module.globals[name].signature res = self.getTy...
def getNameAttribs(self, name, module, codeBlock=None): if codeBlock: if name in codeBlock.locals: objType = codeBlock.locals[name].objtype res = self.getTypeAttribs(objType, module) if res is not None: return res if name in module.globals: objType = module.globals[name].signature res = self.getTypeAttribs(objType, mod...
30,080
def goto(self): # XXX What if page has been closed, notification self.modulePage.focus() self.modulePage.model.views[self.view].gotoBrowseMarker(self.marker)
defgoto(self):#XXXWhatifpagehasbeenclosed,notificationself.modulePage.focus()self.modulePage.model.views[self.view].gotoBrowseMarker(self.marker)
30,081
def add(self, modulepage, view, marker): page = HistoryBrowsePage(modulepage, view, marker) if self.idx == len(self.pages)-1: self.pages.append(page) else: self.pages[self.idx:] = [page] self.idx = len(self.pages)-1
defadd(self,modulepage,view,marker):page=HistoryBrowsePage(modulepage,view,marker)ifself.idx==len(self.pages)-1:self.pages.append(page)else:self.pages[self.idx:]=[page]self.idx=len(self.pages)-1
30,082
def checkRemoval(self, modPage): for page in self.pages[:]: if page.modulePage == modPage: idx = self.pages.index(page) if idx < self.idx: self.idx = self.idx - 1 del self.pages[idx]
def checkRemoval(self, modPage): for page in self.pages[:]: if page.modulePage == modPage: idx = self.pages.index(page) if idx <= self.idx: self.idx = self.idx - 1 del self.pages[idx]
30,083
def forward(self):
defforward(self):
30,084
def back(self):
defback(self):
30,085
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'pos': position, 'size': size, 'style': 'wxLC_ICON', 'validator': 'wxDefaultValidator', 'name': `self.name`}
def designTimeSource(self, position='wxDefaultPosition', size='wxDefaultSize'): return {'pos': position, 'size': size, 'style': 'wxLC_ICON', 'validator': 'wxDefaultValidator', 'name': `self.name`}
30,086
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'pos': position, 'size': size, 'style': 'wxLC_ICON', 'validator': 'wxDefaultValidator', 'name': `self.name`}
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'pos': position, 'size': size, 'style': 'wxLC_ICON', 'name': `self.name`}
30,087
def __init__(self, name, designer, parentCompanion, ctrl): CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl) self.editors = {'Width': IntConstrPropEdit, 'Heading': StrConstrPropEdit, 'Format': EnumConstrPropEdit}#StyleConstrPropEdit}
defself.names = {'Format': formatStyle} __init__(self,self.names = {'Format': formatStyle} name,self.names = {'Format': formatStyle} designer,self.names = {'Format': formatStyle} parentCompanion,self.names = {'Format': formatStyle} ctrl):self.names = {'Format': formatStyle} CollectionDTC.__init__(self,self.names = {'Fo...
30,088
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'pos': position, 'size': size, 'style': 'wxTR_HAS_BUTTONS', 'validator': 'wxDefaultValidator', 'name': `self.name`}
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'pos': position, 'size': size, 'style': 'wxTR_HAS_BUTTONS', 'name': `self.name`}
30,089
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'pos': position, 'size': size, 'choices': '[]', 'style': '0', 'validator': 'wxDefaultValidator', 'name': `self.name`}
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'pos': position, 'size': size, 'choices': '[]', 'style': '0', 'name': `self.name`}
30,090
def constructor(self): return {'Label': 'label', 'Position': 'point', 'Size': 'size', 'Choices': 'choices', 'MajorDimension': 'majorDimension', 'Style': 'style', 'Validator': 'validator', 'Name': 'name'}
def constructor(self): return {'Label': 'label', 'Position': 'point', 'Size': 'size', 'Choices': 'choices', 'MajorDimension': 'majorDimension', 'Style': 'style', 'Validator': 'validator', 'Name': 'name'}
30,091
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'label': `self.name`, 'point': position, 'size': size, 'choices': `['asd']`, 'majorDimension': '1', 'style': 'wxRA_SPECIFY_COLS', 'validator': 'wxDefaultValidator', 'name': `self.name`}
def designTimeSource(self, position = 'wxDefaultPosition', size = 'wxDefaultSize'): return {'label': `self.name`, 'point': position, 'size': size, 'choices': `['asd']`, 'majorDimension': '1', 'style': 'wxRA_SPECIFY_COLS', 'name': `self.name`}
30,092
def OnControlResize(self, event): """ Control is resized, emulate native wxWindows layout behaviour """ dsgn = self.designer try: if event.GetId() == dsgn.GetId() and dsgn.selection: dsgn.selection.selectCtrl(dsgn, dsgn.companion)
def OnControlResize(self, event): """ Control is resized, emulate native wxWindows layout behaviour """ dsgn = self.designer try: if event.GetId() == dsgn.GetId() and dsgn.selection: dsgn.selection.selectCtrl(dsgn, dsgn.companion)
30,093
def addDepLink(self, prop, name, dependents, depLinks): # XXX dependents does not seem to be used anymore ????
defaddDepLink(self,prop,name,dependents,depLinks):#XXXdependentsdoesnotseemtobeusedanymore????
30,094
def selectNone(self): if self.selection: self.selection.selectNone()
def selectNone(self): if self.selection: self.selection.selectNone()
30,095
def selectControlByPos(self, ctrl, pos, multiSelect): """ Handle selection of a control from a users click of creation of a new one if a component was selected on the palette. Some ctrls do not register clicks, the click is then picked up from the parent which checks if a click intersects any child regions. For effici...
def selectControlByPos(self, ctrl, pos, multiSelect): """ Handle selection of a control from a users click of creation of a new one if a component was selected on the palette.pos = wxPoint(SelectionTags.granularise(pos.x), SelectionTags.granularise(pos.y)) Some ctrls do not register clicks, the click is then picked up ...
30,096
def drawGrid_dots(self, dc, sze, sg): pen1 = wxPen(wxNamedColour('BLACK')) dc.SetPen(pen1) for y in range(sze.y / sg): for x in range(sze.x / sg): dc.DrawPoint(x * sg, y * sg)
def drawGrid_dots(self, dc, sze, sg): pen1 = wxPen(wxNamedColour('BLACK')) dc.SetPen(pen1) for y in range(sze.y / sg + 1): for x in range(sze.x / sg + 1): dc.DrawPoint(x * sg, y * sg)
30,097
def OnRecreateSelected(self, event): """ Recreate the current selection by cutting and pasting it. The clipboard is not disturbed. This is useful for applying changes to constructor parameters """ if self.selection and self.selection.selection != self: output = [] ctrlName = self.selection.name # XXX Boa should be able...
defOnRecreateSelected(self,event):"""Recreatethecurrentselectionbycuttingandpastingit.Theclipboardisnotdisturbed.Thisisusefulforapplyingchangestoconstructorparameters"""ifself.selectionandself.selection.selection!=self:output=[]ctrlName=self.selection.name#XXXBoashouldbeabletotellmethisparent=self.selection.selection.G...
30,098
def OnMoveLeft(self, event): sel = self.selection if sel and sel.selection != self: sel.position.x = sel.position.x - 1 sel.startPos.x = sel.startPos.x - 1 sel.resizeCtrl() sel.setSelection()
def OnMoveLeft(self, event): sel = self.selection if sel and sel.selection != self: sel.position.x = sel.position.x - 1 sel.startPos.x = sel.startPos.x - 1 sel.resizeCtrl() sel.setSelection()
30,099