bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def designTimeDefaults(self, vals, method=None): dtd = CollectionDTC.designTimeDefaults(self, vals)
def designTimeDefaults(self, vals, method=None): dtd = CollectionDTC.designTimeDefaults(self, vals)
28,600
def designTimeDefaults(self, vals, method=None): dtd = CollectionDTC.designTimeDefaults(self, vals)
def designTimeDefaults(self, vals, method=None): dtd = CollectionDTC.designTimeDefaults(self, vals)
28,601
def designTimeDefaults(self, vals, method=None): dtd = CollectionDTC.designTimeDefaults(self, vals)
def designTimeDefaults(self, vals, method=None): dtd = CollectionDTC.designTimeDefaults(self, vals)
28,602
def designTimeDefaults(self): return {'owner': self.designer, 'id': wxNewId()}
def designTimeDefaults(self): return {'owner': self.designer, 'id': wxNewId()}
28,603
def edit(self, event): dlg = wxTextEntryDialog(self.parent, 'Question', 'Caption', 'Default answer') try: if dlg.ShowModal() != wxID_OK: return self.value = dlg.GetValue() # Your code finally: self.inspectorPost(false) dlg.Destroy()
def edit(self, event): dlg = wx.TextEntryDialog(self.parent, 'Question', 'Caption', 'Default answer') try: if dlg.ShowModal() != wxID_OK: return self.value = dlg.GetValue() # Your code finally: self.inspectorPost(false) dlg.Destroy()
28,604
def edit(self, event): dlg = wxTextEntryDialog(self.parent, 'Question', 'Caption', 'Default answer') try: if dlg.ShowModal() != wxID_OK: return self.value = dlg.GetValue() # Your code finally: self.inspectorPost(false) dlg.Destroy()
def edit(self, event): dlg = wxTextEntryDialog(self.parent, 'Question', 'Caption', 'Default answer') try: if dlg.ShowModal() != wx.ID_OK: return self.value = dlg.GetValue() # Your code finally: self.inspectorPost(false) dlg.Destroy()
28,605
def edit(self, event): dlg = wxTextEntryDialog(self.parent, 'Question', 'Caption', 'Default answer') try: if dlg.ShowModal() != wxID_OK: return self.value = dlg.GetValue() # Your code finally: self.inspectorPost(false) dlg.Destroy()
def edit(self, event): dlg = wxTextEntryDialog(self.parent, 'Question', 'Caption', 'Default answer') try: if dlg.ShowModal() != wxID_OK: return self.value = dlg.GetValue() # Your code finally: self.inspectorPost(False) dlg.Destroy()
28,606
def __init__(self, name, designer, parentCompanion, ctrl): CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl)
def __init__(self, name, designer, parentCompanion, ctrl): CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl)
28,607
def properties(self): tcl = self.textConstrLst[self.index] if tcl.method in ('Append', 'AppendMenu'): props = CollectionIddDTC.properties(self) props.update( {'Text': ('IdRoute', wxMenu.GetLabel, wxMenu.SetLabel), 'Help': ('IdRoute', wxMenu.GetHelpString, wxMenu.SetHelpString)}) elif tcl.method == 'AppendSeparator': pr...
def properties(self): tcl = self.textConstrLst[self.index] if tcl.method in ('Append', 'AppendMenu'): props = CollectionIddDTC.properties(self) props.update( {'Text': ('IdRoute', wx.Menu.GetLabel, wx.Menu.SetLabel), 'Help': ('IdRoute', wx.Menu.GetHelpString, wx.Menu.SetHelpString)}) elif tcl.method == 'AppendSeparator'...
28,608
def designTimeSource(self, wId, method=None): if method is None: method = self.insertionMethod newItemName, winId = self.newUnusedItemNames(wId)
def designTimeSource(self, wId, method=None): if method is None: method = self.insertionMethod newItemName, winId = self.newUnusedItemNames(wId)
28,609
def designTimeDefaults(self, vals, method=None): if method is None: method = self.insertionMethod
def designTimeDefaults(self, vals, method=None): if method is None: method = self.insertionMethod
28,610
def designTimeDefaults(self, vals, method=None): if method is None: method = self.insertionMethod
def designTimeDefaults(self, vals, method=None): if method is None: method = self.insertionMethod
28,611
def defaultAction(self): nv = self.designer.inspector.props.getNameValue('Menus') if nv: nv.propEditor.edit(None)
def defaultAction(self): nv = self.designer.inspector.props.getNameValue('Menus') if nv: nv.propEditor.edit(None)
28,612
def designTimeDefaults(self, vals, method=None): 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 == 'wx.Menu()': dtd[param] = wxMenu() else: raise Exception, 'Invalid menu reference: '+name else: dtd[param] = self...
def designTimeDefaults(self, vals, method=None): 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 == 'wx.Menu()': dtd[param] = wx.Menu() else: raise Exception, 'Invalid menu reference: '+name else: dtd[param] = sel...
28,613
def vetoedMethods(self): return CollectionDTC.vetoedMethods(self)+['GetPosition', 'SetPosition', 'GetSize', 'SetSize']
def vetoedMethods(self): return CollectionDTC.vetoedMethods(self)+['GetPosition', 'SetPosition', 'GetSize', 'SetSize']
28,614
def designTimeSource(self, position='wx.DefaultPosition', size='wx.DefaultSize'): return {'id': 'wx.CURSOR_ARROW'}
def designTimeSource(self, position='wx.DefaultPosition', size='wx.DefaultSize'): return {'id': 'wx.CURSOR_ARROW'}
28,615
def designTimeSource(self, position='wx.DefaultPosition', size='wx.DefaultSize'): return {'id': 'wx.CURSOR_ARROW'}
defdesignTimeSource(self,position='wx.DefaultPosition',size='wx.DefaultSize'):return{'id':'wx.CURSOR_ARROW'}
28,616
def OnSTCSettings(self, event): menu = wxMenu() menu.Append(wxID_STC_WS, 'View Whitespace', '', 1) #checkable menu.Check(wxID_STC_WS, self.GetViewWhiteSpace()) menu.Append(wxID_STC_BUF, 'Buffered draw', '', 1) #checkable menu.Check(wxID_STC_BUF, self.GetBufferedDraw()) menu.Append(wxID_STC_IDNT, 'Use indentation guides...
def OnSTCSettings(self, event): menu = wxMenu() menu.Append(wxID_STC_WS, 'View Whitespace', '', 1) #checkable menu.Check(wxID_STC_WS, self.GetViewWhiteSpace()) menu.Append(wxID_STC_BUF, 'Buffered draw', '', 1) #checkable menu.Check(wxID_STC_BUF, self.GetBufferedDraw()) menu.Append(wxID_STC_IDNT, 'Use indentation guides...
28,617
def OnSTCSettings(self, event): menu = wxMenu() menu.Append(wxID_STC_WS, 'View Whitespace', '', 1) #checkable menu.Check(wxID_STC_WS, self.GetViewWhiteSpace()) menu.Append(wxID_STC_BUF, 'Buffered draw', '', 1) #checkable menu.Check(wxID_STC_BUF, self.GetBufferedDraw()) menu.Append(wxID_STC_IDNT, 'Use indentation guides...
def OnSTCSettings(self, event): menu = wxMenu() menu.Append(wxID_STC_WS, 'View Whitespace', '', 1) #checkable menu.Check(wxID_STC_WS, self.GetViewWhiteSpace()) menu.Append(wxID_STC_BUF, 'Buffered draw', '', 1) #checkable menu.Check(wxID_STC_BUF, self.GetBufferedDraw()) menu.Append(wxID_STC_IDNT, 'Use indentation guides...
28,618
def OnSTCSettings(self, event): menu = wxMenu() menu.Append(wxID_STC_WS, 'View Whitespace', '', 1) #checkable menu.Check(wxID_STC_WS, self.GetViewWhiteSpace()) menu.Append(wxID_STC_BUF, 'Buffered draw', '', 1) #checkable menu.Check(wxID_STC_BUF, self.GetBufferedDraw()) menu.Append(wxID_STC_IDNT, 'Use indentation guides...
def OnSTCSettings(self, event): menu = wxMenu() menu.Append(wxID_STC_WS, 'View Whitespace', '', 1) #checkable menu.Check(wxID_STC_WS, self.GetViewWhiteSpace()) menu.Append(wxID_STC_BUF, 'Buffered draw', '', 1) #checkable menu.Check(wxID_STC_BUF, self.GetBufferedDraw()) menu.Append(wxID_STC_IDNT, 'Use indentation guides...
28,619
def _getEventChecked(self, event): checked = not event.IsChecked() if wxPlatform == '__WXGTK__': return not checked else: return checked
def _getEventChecked(self, event): checked = not event.IsChecked() if wxPlatform == '__WXGTK__' or wxVERSION[:3] > (2, 5, 3): return not checked else: return checked
28,620
def execStart(self, pid, program, script): model = self.getModel() editor = model.editor if editor.erroutFrm: editor.erroutFrm.processStarted(program, pid, script)
def execStart(self, pid, program, script): editor = self.editor if editor.erroutFrm: editor.erroutFrm.processStarted(program, pid, script)
28,621
def execStart(self, pid, program, script): model = self.getModel() editor = model.editor if editor.erroutFrm: editor.erroutFrm.processStarted(program, pid, script)
def execStart(self, pid, program, script): model = self.getModel() editor = model.editor if editor.erroutFrm: editor.erroutFrm.processStarted(program, pid, script)
28,622
def execFinish(self, runner): model = self.getModel() editor = model.editor if editor.erroutFrm: if editor.palette.IsShown(): editor.palette.restore() editor.restore()
def execFinish(self, runner): editor = self.editor if editor.erroutFrm: if editor.palette.IsShown(): editor.palette.restore() editor.restore()
28,623
def execFinish(self, runner): model = self.getModel() editor = model.editor if editor.erroutFrm: if editor.palette.IsShown(): editor.palette.restore() editor.restore()
defexecFinish(self,runner):model=self.getModel()editor=model.editorifeditor.erroutFrm:ifeditor.palette.IsShown():editor.palette.restore()editor.restore()
28,624
def OnInit(self): wxInitAllImageHandlers()
def OnInit(self): wxInitAllImageHandlers()
28,625
def parseLine(self, module, file, line, lineno, cur_class, cur_meth, cur_func): res = is_todo.match(line) or is_todo2.match(line) if res: self.todos.append((lineno, string.strip(line[res.span()[1]:]))) return 0, cur_class, cur_meth, cur_func
def parseLine(self, module, file, line, lineno, cur_class, cur_meth, cur_func): res = is_todo.match(line) or is_todo2.match(line) if res: self.todos.append((lineno, string.strip(line[res.span()[1]:]))) return 0, cur_class, cur_meth, cur_func
28,626
def test1(): q = 1 print 'I' print 'am' print 'here.'
def test1(): q = 1 print 'I' print 'am' print 'here.'
28,627
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
28,628
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
28,629
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
28,630
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
def test(): print 'Hello' print 'World!' for n in range(1000): pass print 'Message:' test1() print 'Bye.' raise 'I refuse to finish!' print 'yeah.'
28,631
def showContextHelp(parent, toolbar, word): print 'looking up help for', word from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): print 'loading wxWin help', HelpCompanions.__dict__[helpStr] showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) ...
def showContextHelp(parent, toolbar, word): from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): print 'loading wxWin help', HelpCompanions.__dict__[helpStr] showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) elif HelpCompanions.libRefDocs.ha...
28,632
def showContextHelp(parent, toolbar, word): print 'looking up help for', word from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): print 'loading wxWin help', HelpCompanions.__dict__[helpStr] showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) ...
def showContextHelp(parent, toolbar, word): print 'looking up help for', word from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) elif HelpCompanions.libRefDocs.has_key(word): print 'loading...
28,633
def showContextHelp(parent, toolbar, word): print 'looking up help for', word from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): print 'loading wxWin help', HelpCompanions.__dict__[helpStr] showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) ...
def showContextHelp(parent, toolbar, word): print 'looking up help for', word from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): print 'loading wxWin help', HelpCompanions.__dict__[helpStr] showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) ...
28,634
def showContextHelp(parent, toolbar, word): print 'looking up help for', word from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): print 'loading wxWin help', HelpCompanions.__dict__[helpStr] showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) ...
def showContextHelp(parent, toolbar, word): print 'looking up help for', word from Companions import HelpCompanions helpStr = word+'Docs' if HelpCompanions.__dict__.has_key(helpStr): print 'loading wxWin help', HelpCompanions.__dict__[helpStr] showHelp(parent, wxWinHelpFrame, HelpCompanions.__dict__[helpStr], toolbar) ...
28,635
def __init__(self, parent, home, index, icon, paletteToolbar = None): self._init_ctrls(parent) self._init_utils() self.SetDimensions(120, 75, Preferences.wxDefaultFrameSize.x, Preferences.wxDefaultFrameSize.y)
def __init__(self, parent, home, index, icon, paletteToolbar = None): self._init_ctrls(parent) self._init_utils() self.SetDimensions(120, 75, Preferences.wxDefaultFrameSize.x, Preferences.wxDefaultFrameSize.y)
28,636
def designTimeSource(self, position = 'wx.DefaultPosition', size = 'wx.DefaultSize'): return {'text': `self.name`, 'start': 'False', 'direction': `'rtl'`, 'pos': position, 'size': size, 'style': '0', 'name': `self.name`}
def designTimeSource(self, position = 'wx.DefaultPosition', size = 'wx.DefaultSize'): return {'text': `self.name`, 'start': 'False', 'direction': `'rtl'`, 'pos': position, 'size': size, 'style': '0', 'name': `self.name`}
28,637
def getreply(self): file=self.sock.makefile('rb') data=string.join(file.readlines(), '') file.close() self.file=StringIO(data) line = self.file.readline() try: [ver, code, msg] = string.split(line, None, 2) except ValueError: try: [ver, code] = string.split(line, None, 1) msg = "" except ValueError: return -1, line, No...
def getreply(self): file=self.sock.makefile('rb') data=string.join(file.readlines(), '') file.close() self.file=StringIO(data) line = self.file.readline() try: [ver, code, msg] = string.split(line, None, 2) except ValueError: try: [ver, code] = string.split(line, None, 1) msg = "" except ValueError: return -1, line, No...
28,638
def __init__(self, url, username=None, password=None): self.username=username self.password=password self.url=url if urlregex.match(url) >= 0: host,port,uri=urlregex.group(1,2,3) self.host=host self.port=port and string.atoi(port[1:]) or 80 self.uri=uri or '/' else: raise ValueError, url
def __init__(self, url, username=None, password=None): self.username=username self.password=password self.url=url mo = urlreg.match(url) if mo: host,port,uri=mo.group(1,2,3) self.host=host self.port=port and string.atoi(port[1:]) or 80 self.uri=uri or '/' else: raise ValueError, url
28,639
def __set_authtoken(self, headers, atype='Basic'): if not (self.username and self.password): return headers if headers.has_key('Authorization'): return headers if atype=='Basic': headers['Authorization']=( "Basic %s" % string.replace(encodestring('%s:%s' % (self.username,self.password)), '\012','')) return headers rais...
def __set_authtoken(self, headers, atype='Basic'): if not (self.username and self.password): return headers if headers.has_key('Authorization'): return headers if atype=='Basic': headers['Authorization']=( "Basic %s" % string.replace(encodestring('%s:%s' % (self.username,self.password)), '\012','')) return headers rais...
28,640
def __snd_request(self, method, uri, headers={}, body='', eh=1): try: h=HTTP() h.connect(self.host, self.port) h.putrequest(method, uri) for n, v in headers.items(): h.putheader(n, v) if eh: h.endheaders() if body: h.send(body) ver, code, msg, hdrs=h.getreply() data=h.getfile().read() h.close() except: raise 'NotAvaila...
def __snd_request(self, method, uri, headers={}, body='', eh=1): try: h=HTTP() h.connect(self.host, self.port) h.putrequest(method, uri) for n, v in headers.items(): h.putheader(n, v) if eh: h.endheaders() if body: h.send(body) ver, code, msg, hdrs=h.getreply() data=h.getfile().read() h.close() except: raise 'NotAvaila...
28,641
def put(self, file='', content_type='', content_enc='', isbin=regex.compile('[\0-\6\177-\277]').search, **kw): headers=self.__get_headers(kw) filetype=type(file) if filetype is type('') and (isbin(file) < 0) and \ os.path.exists(file): ob=open(file, 'rb') body=ob.read() ob.close() c_type, c_enc=guess_type(file) elif fi...
def put(self, file='', content_type='', content_enc='', isbin=re.compile(r'[\000-\006\177-\277]').search, **kw): headers=self.__get_headers(kw) filetype=type(file) if filetype is type('') and (isbin(file) < 0) and \ os.path.exists(file): ob=open(file, 'rb') body=ob.read() ob.close() c_type, c_enc=guess_type(file) elif ...
28,642
def put(self, file='', content_type='', content_enc='', isbin=regex.compile('[\0-\6\177-\277]').search, **kw): headers=self.__get_headers(kw) filetype=type(file) if filetype is type('') and (isbin(file) < 0) and \ os.path.exists(file): ob=open(file, 'rb') body=ob.read() ob.close() c_type, c_enc=guess_type(file) elif fi...
def put(self, file='', content_type='', content_enc='', isbin=regex.compile('[\0-\6\177-\277]').search, **kw): headers=self.__get_headers(kw) filetype=type(file) if filetype is type('') and (isbin(file) is None) and \ os.path.exists(file): ob=open(file, 'rb') body=ob.read() ob.close() c_type, c_enc=guess_type(file) eli...
28,643
def lock(self, scope='exclusive', type='write', owner='', depth='infinity', timeout='Infinite', **kw): """Create a lock with the specified scope, type, owner, depth and timeout on the resource. A locked resource prevents a principal without the lock from executing a PUT, POST, PROPPATCH, LOCK, UNLOCK, MOVE, DELETE, or ...
def lock(self, scope='exclusive', type='write', owner='', depth='infinity', timeout='Infinite', **kw): """Create a lock with the specified scope, type, owner, depth and timeout on the resource. A locked resource prevents a principal without the lock from executing a PUT, POST, PROPPATCH, LOCK, UNLOCK, MOVE, DELETE, or ...
28,644
def unlock(self, token, **kw): """Remove the lock identified by token from the resource and all other resources included in the lock. If all resources which have been locked under the submitted lock token can not be unlocked the unlock method will fail.""" headers=self.__get_headers(kw) token='<opaquelocktoken:%s>' % ...
def unlock(self, token, **kw): """Remove the lock identified by token from the resource and all other resources included in the lock. If all resources which have been locked under the submitted lock token can not be unlocked the unlock method will fail.""" headers=self.__get_headers(kw) token='<opaquelocktoken:%s>' % ...
28,645
def __str__(self): data=[] data.append('%s %s %s\r\n' % (self.version, self.code, self.msg)) map(data.append, self.headers.headers) data.append('\r\n') data.append(self.body) return string.join(data, '')
def __str__(self): data=[] data.append('%s %s %s\r\n' % (self.version, self.code, self.msg)) map(data.append, self.headers.headers) data.append('\r\n') data.append(self.body) return string.join(data, '')
28,646
def __str__(self): data=[] data.append('%s %s %s\r\n' % (self.version, self.code, self.msg)) map(data.append, self.headers.headers) data.append('\r\n') data.append(self.body) return string.join(data, '')
def __str__(self): data=[] data.append('%s %s %s\r\n' % (self.version, self.code, self.msg)) map(data.append, self.headers.headers) data.append('\r\n') data.append(self.body) return string.join(data, '')
28,647
def marshal_long(name, val): return ('%s:long=%s' % (name, val))[:-1]
def marshal_long(name, val): value = '%s:long=%s' % (name, val) if value[-1] == 'L': value = value[:-1] return value
28,648
def marshal_list(name, seq, tname='list', lt=type([]), tt=type(())): result=[] for v in seq: tp=type(v) if tp in (lt, tt): raise TypeError, 'Invalid recursion in data to be marshaled.' result.append(marshal_var("%s:%s" % (name, tname), v)) return string.join(result, '&')
def marshal_list(name, seq, tname='list', lt=type([]), tt=type(())): result=[] for v in seq: tp=type(v) if tp in (lt, tt): raise TypeError, 'Invalid recursion in data to be marshaled.' result.append(marshal_var("%s:%s" % (name, tname), v)) return string.join(result, '&')
28,649
def render(self): join=string.join h=self._headers s=[]
def render(self): join=string.join h=self._headers s=[]
28,650
def doAutoIndent(self, prevline, pos): stripprevline = prevline.strip() if stripprevline: indent = prevline[:prevline.find(stripprevline)] else: # python 2.2.1 does not support the strip parameter. indent = string.strip(prevline, '\r\n')
def doAutoIndent(self, prevline, pos): stripprevline = prevline.strip() if stripprevline: indent = prevline[:prevline.find(stripprevline)] else: # python 2.2.1 does not support the strip parameter. indent = string.strip(prevline, '\r\n')
28,651
'and assert break class continue def del elif else except '
'and self.setStyles(faces) def setStyles(self, faces): assert self.setStyles(faces) def setStyles(self, faces): break self.setStyles(faces) def setStyles(self, faces): class self.setStyles(faces) def setStyles(self, faces): continue self.setStyles(faces) def setStyles(self, faces): def self.setStyles(faces) def s...
28,652
'and assert break class continue def del elif else except '
'and assert break class continue def del elif else except '
28,653
def idWord(line, piv, lineStart, delim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in delim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in delim: break return pivL + lineStart, pivR - pivL
def idWord(line, piv, lineStart, leftDelim = word_delim, rightDelim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in delim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in delim: break return pivL + lineStart, pivR...
28,654
def idWord(line, piv, lineStart, delim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in delim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in delim: break return pivL + lineStart, pivR - pivL
def idWord(line, piv, lineStart, delim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in leftDelim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in delim: break return pivL + lineStart, pivR - pivL
28,655
def idWord(line, piv, lineStart, delim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in delim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in delim: break return pivL + lineStart, pivR - pivL
def idWord(line, piv, lineStart, delim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in delim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in delim: break return pivL + lineStart, pivR - pivL
28,656
def idWord(line, piv, lineStart, delim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in delim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in delim: break return pivL + lineStart, pivR - pivL
def idWord(line, piv, lineStart, delim = word_delim): if piv >= len(line): return 0, 0 pivL = pivR = piv for pivL in range(piv, -1, -1): if not line[pivL] in delim: pivL = pivL + 1 break for pivR in range(piv + 1, len(line)): if not line[pivR] in rightDelim: break return pivL + lineStart, pivR - pivL
28,657
def __init__(self, wId): self.SetEOLMode(wxSTC_EOL_LF) self.eol = wxSTC_EOL_LF #endOfLines[self.GetEOLMode()]
def __init__(self, wId): self.SetEOLMode(wxSTC_EOL_LF) self.eol = '\n' #endOfLines[self.GetEOLMode()]
28,658
def __init__(self, wId): self.SetEOLMode(wxSTC_EOL_LF) self.eol = wxSTC_EOL_LF #endOfLines[self.GetEOLMode()] keyWds = \ 'asm auto bool break case catch char class const const_cast continue '\ 'default delete do double dynamic_cast else enum explicit export '\ 'extern false float for friend goto if inline int long mut...
def __init__(self, wId): self.SetEOLMode(wxSTC_EOL_LF) self.eol = '\n' #endOfLines[self.GetEOLMode()] keyWds = \ 'asm auto bool break case catch char class const const_cast continue '\ 'default delete do double dynamic_cast else enum explicit export '\ 'extern false float for friend goto if inline int long mutable '\ ...
28,659
def moveCapture(self, ctrl, compn, pos): # Put selection around control
def moveCapture(self, ctrl, compn, pos): # Put selection around control
28,660
def moving(self, ctrl, pos, multiDragCtrl = None): # Calculate relative position if it is a multiple selection drag if multiDragCtrl: dragCtrlPos = multiDragCtrl.GetPosition() movingCtrlPos = self.selection.GetPosition() pos = wxPoint(pos.x - dragCtrlPos.x + movingCtrlPos.x, pos.y - dragCtrlPos.y + movingCtrlPos.y)
def moving(self, ctrl, pos, multiDragCtrl = None): # Calculate relative position if it is a multiple selection drag if multiDragCtrl: dragCtrlPos = multiDragCtrl.GetPosition() movingCtrlPos = self.selection.GetPosition() pos = wxPoint(pos.x - dragCtrlPos.x + movingCtrlPos.x, pos.y - dragCtrlPos.y + movingCtrlPos.y)
28,661
def moving(self, ctrl, pos, multiDragCtrl = None): # Calculate relative position if it is a multiple selection drag if multiDragCtrl: dragCtrlPos = multiDragCtrl.GetPosition() movingCtrlPos = self.selection.GetPosition() pos = wxPoint(pos.x - dragCtrlPos.x + movingCtrlPos.x, pos.y - dragCtrlPos.y + movingCtrlPos.y)
def moving(self, ctrl, pos, multiDragCtrl = None): # Calculate relative position if it is a multiple selection drag if multiDragCtrl: dragCtrlPos = multiDragCtrl.GetPosition() movingCtrlPos = self.selection.GetPosition() pos = wxPoint(pos.x - dragCtrlPos.x + movingCtrlPos.x, pos.y - dragCtrlPos.y + movingCtrlPos.y)
28,662
def moveRelease(self): if self.dragTag: # XXX nasty passing a None event self.OnSizeEnd() self.showTags()
defmoveRelease(self):ifself.dragTag:#XXXnastypassingaNoneeventself.OnSizeEnd()self.showTags()
28,663
def selectCtrl(self, ctrl, compn, selectInInspector = true): self.hideTags() if not ctrl: self.selection = None self.selCompn = None self.inspSel = None else: if ctrl.this == self.designer.this: self.name = '' self.parent = ctrl cp = (0, 0)
def selectCtrl(self, ctrl, compn, selectInInspector = true): self.hideTags() if not ctrl: self.selection = None self.selCompn = None self.inspSel = None else: if ctrl.this == self.designer.this: self.name = '' self.parent = ctrl cp = (0, 0)
28,664
def updateAnchors(self): if self.selCompn: for idx in range(4): if self.selCompn.anchorSettings: self.anchorTags[idx].setAnchor(self.selCompn.anchorSettings[idx]) else: self.anchorTags[idx].setAnchor(None)
def updateAnchors(self): if self.selCompn: for idx in range(4): if self.selCompn.anchorSettings: self.anchorTags[idx].setAnchor(self.selCompn.anchorSettings[idx]) else: self.anchorTags[idx].setAnchor(None)
28,665
def OnRightClick(self, event): menu = wxMenu() try: menu.Append(self.wxID_ANCHORED, 'Anchored', '', true) menu.Check(self.wxID_ANCHORED, self.anchored) self.PopupMenu(menu, event.GetPosition()) finally: menu.Destroy()
def OnRightClick(self, event): menu = wxMenu() try: if self.hasSizer or self.inSizer: menu.Append(self.wxID_SIZERED, 'Select sizer') else: menu.Append(self.wxID_ANCHORED, 'Anchored', '', true) menu.Check(self.wxID_ANCHORED, self.anchored) self.PopupMenu(menu, event.GetPosition()) finally: menu.Destroy()
28,666
def setPos(self, position): grp = self.group oldPos = grp.position oldSize = grp.size grp.position = wxPoint(position.x, position.y) grp.size = wxSize((oldPos.x - position.x) + grp.size.x, (oldPos.y - position.y) + grp.size.y)
def setPos(self, position): grp = self.group oldPos = grp.position oldSize = grp.size grp.position = wxPoint(position.x, position.y) grp.size = wxSize((oldPos.x - position.x) + grp.size.x, (oldPos.y - position.y) + grp.size.y)
28,667
def factory(self, name, parent, companion, rootCompanion, propWrapper, idx, width): try: propWrapper.connect(companion.control, companion) value = propWrapper.getValue() except Exception, message: print 'Error on accessing Getter for', name, ':', message value = None if type(value) == InstanceType: if self.classRegist...
def factory(self, name, parent, companion, rootCompanion, propWrapper, idx, width): try: propWrapper.connect(companion.control, companion) value = propWrapper.getValue() except Exception, message: print 'Error on accessing Getter for', name, ':', message value = None if type(value) == InstanceType: if self.classRegist...
28,668
def __init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width): self.name = name self.parent = parent self.idx = idx self.width = width self.editorCtrl = None self.propWrapper = propWrapper self.companion = companion self.obj = companion.control self.propWrapper.connect(self.obj, self.companion) s...
def __init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width, _1=None , _2=None): self.name = name self.parent = parent self.idx = idx self.width = width self.editorCtrl = None self.propWrapper = propWrapper self.companion = companion self.obj = companion.control self.propWrapper.connect(self.obj...
28,669
def __init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width): self.name = name self.parent = parent self.idx = idx self.width = width self.editorCtrl = None self.propWrapper = propWrapper self.companion = companion self.obj = companion.control self.propWrapper.connect(self.obj, self.companion) s...
def __init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width): self.name = name self.parent = parent self.idx = idx self.width = width self.editorCtrl = None self.companion = companion self.obj = companion.control self.propWrapper.connect(self.obj, self.companion) self.rootCompanion = rootCompani...
28,670
def __init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width): self.name = name self.parent = parent self.idx = idx self.width = width self.editorCtrl = None self.propWrapper = propWrapper self.companion = companion self.obj = companion.control self.propWrapper.connect(self.obj, self.companion) s...
defself.ownerPropEdit = None self.expanded = false __init__(self,self.ownerPropEdit = None self.expanded = false name,self.ownerPropEdit = None self.expanded = false parent,self.ownerPropEdit = None self.expanded = false companion,self.ownerPropEdit = None self.expanded = false rootCompanion,self.ownerPropEdit = N...
28,671
def initFromComponent(self): if self.obj: try: self.value = self.propWrapper.getValue() except Exception, message: self.value = '' if self.editorCtrl: self.editorCtrl.setValue(self.valueToIECValue()) else: self.value = ''
def initFromComponent(self): if self.obj: try: self.value = self.propWrapper.getValue() except Exception, message: self.value = '' if self.editorCtrl: self.editorCtrl.setValue(self.valueToIECValue()) else: self.value = ''
28,672
def refreshCompCtrl(self): if self.root and hasattr(self.root, 'Refresh'): # XXX This used to be neccesary pass #self.root.Refresh()
def refreshCompCtrl(self): if self.root and hasattr(self.root, 'Refresh'): # XXX This used to be neccesary pass #self.root.Refresh()
28,673
def inspectorPost(self, closeEditor = true): if self.editorCtrl: v = self.getValue() cv = self.getCtrlValue() if v != cv: self.validateProp(v, cv) self.setCtrlValue(cv, v) self.persistValue(self.valueAsExpr()) else: pass if closeEditor: self.editorCtrl.destroyControl() self.editorCtrl = None self.refreshCompCtrl()
def inspectorPost(self, closeEditor = true): if self.editorCtrl: v = self.getValue() cv = self.getCtrlValue() if `v` != `cv`: self.validateProp(v, cv) self.setCtrlValue(cv, v) self.persistValue(self.valueAsExpr()) else: pass if closeEditor: self.editorCtrl.destroyControl() self.editorCtrl = None self.refreshCompCtrl()
28,674
def inspectorPost(self, closeEditor = true): if self.editorCtrl: v = self.getValue() cv = self.getCtrlValue() if v != cv: self.validateProp(v, cv) self.setCtrlValue(cv, v) self.persistValue(self.valueAsExpr()) else: pass if closeEditor: self.editorCtrl.destroyControl() self.editorCtrl = None self.refreshCompCtrl()
def inspectorPost(self, closeEditor = true): if self.editorCtrl: v = self.getValue() cv = self.getCtrlValue() if v != cv: self.validateProp(v, cv) self.setCtrlValue(cv, v) self.persistValue(self.valueAsExpr()) if self.ownerPropEdit: self.companion.updateOwnerFromObj() self.ownerPropEdit.initFromComponent() if esRec...
28,675
def inspectorPost(self, closeEditor = true): if self.editorCtrl: v = self.getValue() cv = self.getCtrlValue() if v != cv: self.validateProp(v, cv) self.setCtrlValue(cv, v) self.persistValue(self.valueAsExpr()) else: pass if closeEditor: self.editorCtrl.destroyControl() self.editorCtrl = None self.refreshCompCtrl()
def inspectorPost(self, closeEditor = true): if self.editorCtrl: v = self.getValue() cv = self.getCtrlValue() if v != cv: self.validateProp(v, cv) self.setCtrlValue(cv, v) self.persistValue(self.valueAsExpr()) else: pass if closeEditor: self.editorCtrl.destroyControl() self.editorCtrl = None self.refreshCompCtrl()
28,676
def setValue(self, value): 'property editor: set value', value self.value = value if self.editorCtrl: self.editorCtrl.SetValue(self.value)
def setValue(self, value): self.value = value if self.editorCtrl: self.editorCtrl.SetValue(self.value)
28,677
def __init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width, options, names): PropertyEditor.__init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width) self.options = options self.names = names if names: self.revNames = reverseDict(names) else: self.revNames = None
def __init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width, options, names): PropertyEditor.__init__(self, name, parent, companion, rootCompanion, propWrapper, idx, width) self.options = options self.names = names if names: self.revNames = reverseDict(names) else: self.revNames = None
28,678
def setCtrlValue(self, oldValue, value): self.companion.checkTriggers(self.name, oldValue, value)
def setCtrlValue(self, oldValue, value): self.companion.checkTriggers(self.name, oldValue, value)
28,679
def edit(self, event): dlg = wxFileDialog(self.parent, 'Choose an image', '.', '', 'Bitmaps (*.bmp)|*.bmp', wxOPEN) try: if dlg.ShowModal() == wxID_OK: self.value = 'wxBitmap(%s, wxBITMAP_TYPE_BMP)'%(`dlg.GetPath()`) v = self.getValue() cv = self.getCtrlValue() self.setCtrlValue(cv, v) self.persistValue(self.value) sel...
def edit(self, event): dlg = wxFileDialog(self.parent, 'Choose an image', '.', '', 'Bitmaps (*.bmp)|*.bmp', wxOPEN) try: if dlg.ShowModal() == wxID_OK: try: self.value = 'wxBitmap(%s, wxBITMAP_TYPE_BMP)'%(`dlg.GetPath()`) v = self.getValue() cv = self.getCtrlValue() self.setCtrlValue(cv, v) self.persistValue(self.val...
28,680
def getDisplayValue(self):
def getDisplayValue(self):
28,681
## def getCtrlValue(self):
## def getCtrlValue(self):
28,682
def valueToIECValue(self): v = self.value return v
def valueToIECValue(self): v = self.value return v
28,683
def persistValue(self, value): self.companion.persistEvt(self.name, value)
def persistValue(self, value): self.companion.persistEvt(self.name, value)
28,684
def inspectorEdit(self): self.editorCtrl = TextCtrlIEC(self, self.value) self.editorCtrl.createControl(self.parent, self.value, self.idx, self.width)
def inspectorEdit(self): self.editorCtrl = TextCtrlIEC(self, self.value) self.editorCtrl.createControl(self.parent, self.value, self.idx, self.width)
28,685
def getValue(self): if self.editorCtrl: try: value = eval(self.editorCtrl.getValue()) except Exception, mess:
def getValue(self): if self.editorCtrl: try: value = eval(self.editorCtrl.getValue()) except Exception, mess:
28,686
def getValue(self): if self.editorCtrl: try: value = eval(self.editorCtrl.getValue()) except Exception, mess:
def getValue(self): if self.editorCtrl: try: value = eval(self.editorCtrl.getValue()) except Exception, mess:
28,687
def getValue(self): # XXX Currently returning the old value in case of error because # XXX an exception here cannot be gracefully handled yet. # XXX Specifically closing the frame with the focus on the if self.editorCtrl: value = self.editorCtrl.getValue() if value != self.value: if self.companion.designer.objects.has_...
defgetValue(self):#XXXCurrentlyreturningtheoldvalueincaseoferrorbecause#XXXanexceptionherecannotbegracefullyhandledyet.#XXXSpecificallyclosingtheframewiththefocusontheifself.editorCtrl:value=self.editorCtrl.getValue()ifvalue!=self.value:ifself.companion.designer.objects.has_key(value):wxLogError('Namealreadyusedbyanoth...
28,688
def valueToIECValue(self): v = self.value if type(v) == IntType: return self.getValues()[v] else: return `v`
def valueToIECValue(self): v = self.value if type(v) == IntType: return self.getValues()[v] else: return `v`
28,689
def valueToIECValue(self): if self.revNames: try: return self.revNames[self.value] except KeyError: return `self.value` else: OptionedPropEdit.getDisplayValue(self)
def valueToIECValue(self): if self.revNames: try: return self.revNames[self.value] except KeyError: return `self.value` else: OptionedPropEdit.getDisplayValue(self)
28,690
def getDisplayValue(self):
def getDisplayValue(self):
28,691
def getValue(self): if self.editorCtrl: strVal = self.editorCtrl.getValue() try: self.value = self.names[strVal] except KeyError: self.value = eval(strVal) return self.value
def getValue(self): if self.editorCtrl: strVal = self.editorCtrl.getValue() try: self.value = self.names[strVal] except KeyError: self.value = eval(strVal) return self.value
28,692
def valueToIECValue(self):
defvalueToIECValue(self):
28,693
def getDisplayValue(self):
def getDisplayValue(self):
28,694
def getValue(self): if self.editorCtrl: strVal = self.editorCtrl.getValue() if strVal == `None`: self.value = None else: objs = self.companion.designer.getObjectsOfClass(self.linkClass) self.value = objs[strVal] return self.value
def getValue(self): if self.editorCtrl: strVal = self.editorCtrl.getValue() if strVal == `None`: self.value = None else: objs = self.companion.designer.getObjectsOfClass(self.linkClass) self.value = objs[strVal] return self.value
28,695
def getStyle(self): return [esDialog]
def getStyle(self): return [esExpandable] def getSubCompanion(self): from Companions.Companions import ColourDTC return ColourDTC
28,696
def edit(self, event): data = wxColourData() data.SetColour(self.value) dlg = wxColourDialog(self.parent, data)
def edit(self, event): data = wxColourData() data.SetColour(self.value) dlg = wxColourDialog(self.parent, data)
28,697
def valueAsExpr(self): return 'wxColour(%d, %d, %d)'%(self.value.Red(), self.value.Green(), self.value.Blue())
def valueAsExpr(self): return 'wxColour(%d, %d, %d)'%(self.value.Red(), self.value.Green(), self.value.Blue())
28,698
def getValue(self): if self.editorCtrl: try: tuplePos = eval(self.editorCtrl.getValue()) except Exception, mess:
def getValue(self): if self.editorCtrl: try: tuplePos = eval(self.editorCtrl.getValue()) except Exception, mess:
28,699