bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def _insertKey(self, char, pos, sel_start, sel_to, value, allowAutoSelect=False): """ Handles replacement of the character at the current insertion point.""" | def _insertKey(self, char, pos, sel_start, sel_to, value, allowAutoSelect=False): """ Handles replacement of the character at the current insertion point.""" | 32,100 |
def OnChanged(self, evt): if self.callCallback: self.changeCallback(evt) | def OnChanged(self, evt): if self.callCallback and self.changeCallback: self.changeCallback(evt) | 32,101 |
def OnBrowse (self, event = None): """ Going to browse for file... """ current = self.GetValue() directory = os.path.split(current) if os.path.isdir( current): directory = current current = '' elif directory and os.path.isdir( directory[0] ): current = directory[1] directory = directory [0] else: directory = self.start... | def OnBrowse (self, event = None): """ Going to browse for file... """ current = self.GetValue() directory = os.path.split(current) if os.path.isdir( current): directory = current current = '' elif directory and os.path.isdir( directory[0] ): current = directory[1] directory = directory [0] else: directory = self.start... | 32,102 |
def OnBrowse (self, event = None): """ Going to browse for file... """ current = self.GetValue() directory = os.path.split(current) if os.path.isdir( current): directory = current current = '' elif directory and os.path.isdir( directory[0] ): current = directory[1] directory = directory [0] else: directory = self.start... | defOnBrowse(self,event=None):"""Goingtobrowseforfile..."""current=self.GetValue()directory=os.path.split(current)ifos.path.isdir(current):directory=currentcurrent=''elifdirectoryandos.path.isdir(directory[0]):current=directory[1]directory=directory[0]else:directory=self.startDirectorydlg=wxFileDialog(self,self.dialogTi... | 32,103 |
def GetValue (self): """ Convenient access to text control value """ return self.textControl.GetValue () | def GetValue (self): """ Convenient access to text control value """ return self.textControl.GetValue () | 32,104 |
def runTest(frame, nb, log): win = TestPanel(nb, log) return win | def runTest(frame, nb, log): win = TestPanel(nb, log) return win | 32,105 |
def wxArtProvider_GetIcon(*_args, **_kwargs): val = apply(misc2c.wxArtProvider_GetIcon,_args,_kwargs) if val: val = wxIconPtr(val); val.thisown = 1 return val | def wxArtProvider_GetIcon(*_args, **_kwargs): val = apply(misc2c.wxArtProvider_GetIcon,_args,_kwargs) if val: val = wxIconPtr(val); val.thisown = 1 return val | 32,106 |
def __init__ ( self, parent, id=-1, pos = wxDefaultPosition, size = wxDefaultSize, style = 0, validator = wxDefaultValidator, name = "integer", value = 0, min=None, max=None, limited = 0, allow_none = 0, allow_long = 0, default_color = wxBLACK, oob_color = wxRED, ): | def __init__ ( self, parent, id=-1, value = 0, pos = wxDefaultPosition, size = wxDefaultSize, style = 0, validator = wxDefaultValidator, name = "integer", value = 0, min=None, max=None, limited = 0, allow_none = 0, allow_long = 0, default_color = wxBLACK, oob_color = wxRED, ): | 32,107 |
def __init__ ( self, parent, id=-1, pos = wxDefaultPosition, size = wxDefaultSize, style = 0, validator = wxDefaultValidator, name = "integer", value = 0, min=None, max=None, limited = 0, allow_none = 0, allow_long = 0, default_color = wxBLACK, oob_color = wxRED, ): | def __init__ ( self, parent, id=-1, pos = wxDefaultPosition, size = wxDefaultSize, style = 0, validator = wxDefaultValidator, name = "integer", min=None, max=None, limited = 0, allow_none = 0, allow_long = 0, default_color = wxBLACK, oob_color = wxRED, ): | 32,108 |
def HitTest(self, x, y): if not self._lineControlPoints: return False | def HitTest(self, x, y): if not self._lineControlPoints: return False | 32,109 |
def OnMoveLink(self, dc, moveControlPoints = True): """Called when a connected object has moved, to move the link to correct position """ if not self._from or not self._to: return | def OnMoveLink(self, dc, moveControlPoints = True): """Called when a connected object has moved, to move the link to correct position """ if not self._from or not self._to: return | 32,110 |
def FindLineEndPoints(self): """Finds the x, y points at the two ends of the line. | def FindLineEndPoints(self): """Finds the x, y points at the two ends of the line. | 32,111 |
def OnDraw(self, dc): if not self._lineControlPoints: return | defOnDraw(self,dc):ifnotself._lineControlPoints:return | 32,112 |
def ResetControlPoints(self): if self._canvas and self._lineControlPoints: for i in range(min(len(self._controlPoints), len(self._lineControlPoints))): point = self._lineControlPoints[i] control = self._controlPoints[i] control.SetX(point[0]) control.SetY(point[1]) | def ResetControlPoints(self): if self._canvas and self._lineControlPoints and self._controlPoints: for i in range(min(len(self._controlPoints), len(self._lineControlPoints))): point = self._lineControlPoints[i] control = self._controlPoints[i] control.SetX(point[0]) control.SetY(point[1]) | 32,113 |
def OnSizingDragLeft(self, pt, draw, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | def OnSizingDragLeft(self, pt, draw, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | 32,114 |
def OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | def OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | 32,115 |
def OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | def OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | 32,116 |
def OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | def OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | 32,117 |
def OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | def OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0): dc = wx.ClientDC(self.GetCanvas()) self.GetCanvas().PrepareDC(dc) | 32,118 |
def OnMoveMiddleControlPoint(self, dc, lpt, pt): lpt._xpos = pt[0] lpt._ypos = pt[1] | def OnMoveMiddleControlPoint(self, dc, lpt, pt): lpt._xpos = pt[0] lpt._ypos = pt[1] | 32,119 |
def debug(msg): if DEBUG: print msg | def debug(msg): if DEBUG: print msg | 32,120 |
def debug(msg): if DEBUG: print msg | def debug(msg): if DEBUG: print msg | 32,121 |
def GetTip(self): return "This is my tip" | def GetTip(self): return "This is my tip" | 32,122 |
def SetValue(self, value): if wx.USE_UNICODE: value = value.decode('iso8859_1') self.SetReadOnly(False) self.SetText(value) self.SetReadOnly(True) | def SetValue(self, value): if wx.USE_UNICODE: value = value.decode('iso8859_1') self.SetText(value) self.SetReadOnly(True) | 32,123 |
def SetValue(self, value): if wx.USE_UNICODE: value = value.decode('iso8859_1') self.SetReadOnly(False) self.SetText(value) self.SetReadOnly(True) | def SetValue(self, value): if wx.USE_UNICODE: value = value.decode('iso8859_1') self.SetReadOnly(False) self.SetText(value) self.SetReadOnly(True) | 32,124 |
def ShowPosition(self, pos): self.GotoPos(pos) | def ShowPosition(self, pos): self.GotoPos(pos) | 32,125 |
def SetUpEditor(self): """ This method carries out the work of setting up the demo editor. It's seperate so as not to clutter up the init code. """ import keyword self.SetLexer(stc.STC_LEX_PYTHON) self.SetKeyWords(0, " ".join(keyword.kwlist)) | def SetUpEditor(self): """ This method carries out the work of setting up the demo editor. It's seperate so as not to clutter up the init code. """ import keyword self.SetLexer(stc.STC_LEX_PYTHON) self.SetKeyWords(0, " ".join(keyword.kwlist)) | 32,126 |
def opj(path): """Convert paths to the platform-specific separator""" return apply(os.path.join, tuple(path.split('/'))) | def opj(path): """Convert paths to the platform-specific separator""" str = apply(os.path.join, tuple(path.split('/'))) if path.startswith('/'): str = '/' + str return str def GetModifiedDirectory(): """ Returns the directory where modified versions of the demo files are stored """ return opj(wx.GetHomeDir() + "/.wx... | 32,127 |
def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | 32,128 |
def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | 32,129 |
def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | 32,130 |
def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) | 32,131 |
def EmptyHandler(evt): pass | def EmptyHandler(evt): pass | 32,132 |
def EmptyHandler(evt): pass | defEmptyHandler(evt):pass | 32,133 |
def EmptyHandler(evt): pass | def EmptyHandler(evt): pass | 32,134 |
def OnOvrSize(evt, ovr=self.ovr): ovr.SetSize(evt.GetSize()) | defOnOvrSize(evt,ovr=self.ovr):ovr.SetSize(evt.GetSize()) | 32,135 |
def OnOvrSize(evt, ovr=self.ovr): ovr.SetSize(evt.GetSize()) | def OnOvrSize(evt, ovr=self.ovr): ovr.SetSize(evt.GetSize()) | 32,136 |
def OnOvrSize(evt, ovr=self.ovr): ovr.SetSize(evt.GetSize()) | def OnOvrSize(evt, ovr=self.ovr): ovr.SetSize(evt.GetSize()) | 32,137 |
def OnOvrSize(evt, ovr=self.ovr): ovr.SetSize(evt.GetSize()) | defOnOvrSize(evt,ovr=self.ovr):ovr.SetSize(evt.GetSize()) | 32,138 |
def SplitterOnSize(evt): splitter = evt.GetEventObject() sz = splitter.GetSize() splitter.SetSashPosition(sz.height - 120, False) evt.Skip() | def SplitterOnSize(evt): splitter = evt.GetEventObject() sz = splitter.GetSize() splitter.SetSashPosition(sz.height - 160, False) evt.Skip() | 32,139 |
def SplitterOnSize(evt): splitter = evt.GetEventObject() sz = splitter.GetSize() splitter.SetSashPosition(sz.height - 120, False) evt.Skip() | defSplitterOnSize(evt):splitter=evt.GetEventObject()sz=splitter.GetSize()splitter.SetSashPosition(sz.height-120,False)evt.Skip() | 32,140 |
def SplitterOnSize(evt): splitter = evt.GetEventObject() sz = splitter.GetSize() splitter.SetSashPosition(sz.height - 120, False) evt.Skip() | def SplitterOnSize(evt): splitter = evt.GetEventObject() sz = splitter.GetSize() splitter.SetSashPosition(sz.height - 120, False) evt.Skip() | 32,141 |
def SplitterOnSize(evt): splitter = evt.GetEventObject() sz = splitter.GetSize() splitter.SetSashPosition(sz.height - 120, False) evt.Skip() | def SplitterOnSize(evt): splitter = evt.GetEventObject() sz = splitter.GetSize() splitter.SetSashPosition(sz.height - 120, False) evt.Skip() | 32,142 |
def WriteText(self, text): if text[-1:] == '\n': text = text[:-1] wx.LogMessage(text) | defWriteText(self,text):iftext[-1:]=='\n':text=text[:-1]wx.LogMessage(text) | 32,143 |
def OnSelChanged(self, event): if self.dying: return | def OnSelChanged(self, event): if self.dying or not self.loaded: return | 32,144 |
def OnSelChanged(self, event): if self.dying: return | def OnSelChanged(self, event): if self.dying: return | 32,145 |
def RunDemo(self, itemText): os.chdir(self.cwd) if self.nb.GetPageCount() == 3: if self.nb.GetSelection() == 2: self.nb.SetSelection(0) # inform the window that it's time to quit if it cares if self.window is not None: if hasattr(self.window, "ShutdownDemo"): self.window.ShutdownDemo() wx.SafeYield() # in case the page... | def RunDemo(self, itemText): os.chdir(self.cwd) if self.nb.GetPageCount() == 3: if self.nb.GetSelection() == 2: self.nb.SetSelection(0) # inform the window that it's time to quit if it cares if self.window is not None: if hasattr(self.window, "ShutdownDemo"): self.window.ShutdownDemo() wx.SafeYield() # in case the page... | 32,146 |
def RunDemo(self, itemText): os.chdir(self.cwd) if self.nb.GetPageCount() == 3: if self.nb.GetSelection() == 2: self.nb.SetSelection(0) # inform the window that it's time to quit if it cares if self.window is not None: if hasattr(self.window, "ShutdownDemo"): self.window.ShutdownDemo() wx.SafeYield() # in case the page... | def RunDemo(self, itemText): os.chdir(self.cwd) if self.nb.GetPageCount() == 3: if self.nb.GetSelection() == 2: self.nb.SetSelection(0) # inform the window that it's time to quit if it cares if self.window is not None: if hasattr(self.window, "ShutdownDemo"): self.window.ShutdownDemo() wx.SafeYield() # in case the page... | 32,147 |
def OnToggleRedirect(self, event): app = wx.GetApp() if event.Checked(): app.RedirectStdio() print "Print statements and other standard output will now be directed to this window." else: app.RestoreStdio() print "Print statements and other standard output will now be sent to the usual location." | def OnToggleRedirect(self, event): app = wx.GetApp() if event.Checked(): app.RedirectStdio() print "Print statements and other standard output will now be directed to this window." else: app.RestoreStdio() print "Print statements and other standard output will now be sent to the usual location." | 32,148 |
def OnFind(self, event): self.nb.SetSelection(1) end = self.txt.GetLastPosition() textstring = self.txt.GetRange(0, end).lower() start = self.txt.GetSelection()[1] findstring = self.finddata.GetFindString().lower() loc = textstring.find(findstring, start) if loc == -1 and start != 0: # string not found, start at beginn... | def OnFind(self, event): self.nb.SetSelection(1) end = editor.GetLastPosition() textstring = editor.GetRange(0, end).lower() start = editor.GetSelection()[1] findstring = self.finddata.GetFindString().lower() loc = textstring.find(findstring, start) if loc == -1 and start != 0: # string not found, start at beginning st... | 32,149 |
def OnFind(self, event): self.nb.SetSelection(1) end = self.txt.GetLastPosition() textstring = self.txt.GetRange(0, end).lower() start = self.txt.GetSelection()[1] findstring = self.finddata.GetFindString().lower() loc = textstring.find(findstring, start) if loc == -1 and start != 0: # string not found, start at beginn... | def OnFind(self, event): self.nb.SetSelection(1) end = self.txt.GetLastPosition() textstring = self.txt.GetRange(0, end).lower() start = self.txt.GetSelection()[1] findstring = self.finddata.GetFindString().lower() loc = textstring.find(findstring, start) if loc == -1 and start != 0: # string not found, start at beginn... | 32,150 |
def OnCloseWindow(self, event): self.dying = True self.window = None self.mainmenu = None self.Destroy() | def OnCloseWindow(self, event): self.dying = True self.demoPage = None self.codePage = None self.mainmenu = None self.Destroy() | 32,151 |
def OnIdle(self, event): if self.otherWin: self.otherWin.Raise() self.window = self.otherWin self.otherWin = None | def OnIdle(self, event): if self.otherWin: self.otherWin.Raise() self.demoPage = self.otherWin self.otherWin = None | 32,152 |
def OnIconfiy(self, evt): wx.LogMessage("OnIconfiy") evt.Skip() | def OnIconfiy(self, evt): wx.LogMessage("OnIconfiy: %d" % evt.Iconized()) evt.Skip() | 32,153 |
def OnClose(self, evt): self.Hide() frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)") frame.Show() evt.Skip() # Make sure the default handler runs too... | def OnClose(self, evt): self.Hide() frame = wxPythonDemo(None, "wxPython: (A Demonstration)") frame.Show() evt.Skip() # Make sure the default handler runs too... | 32,154 |
def main(): try: demoPath = os.path.dirname(__file__) os.chdir(demoPath) except: pass app = MyApp(0) ##wx.Platform == "__WXMAC__") app.MainLoop() | defmain():try:demoPath=os.path.dirname(__file__)os.chdir(demoPath)except:passapp=MyApp(0)##wx.Platform=="__WXMAC__")app.MainLoop() | 32,155 |
def main(): try: demoPath = os.path.dirname(__file__) os.chdir(demoPath) except: pass app = MyApp(0) ##wx.Platform == "__WXMAC__") app.MainLoop() | def main(): try: demoPath = os.path.dirname(__file__) os.chdir(demoPath) except: pass app = MyApp(0) ##wx.Platform == "__WXMAC__") app.MainLoop() | 32,156 |
def __init__(self, parent, log): self.log = log wxScrolledWindow.__init__(self, parent, -1, style = wxTAB_TRAVERSAL) | def __init__(self, parent, log): self.log = log wxScrolledWindow.__init__(self, parent, -1, style = wxTAB_TRAVERSAL) | 32,157 |
def HasPendingMessages(self, *_args, **_kwargs): val = apply(misc2c.wxLog_HasPendingMessages,(self,) + _args, _kwargs) return val | def HasPendingMessages(self, *_args, **_kwargs): val = apply(misc2c.wxLog_HasPendingMessages,(self,) + _args, _kwargs) return val | 32,158 |
def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | 32,159 |
def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | 32,160 |
def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | 32,161 |
def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | def OnAddDirToProject(self, event): frame = wx.Dialog(None, -1, _("Add All Files from Directory to Project"), size= (320,200)) borderSizer = wx.BoxSizer(wx.HORIZONTAL) | 32,162 |
def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | 32,163 |
def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | 32,164 |
def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | 32,165 |
def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | 32,166 |
def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd() | 32,167 |
def _GetFileItem(self, shortFileName = None, longFileName = None): """ Returns the tree item for a file given the short (display) or long (fullpath) file name. """ rootItem = self._treeCtrl.GetRootItem() (project, cookie) = self._treeCtrl.GetFirstChild(rootItem) while project.IsOk(): (child, cookie2) = self._treeCtrl.... | def _GetFileItem(self, shortFileName = None, longFileName = None): """ Returns the tree item for a file given the short (display) or long (fullpath) file name. """ rootItem = self._treeCtrl.GetRootItem() (project, cookie) = self._treeCtrl.GetFirstChild(rootItem) while project.IsOk(): (child, cookie2) = self._treeCtrl.... | 32,168 |
def SetHandWeights(self, h=None, m=None, s=None): if h: self.SetHandSize(h, HOUR) if m: self.SetHandSize(m, MINUTE) if s: self.SetHandSize(h, SECOND) | def SetHandWeights(self, h=None, m=None, s=None): if h: self.SetHandSize(h, HOUR) if m: self.SetHandSize(m, MINUTE) if s: self.SetHandSize(h, SECOND) | 32,169 |
def SetHandColours(self, h=None, m=None, s=None): if h and not m and not s: m=h s=h if h: self.SetHandBorderColour(h, HOUR) self.SetHandFillColour(h, HOUR) if m: self.SetHandBorderColour(m, MINUTE) self.SetHandFillColour(m, MINUTE) if s: self.SetHandBorderColour(h, SECOND) self.SetHandFillColour(h, SECOND) | def SetHandColours(self, h=None, m=None, s=None): if h and not m and not s: m=h s=h if h: self.SetHandBorderColour(h, HOUR) self.SetHandFillColour(h, HOUR) if m: self.SetHandBorderColour(m, MINUTE) self.SetHandFillColour(m, MINUTE) if s: self.SetHandBorderColour(h, SECOND) self.SetHandFillColour(h, SECOND) | 32,170 |
def SetTickSizes(self, h=None, m=None): if h: self.SetTickSize(h, HOUR) if m: self.SetTickSize(h, MINUTE) | def SetTickSizes(self, h=None, m=None): if h: self.SetTickSize(h, HOUR) if m: self.SetTickSize(h, MINUTE) | 32,171 |
def SetTickFontss(self, h=None, m=None): if h: self.SetTickFont(h, HOUR) if m: self.SetTickFont(h, MINUTE) | def SetTickFontss(self, h=None, m=None): if h: self.SetTickFont(h, HOUR) if m: self.SetTickFont(h, MINUTE) | 32,172 |
def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) | def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) | 32,173 |
def setUp(self): GetAttributeTestCase.setUp(self) import PyCrust spam = Spam() self.f = open('test_introspect.py') self.items = ( None, int(123), long(123), float(123), complex(123), "", unicode(""), [], (), xrange(0), {}, # Builtin function. len, # Builtin method. [].append, # User function. ham, # Byte-compiled code.... | def setUp(self): GetAttributeTestCase.setUp(self) from wx import py spam = Spam() self.f = open('test_introspect.py') self.items = ( None, int(123), long(123), float(123), complex(123), "", unicode(""), [], (), xrange(0), {}, # Builtin function. len, # Builtin method. [].append, # User function. ham, # Byte-compiled co... | 32,174 |
def setUp(self): GetAttributeTestCase.setUp(self) import PyCrust spam = Spam() self.f = open('test_introspect.py') self.items = ( None, int(123), long(123), float(123), complex(123), "", unicode(""), [], (), xrange(0), {}, # Builtin function. len, # Builtin method. [].append, # User function. ham, # Byte-compiled code.... | def setUp(self): GetAttributeTestCase.setUp(self) import PyCrust spam = Spam() self.f = open('test_introspect.py') self.items = ( None, int(123), long(123), float(123), complex(123), "", unicode(""), [], (), xrange(0), {}, # Builtin function. len, # Builtin method. [].append, # User function. ham, # Byte-compiled code.... | 32,175 |
def __init__(self, parent, log): gridlib.Grid.__init__(self, parent, -1) ##mixins.GridAutoEditMixin.__init__(self) self.log = log self.moveTo = None | def __init__(self, parent, log): gridlib.Grid.__init__(self, parent, -1) ##mixins.GridAutoEditMixin.__init__(self) self.log = log self.moveTo = None | 32,176 |
def InsertLineControlPoint(self, dc = None): """Insert a control point at an arbitrary position.""" if dc: self.Erase(dc) | def InsertLineControlPoint(self, dc = None, point = None): """Insert a control point at an optional given position.""" if dc: self.Erase(dc) | 32,177 |
def InsertLineControlPoint(self, dc = None): """Insert a control point at an arbitrary position.""" if dc: self.Erase(dc) | def InsertLineControlPoint(self, dc = None): """Insert a control point at an arbitrary position.""" if dc: self.Erase(dc) | 32,178 |
def OnRightUp(self, evt): pos = evt.GetPosition() item, flags, col = self.tree.HitTest(pos) if item: print flags, col, self.tree.GetItemText(item, col) | def OnRightUp(self, evt): pos = evt.GetPosition() item, flags, col = self.tree.HitTest(pos) if item: print flags, col, self.tree.GetItemText(item, col) | 32,179 |
def Open(self, path): if not os.path.exists(path): wxLogError('File does not exists: %s' % path) return False # Try to read the file try: f = open(path) self.Clear() dom = minidom.parse(f) f.close() # Set encoding global variable g.currentEncoding = dom.encoding # Change dir dir = os.path.dirname(path) if dir: os.chdir... | def Open(self, path): if not os.path.exists(path): wxLogError('File does not exists: %s' % path) return False # Try to read the file try: f = open(path) self.Clear() dom = minidom.parse(f) f.close() # Set encoding global variable if dom.encoding: g.currentEncoding = dom.encoding # Change dir dir = os.path.dirname(path)... | 32,180 |
def OnInit(self): global debug # Process comand-line try: opts = args = None opts, args = getopt.getopt(sys.argv[1:], 'dhiv') for o,a in opts: if o == '-h': usage() sys.exit(0) elif o == '-d': debug = True elif o == '-v': print 'XRCed version', version sys.exit(0) except getopt.GetoptError: if wxPlatform != '__WXMAC__... | def OnInit(self): global debug # Process comand-line try: opts = args = None opts, args = getopt.getopt(sys.argv[1:], 'dhiv') for o,a in opts: if o == '-h': usage() sys.exit(0) elif o == '-d': debug = True elif o == '-v': print 'XRCed version', version sys.exit(0) except getopt.GetoptError: if wxPlatform != '__WXMAC__... | 32,181 |
def runTest(frame, nb, log): # This creates some pens and brushes that the OGL library uses. # It should be called after the app object has been created, but # before OGL is used. ogl.OGLInitialize() win = TestWindow(nb, log, frame) return win | def runTest(frame, nb, log): # This creates some pens and brushes that the OGL library uses. # It should be called after the app object has been created, but # before OGL is used. ogl.OGLInitialize() win = TestWindow(nb, log, frame) return win | 32,182 |
def __init__(self, name, expr, engine): if not '/' in expr: raise KeyError('Use `iface/key` for defining the provider.') | def __call__(self, econtext): expr = super(TALESProviderExpression, self).__call__(econtext) if not '/' in expr: raise KeyError('Use `iface/key` for defining the provider.') | 32,183 |
def __init__(self, name, expr, engine): if not '/' in expr: raise KeyError('Use `iface/key` for defining the provider.') | def __init__(self, name, expr, engine): if not '/' in expr: raise KeyError('Use `iface/key` for defining the provider.') | 32,184 |
def __call__(self, econtext): context = econtext.vars['context'] request = econtext.vars['request'] view = econtext.vars['view'] | context = econtext.vars['context'] request = econtext.vars['request'] view = econtext.vars['view'] | 32,185 |
def getRegion(str): """Get a region from the string. This function will create the dummy region implementation as well. """ region = zope.component.queryUtility(interfaces.IRegion, name=str) if region is None: raise interfaces.ViewletRegionLookupError( 'Viewlet region interface not found.', str) return region | def getRegion(str): """Get a region from the string. This function will create the dummy region implementation as well. """ region = zope.component.queryUtility(interfaces.IRegion, name=str) if region is None: raise interfaces.ViewletRegionLookupError( 'Provider region interface not found.', str) return region | 32,186 |
def __init__(self, name, expr, engine): if not '/' in expr: raise KeyError('Use `iface/viewletname` for defining the viewlet.') | def __init__(self, name, expr, engine): if not '/' in expr: raise KeyError('Use `iface/viewletname` for defining the viewlet.') | 32,187 |
def __call__(self, econtext): context = econtext.vars['context'] request = econtext.vars['request'] view = econtext.vars['view'] | def __call__(self, econtext): context = econtext.vars['context'] request = econtext.vars['request'] view = econtext.vars['view'] | 32,188 |
def buildStaticLibrary(sourceFiles, libName, libDir, compiler): '''Build libraries to be linked to simuPOP modules''' # get a c compiler comp = new_compiler(compiler=compiler, verbose=True, output_dir='build') objFiles = comp.compile(sourceFiles, include_dirs=['.']) comp.create_static_lib(objFiles, libName, libDir) | def buildStaticLibrary(sourceFiles, libName, libDir, compiler): '''Build libraries to be linked to simuPOP modules''' # get a c compiler print 'Creating library', libName comp = new_compiler(compiler=compiler, verbose=True) objFiles = comp.compile(sourceFiles, include_dirs=['.']) comp.create_static_lib(objFiles, libNam... | 32,189 |
def ModuInfo(modu, SIMUPOP_VER='9.9.9', SIMUPOP_REV='9999'): res = {} res['src'] = ['src/simuPOP_' + modu + '_wrap.cpp'] for src in SOURCE_FILES: res['src'].append(src[:-4] + '_' + modu + '.cpp') res['src'].extend(GSL_FILES) res['libraries'] = boost_lib_names # lib if os.name == 'nt': # Windows res['libraries'].app... | def ModuInfo(modu, SIMUPOP_VER='9.9.9', SIMUPOP_REV='9999'): res = {} res['src'] = ['src/simuPOP_' + modu + '_wrap.cpp'] for src in SOURCE_FILES: res['src'].append(src[:-4] + '_' + modu + '.cpp') res['src'].extend(GSL_FILES) res['libraries'] = [x for x in boost_lib_names] # lib if os.name == 'nt': # Windows res['l... | 32,190 |
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' r.postscript(file=epsFile) r.par(mfrow=[2,1]) # return max LD res = [] # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.... | def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' # return max LD res = [] # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.append(pop.locusDist(ld[0])) else: dist.append... | 32,191 |
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' r.postscript(file=epsFile) r.par(mfrow=[2,1]) # return max LD res = [] # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.... | def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' r.postscript(file=epsFile) r.par(mfrow=[2,1]) # return max LD res = [] # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.... | 32,192 |
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' r.postscript(file=epsFile) r.par(mfrow=[2,1]) # return max LD res = [] # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.... | def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' r.postscript(file=epsFile) r.par(mfrow=[2,1]) # return max LD res = [] # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.... | 32,193 |
def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | 32,194 |
def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | 32,195 |
def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | 32,196 |
def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | defprocessOnePopulation(dataDir,numChrom,numLoci,markerType,DSLafter,DSLdist,initSize,meanInitAllele,burnin,introGen,minAlleleFreq,maxAlleleFreq,fitness,mlSelModel,numSubPop,finalSize,noMigrGen,mixingGen,popSizeFunc,migrModel,mu,mi,rec,dryrun,popIdx):'''thisfunctionorganizeallpreviousfunctionsand1.generate(orload)apopu... | 32,197 |
def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, popIdx): ''' this function organize all previous fun... | defresult.append(res) processOnePopulation(dataDir,result.append(res) numChrom,result.append(res) numLoci,result.append(res) markerType,result.append(res) DSLafter,result.append(res) DSLdist,result.append(res) initSize,result.append(res) meanInitAllele,result.append(res) burnin,result.append(res) introGen,result.append... | 32,198 |
def writeReport(content, allParam, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise exceptions.IOError("Can not open a summary file : " + ou... | def writeReport(content, allParam, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise exceptions.IOError("Can not open a summary file : " + ou... | 32,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.