rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
return self.tk.call(self._w, 'info', 'active') | return self.tk.call(self._w, 'info', 'active') | def info_active(self): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'info', 'anchor') | return self.tk.call(self._w, 'info', 'anchor') | def info_anchor(self): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'info', 'down', index) | return self.tk.call(self._w, 'info', 'down', index) | def info_down(self, index): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'info', 'left', index) | return self.tk.call(self._w, 'info', 'left', index) | def info_left(self, index): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'info', 'right', index) | return self.tk.call(self._w, 'info', 'right', index) | def info_right(self, index): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
c = self.tk.call(self._w, 'info', 'selection') return self.tk.splitlist(c) | c = self.tk.call(self._w, 'info', 'selection') return self.tk.splitlist(c) | def info_selection(self): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'info', 'size') | return self.tk.call(self._w, 'info', 'size') | def info_size(self): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'info', 'up', index) | return self.tk.call(self._w, 'info', 'up', index) | def info_up(self, index): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'nearest', x, y) | return self.tk.call(self._w, 'nearest', x, y) | def nearest(self, x, y): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
self.tk.call(self._w, 'see', index) | self.tk.call(self._w, 'see', index) | def see(self, index): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
apply(self.tk.call, (self._w, 'selection', 'clear') + self._options(cnf, kw)) | apply(self.tk.call, (self._w, 'selection', 'clear') + self._options(cnf, kw)) | def selection_clear(self, cnf={}, **kw): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'selection', 'includes', index) | return self.tk.call(self._w, 'selection', 'includes', index) | def selection_includes(self, index): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
self.tk.call(self._w, 'selection', 'set', first, last) | self.tk.call(self._w, 'selection', 'set', first, last) | def selection_set(self, first, last=None): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
apply(self.tk.call, (self._w, 'xview') + args) | apply(self.tk.call, (self._w, 'xview') + args) | def xview(self, *args): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
apply(self.tk.call, (self._w, 'yview') + args) | apply(self.tk.call, (self._w, 'yview') + args) | def yview(self, *args): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixWidget.__init__(self, master, 'tixTree', ['options'], cnf, kw) self.subwidget_list['hlist'] = _dummyHList(self, 'hlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') | TixWidget.__init__(self, master, 'tixTree', ['options'], cnf, kw) self.subwidget_list['hlist'] = _dummyHList(self, 'hlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') | def __init__(self, master=None, cnf={}, **kw): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
self.tk.call(self._w, 'autosetmode') | self.tk.call(self._w, 'autosetmode') | def autosetmode(self): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
self.tk.call(self._w, 'close', entrypath) | self.tk.call(self._w, 'close', entrypath) | def close(self, entrypath): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
return self.tk.call(self._w, 'getmode', entrypath) | return self.tk.call(self._w, 'getmode', entrypath) | def getmode(self, entrypath): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
self.tk.call(self._w, 'open', entrypath) | self.tk.call(self._w, 'open', entrypath) | def open(self, entrypath): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
self.tk.call(self._w, 'setmode', entrypath, mode) | self.tk.call(self._w, 'setmode', entrypath, mode) | def setmode(self, entrypath, mode='none'): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') | TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['entry'] = _dummyEntry(self, 'entry') self.subwidget_list['arrow'] = _dummyButton(self, 'arrow') self.subwidget_list['slistbox'] = _dummyScrolledListBox(self, 'slistbox') self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox', destroy_physically=0) | TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['entry'] = _dummyEntry(self, 'entry') self.subwidget_list['arrow'] = _dummyButton(self, 'arrow') self.subwidget_list['slistbox'] = _dummyScrolledListBox(self, 'slistbox') self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox', destroy_physically=0) | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['hlist'] = _dummyHList(self, 'hlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') | TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['hlist'] = _dummyHList(self, 'hlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['cancel'] = _dummyButton(self, 'cancel') self.subwidget_list['ok'] = _dummyButton(self, 'ok') self.subwidget_list['hidden'] = _dummyCheckbutton(self, 'hidden') self.subwidget_list['types'] = _dummyComboBox(self, 'types') self.subwidget_list['dir'] = _dummyComboBox(self, 'dir') self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist') self.subwidget_list['file'] = _dummyComboBox(self, 'file') self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist') | TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['cancel'] = _dummyButton(self, 'cancel') self.subwidget_list['ok'] = _dummyButton(self, 'ok') self.subwidget_list['hidden'] = _dummyCheckbutton(self, 'hidden') self.subwidget_list['types'] = _dummyComboBox(self, 'types') self.subwidget_list['dir'] = _dummyComboBox(self, 'dir') self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist') self.subwidget_list['file'] = _dummyComboBox(self, 'file') self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist') | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist') self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist') self.subwidget_list['filter'] = _dummyComboBox(self, 'filter') self.subwidget_list['selection'] = _dummyComboBox(self, 'selection') | TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist') self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist') self.subwidget_list['filter'] = _dummyComboBox(self, 'filter') self.subwidget_list['selection'] = _dummyComboBox(self, 'selection') | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['ok'] = _dummyButton(self, 'ok') self.subwidget_list['apply'] = _dummyButton(self, 'apply') self.subwidget_list['cancel'] = _dummyButton(self, 'cancel') self.subwidget_list['help'] = _dummyButton(self, 'help') | TixSubWidget.__init__(self, master, name, destroy_physically) self.subwidget_list['ok'] = _dummyButton(self, 'ok') self.subwidget_list['apply'] = _dummyButton(self, 'apply') self.subwidget_list['cancel'] = _dummyButton(self, 'cancel') self.subwidget_list['help'] = _dummyButton(self, 'help') | def __init__(self, master, name, destroy_physically=1): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=0): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py |
#ifdef WITHOUT_FRAMEWORKS | e55beefed89f21985b3791f4a2a253ba7da508e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e55beefed89f21985b3791f4a2a253ba7da508e9/filesupport.py |
||
if ( PyString_Check(args) ) { OSStatus err; | if ( PyString_Check(v) ) { | #ifdef WITHOUT_FRAMEWORKS | e55beefed89f21985b3791f4a2a253ba7da508e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e55beefed89f21985b3791f4a2a253ba7da508e9/filesupport.py |
PyErr_Mac(ErrorObject, err); | PyMac_Error(err); | #ifdef WITHOUT_FRAMEWORKS | e55beefed89f21985b3791f4a2a253ba7da508e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e55beefed89f21985b3791f4a2a253ba7da508e9/filesupport.py |
if (FSpMakeFSRef(&((FSSpecObject *)v)->ob_itself, fsr)) | if ((err=FSpMakeFSRef(&((FSSpecObject *)v)->ob_itself, fsr)) == 0) | #ifdef WITHOUT_FRAMEWORKS | e55beefed89f21985b3791f4a2a253ba7da508e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e55beefed89f21985b3791f4a2a253ba7da508e9/filesupport.py |
getsetlist = [ ("data", """int size; PyObject *rv; size = GetHandleSize((Handle)self->ob_itself); HLock((Handle)self->ob_itself); rv = PyString_FromStringAndSize(*(Handle)self->ob_itself, size); HUnlock((Handle)self->ob_itself); return rv; """, None, "Raw data of the alias object" ) ] | def output_tp_initBody(self): Output("PyObject *v;") Output("char *kw[] = {\"itself\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(args, kwds, \"O\", kw, &v))") Output("return -1;") Output("if (myPyMac_GetFSRef(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) Output("return -1;") | e55beefed89f21985b3791f4a2a253ba7da508e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e55beefed89f21985b3791f4a2a253ba7da508e9/filesupport.py |
|
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff) | module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff, longname=LONGMODNAME) | def parseArgumentList(self, args): args0, arg1, argsrest = args[:1], args[1], args[2:] t0, n0, m0 = arg1 args = args0 + argsrest if m0 != InMode: raise ValueError, "method's 'self' must be 'InMode'" self.itself = Variable(t0, "_self->ob_itself", SelfMode) FunctionGenerator.parseArgumentList(self, args) self.argumentList.insert(2, self.itself) | e55beefed89f21985b3791f4a2a253ba7da508e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e55beefed89f21985b3791f4a2a253ba7da508e9/filesupport.py |
except TypeError: | except (AttributeError, TypeError): | def softspace(file, newvalue): oldvalue = 0 try: oldvalue = file.softspace except AttributeError: pass try: file.softspace = newvalue except TypeError: # "attribute-less object" or "read-only attributes" pass return oldvalue | 555d12f986bbf422a98e9083fae266f5ec3550a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/555d12f986bbf422a98e9083fae266f5ec3550a7/code.py |
return pos, (val) | return (pos, len(val)) | def _setval(self, pos, val): f = _open(self._datfile, 'rb+') f.seek(pos) f.write(val) f.close() return pos, (val) | ba426640ddeba29877ce9ebd750864aef7faeef9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba426640ddeba29877ce9ebd750864aef7faeef9/dumbdbm.py |
def AskPassword(prompt, default='', id=264): | def AskPassword(prompt, default='', id=264, ok=None, cancel=None): | def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty. The PROMPT and DEFAULT strings, as well as the return value, can be at most 255 characters long. """ d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return h = d.GetDialogItemAsControl(3) # STATIC TEXT ITEM <= prompt SetDialogItemText(h, lf2cr(prompt)) h = d.GetDialogItemAsControl(4) # EDIT TEXT ITEM bullets = '\245'*len(default) SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999) d.SetDialogDefaultItem(Dialogs.ok) d.SetDialogCancelItem(Dialogs.cancel) string = default oldschedparams = MacOS.SchedParams(0,0) while 1: ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) # for blinking caret elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue # don't do cut & paste commands else: if charcode == Events.kReturnCharCode: break elif charcode == Events.kEscapeCharCode: string = None break elif charcode in (Events.kLeftArrowCharCode, Events.kBackspaceCharCode): string = string[:-1] else: string = string + chr(charcode) msg = 0245 # Octal code for bullet ev = (what,msg,when,where,mod) rs, win, item = Dlg.DialogSelect(ev) if item == Dialogs.ok : break elif item == Dialogs.cancel : string = None break elif what == Events.mouseDown: part, win = Win.FindWindow(where) if part == Windows.inDrag and win: win.DragWindow(where, screenbounds) elif part == Windows.inMenuBar: MacOS.HandleEvent(ev) else: MacOS.SysBeep() # Cannot handle selections, unfortunately elif what == Events.updateEvt: MacOS.HandleEvent(ev) apply(MacOS.SchedParams, oldschedparams) return string | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
h = d.GetDialogItemAsControl(3) | h = d.GetDialogItemAsControl(3) | def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty. The PROMPT and DEFAULT strings, as well as the return value, can be at most 255 characters long. """ d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return h = d.GetDialogItemAsControl(3) # STATIC TEXT ITEM <= prompt SetDialogItemText(h, lf2cr(prompt)) h = d.GetDialogItemAsControl(4) # EDIT TEXT ITEM bullets = '\245'*len(default) SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999) d.SetDialogDefaultItem(Dialogs.ok) d.SetDialogCancelItem(Dialogs.cancel) string = default oldschedparams = MacOS.SchedParams(0,0) while 1: ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) # for blinking caret elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue # don't do cut & paste commands else: if charcode == Events.kReturnCharCode: break elif charcode == Events.kEscapeCharCode: string = None break elif charcode in (Events.kLeftArrowCharCode, Events.kBackspaceCharCode): string = string[:-1] else: string = string + chr(charcode) msg = 0245 # Octal code for bullet ev = (what,msg,when,where,mod) rs, win, item = Dlg.DialogSelect(ev) if item == Dialogs.ok : break elif item == Dialogs.cancel : string = None break elif what == Events.mouseDown: part, win = Win.FindWindow(where) if part == Windows.inDrag and win: win.DragWindow(where, screenbounds) elif part == Windows.inMenuBar: MacOS.HandleEvent(ev) else: MacOS.SysBeep() # Cannot handle selections, unfortunately elif what == Events.updateEvt: MacOS.HandleEvent(ev) apply(MacOS.SchedParams, oldschedparams) return string | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
h = d.GetDialogItemAsControl(4) | pwd = d.GetDialogItemAsControl(4) | def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty. The PROMPT and DEFAULT strings, as well as the return value, can be at most 255 characters long. """ d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return h = d.GetDialogItemAsControl(3) # STATIC TEXT ITEM <= prompt SetDialogItemText(h, lf2cr(prompt)) h = d.GetDialogItemAsControl(4) # EDIT TEXT ITEM bullets = '\245'*len(default) SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999) d.SetDialogDefaultItem(Dialogs.ok) d.SetDialogCancelItem(Dialogs.cancel) string = default oldschedparams = MacOS.SchedParams(0,0) while 1: ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) # for blinking caret elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue # don't do cut & paste commands else: if charcode == Events.kReturnCharCode: break elif charcode == Events.kEscapeCharCode: string = None break elif charcode in (Events.kLeftArrowCharCode, Events.kBackspaceCharCode): string = string[:-1] else: string = string + chr(charcode) msg = 0245 # Octal code for bullet ev = (what,msg,when,where,mod) rs, win, item = Dlg.DialogSelect(ev) if item == Dialogs.ok : break elif item == Dialogs.cancel : string = None break elif what == Events.mouseDown: part, win = Win.FindWindow(where) if part == Windows.inDrag and win: win.DragWindow(where, screenbounds) elif part == Windows.inMenuBar: MacOS.HandleEvent(ev) else: MacOS.SysBeep() # Cannot handle selections, unfortunately elif what == Events.updateEvt: MacOS.HandleEvent(ev) apply(MacOS.SchedParams, oldschedparams) return string | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999) | SetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag, default) d.SelectDialogItemText(4, 0, 999) Ctl.SetKeyboardFocus(d, pwd, kControlEditTextPart) if ok != None: h = d.GetDialogItemAsControl(1) h.SetControlTitle(ok) if cancel != None: h = d.GetDialogItemAsControl(2) h.SetControlTitle(cancel) | def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty. The PROMPT and DEFAULT strings, as well as the return value, can be at most 255 characters long. """ d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return h = d.GetDialogItemAsControl(3) # STATIC TEXT ITEM <= prompt SetDialogItemText(h, lf2cr(prompt)) h = d.GetDialogItemAsControl(4) # EDIT TEXT ITEM bullets = '\245'*len(default) SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999) d.SetDialogDefaultItem(Dialogs.ok) d.SetDialogCancelItem(Dialogs.cancel) string = default oldschedparams = MacOS.SchedParams(0,0) while 1: ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) # for blinking caret elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue # don't do cut & paste commands else: if charcode == Events.kReturnCharCode: break elif charcode == Events.kEscapeCharCode: string = None break elif charcode in (Events.kLeftArrowCharCode, Events.kBackspaceCharCode): string = string[:-1] else: string = string + chr(charcode) msg = 0245 # Octal code for bullet ev = (what,msg,when,where,mod) rs, win, item = Dlg.DialogSelect(ev) if item == Dialogs.ok : break elif item == Dialogs.cancel : string = None break elif what == Events.mouseDown: part, win = Win.FindWindow(where) if part == Windows.inDrag and win: win.DragWindow(where, screenbounds) elif part == Windows.inMenuBar: MacOS.HandleEvent(ev) else: MacOS.SysBeep() # Cannot handle selections, unfortunately elif what == Events.updateEvt: MacOS.HandleEvent(ev) apply(MacOS.SchedParams, oldschedparams) return string | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
string = default oldschedparams = MacOS.SchedParams(0,0) | def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty. The PROMPT and DEFAULT strings, as well as the return value, can be at most 255 characters long. """ d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return h = d.GetDialogItemAsControl(3) # STATIC TEXT ITEM <= prompt SetDialogItemText(h, lf2cr(prompt)) h = d.GetDialogItemAsControl(4) # EDIT TEXT ITEM bullets = '\245'*len(default) SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999) d.SetDialogDefaultItem(Dialogs.ok) d.SetDialogCancelItem(Dialogs.cancel) string = default oldschedparams = MacOS.SchedParams(0,0) while 1: ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) # for blinking caret elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue # don't do cut & paste commands else: if charcode == Events.kReturnCharCode: break elif charcode == Events.kEscapeCharCode: string = None break elif charcode in (Events.kLeftArrowCharCode, Events.kBackspaceCharCode): string = string[:-1] else: string = string + chr(charcode) msg = 0245 # Octal code for bullet ev = (what,msg,when,where,mod) rs, win, item = Dlg.DialogSelect(ev) if item == Dialogs.ok : break elif item == Dialogs.cancel : string = None break elif what == Events.mouseDown: part, win = Win.FindWindow(where) if part == Windows.inDrag and win: win.DragWindow(where, screenbounds) elif part == Windows.inMenuBar: MacOS.HandleEvent(ev) else: MacOS.SysBeep() # Cannot handle selections, unfortunately elif what == Events.updateEvt: MacOS.HandleEvent(ev) apply(MacOS.SchedParams, oldschedparams) return string | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
|
ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue else: if charcode == Events.kReturnCharCode: break elif charcode == Events.kEscapeCharCode: string = None break elif charcode in (Events.kLeftArrowCharCode, Events.kBackspaceCharCode): string = string[:-1] else: string = string + chr(charcode) msg = 0245 ev = (what,msg,when,where,mod) rs, win, item = Dlg.DialogSelect(ev) if item == Dialogs.ok : break elif item == Dialogs.cancel : string = None break elif what == Events.mouseDown: part, win = Win.FindWindow(where) if part == Windows.inDrag and win: win.DragWindow(where, screenbounds) elif part == Windows.inMenuBar: MacOS.HandleEvent(ev) else: MacOS.SysBeep() elif what == Events.updateEvt: MacOS.HandleEvent(ev) apply(MacOS.SchedParams, oldschedparams) return string | n = ModalDialog(None) if n == 1: h = d.GetDialogItemAsControl(4) return cr2lf(GetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag)) if n == 2: return None | def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty. The PROMPT and DEFAULT strings, as well as the return value, can be at most 255 characters long. """ d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return h = d.GetDialogItemAsControl(3) # STATIC TEXT ITEM <= prompt SetDialogItemText(h, lf2cr(prompt)) h = d.GetDialogItemAsControl(4) # EDIT TEXT ITEM bullets = '\245'*len(default) SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999) d.SetDialogDefaultItem(Dialogs.ok) d.SetDialogCancelItem(Dialogs.cancel) string = default oldschedparams = MacOS.SchedParams(0,0) while 1: ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) # for blinking caret elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue # don't do cut & paste commands else: if charcode == Events.kReturnCharCode: break elif charcode == Events.kEscapeCharCode: string = None break elif charcode in (Events.kLeftArrowCharCode, Events.kBackspaceCharCode): string = string[:-1] else: string = string + chr(charcode) msg = 0245 # Octal code for bullet ev = (what,msg,when,where,mod) rs, win, item = Dlg.DialogSelect(ev) if item == Dialogs.ok : break elif item == Dialogs.cancel : string = None break elif what == Events.mouseDown: part, win = Win.FindWindow(where) if part == Windows.inDrag and win: win.DragWindow(where, screenbounds) elif part == Windows.inMenuBar: MacOS.HandleEvent(ev) else: MacOS.SysBeep() # Cannot handle selections, unfortunately elif what == Events.updateEvt: MacOS.HandleEvent(ev) apply(MacOS.SchedParams, oldschedparams) return string | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
ok = AskYesNoCancel("Do you want to identify?", yes="Indentify", no="Don't identify") | ok = AskYesNoCancel("Do you want to identify?", yes="Identify", no="No") | def test(): import time Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") ok = AskYesNoCancel("Do you want to identify?", yes="Indentify", no="Don't identify") if ok > 0: s = AskString("Enter your first name", "Joe") Message("Thank you,\n%s" % `s`) text = ( "Working Hard...", "Hardly Working..." , "So far, so good!", "Keep on truckin'" ) bar = ProgressBar("Progress, progress...", 100) try: appsw = MacOS.SchedParams(1, 0) for i in range(100): bar.set(i) time.sleep(0.1) if i % 10 == 0: bar.label(text[(i/10) % 4]) bar.label("Done.") time.sleep(0.3) # give'em a chance to see the done. finally: del bar apply(MacOS.SchedParams, appsw) | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
Message("Thank you,\n%s" % `s`) | s2 = AskPassword("Okay %s, tell us your nickname"%s, s, cancel="None") if not s2: Message("%s has no secret nickname"%s) else: Message("Hello everybody!!\nThe secret nickname of %s is %s!!!"%(s, s2)) | def test(): import time Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") ok = AskYesNoCancel("Do you want to identify?", yes="Indentify", no="Don't identify") if ok > 0: s = AskString("Enter your first name", "Joe") Message("Thank you,\n%s" % `s`) text = ( "Working Hard...", "Hardly Working..." , "So far, so good!", "Keep on truckin'" ) bar = ProgressBar("Progress, progress...", 100) try: appsw = MacOS.SchedParams(1, 0) for i in range(100): bar.set(i) time.sleep(0.1) if i % 10 == 0: bar.label(text[(i/10) % 4]) bar.label("Done.") time.sleep(0.3) # give'em a chance to see the done. finally: del bar apply(MacOS.SchedParams, appsw) | 60429e055ef92d63347018d239c717d7cc65d174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/60429e055ef92d63347018d239c717d7cc65d174/EasyDialogs.py |
if not callback: callback = print_line | if not callable(callback): callback = print_line | def retrlines(self, cmd, callback = None): '''Retrieve data in line mode. The argument is a RETR or LIST command. The callback function (2nd argument) is called for each line, with trailing CRLF stripped. This creates a new port for you. print_line() is the default callback.''' if not callback: callback = print_line resp = self.sendcmd('TYPE A') conn = self.transfercmd(cmd) fp = conn.makefile('rb') while 1: line = fp.readline() if self.debugging > 2: print '*retr*', `line` if not line: break if line[-2:] == CRLF: line = line[:-2] elif line[-1:] == '\n': line = line[:-1] callback(line) fp.close() conn.close() return self.voidresp() | a8dd0941b8becfb48788b333ba2329953a5d90d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8dd0941b8becfb48788b333ba2329953a5d90d7/ftplib.py |
add_dir_to_list(self.compiler.library_dirs, sysconfig.get_config_var("LIBDIR")) add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) | if os.path.normpath(sys.prefix) != '/usr': add_dir_to_list(self.compiler.library_dirs, sysconfig.get_config_var("LIBDIR")) add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 90b8e4d40cc8ec3aed05d5bc6a5afc981e7ebc0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90b8e4d40cc8ec3aed05d5bc6a5afc981e7ebc0c/setup.py |
status = [] | status = [self.__class__.__module__+"."+self.__class__.__name__] | def __repr__ (self): try: status = [] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr: if type(self.addr) == types.TupleType: status.append ('%s:%d' % self.addr) else: status.append (self.addr) return '<%s %s at %x>' % (self.__class__.__name__, ' '.join (status), id (self)) except: pass | 106bdd3b805ddc8dc30145f4e460cb9eaf044707 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/106bdd3b805ddc8dc30145f4e460cb9eaf044707/asyncore.py |
return '<%s %s at %x>' % (self.__class__.__name__, ' '.join (status), id (self)) | return '<%s at % | def __repr__ (self): try: status = [] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr: if type(self.addr) == types.TupleType: status.append ('%s:%d' % self.addr) else: status.append (self.addr) return '<%s %s at %x>' % (self.__class__.__name__, ' '.join (status), id (self)) except: pass | 106bdd3b805ddc8dc30145f4e460cb9eaf044707 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/106bdd3b805ddc8dc30145f4e460cb9eaf044707/asyncore.py |
self.temp_files.append(prog) | def _link (self, body, headers, include_dirs, libraries, library_dirs, lang): (src, obj) = self._compile(body, headers, include_dirs, lang) prog = os.path.splitext(os.path.basename(src))[0] self.temp_files.append(prog) # XXX should be prog + exe_ext self.compiler.link_executable([obj], prog, libraries=libraries, library_dirs=library_dirs) return (src, obj, prog) | b1d60294372ca4fa444b43eca4200ecc854ff359 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b1d60294372ca4fa444b43eca4200ecc854ff359/config.py |
|
gl.RGBmode() gl.gconfig() | self.set_rgbmode() | def initcolormap(self): self.colormapinited = 1 self.color0 = None self.fixcolor0 = 0 if self.format in ('rgb', 'jpeg', 'compress'): self.set_rgbmode() gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return # This only works on an Entry-level Indigo from IRIX 4.0.5 if self.format == 'rgb8' and is_entry_indigo() and \ gl.gversion() == 'GL4DLG-4.0.': # Note trailing '.'! gl.RGBmode() gl.gconfig() gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() gl.pixmode(GL.PM_SIZE, 8) return self.set_cmode() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() gl.clear() if not self.quiet: sys.stderr.write(' Done.\n') | 2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f/VFile.py |
gl.mapcolor(index, r, g, b) | map.append(index, r, g, b) | def _initcmap(self): if self.format in ('mono', 'grey4') and self.mustunpack: convcolor = conv_grey else: convcolor = choose_conversion(self.format) maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE) if maxbits > 11: maxbits = 11 c0bits = self.c0bits c1bits = self.c1bits c2bits = self.c2bits if c0bits+c1bits+c2bits > maxbits: if self.fallback and c0bits < maxbits: # Cannot display frames in this mode, use grey self.skipchrom = 1 c1bits = c2bits = 0 convcolor = choose_conversion('grey') else: raise Error, 'Sorry, '+`maxbits`+ \ ' bits max on this machine' maxc0 = 1 << c0bits maxc1 = 1 << c1bits maxc2 = 1 << c2bits if self.offset == 0 and maxbits == 11: offset = 2048 else: offset = self.offset if maxbits <> 11: offset = offset & ((1<<maxbits)-1) self.color0 = None self.fixcolor0 = 0 for c0 in range(maxc0): c0v = c0/float(maxc0-1) for c1 in range(maxc1): if maxc1 == 1: c1v = 0 else: c1v = c1/float(maxc1-1) for c2 in range(maxc2): if maxc2 == 1: c2v = 0 else: c2v = c2/float(maxc2-1) index = offset + c0 + (c1<<c0bits) + \ (c2 << (c0bits+c1bits)) if index < MAXMAP: rv, gv, bv = \ convcolor(c0v, c1v, c2v) r, g, b = int(rv*255.0), \ int(gv*255.0), \ int(bv*255.0) gl.mapcolor(index, r, g, b) if self.color0 == None: self.color0 = \ index, r, g, b # Permanently make the first color index current gl.color(self.color0[0]) gl.gflush() # send the colormap changes to the X server | 2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2939a4cf1a86f3e9f0e09b8f34d2ee221f414e1f/VFile.py |
_write_data(writer, "<![CDATA[%s]]>" % self.data) | writer.write("<![CDATA[%s]]>" % self.data) | def writexml(self, writer, indent="", addindent="", newl=""): _write_data(writer, "<![CDATA[%s]]>" % self.data) | 548540429356ade1cbd8e4095d07151832b66ef0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/548540429356ade1cbd8e4095d07151832b66ef0/minidom.py |
initialcolor = None, | def __init__(self, master = None, initialcolor = None, databasefile = None, initfile = None, ignore = None, wantspec = None): self.__master = master self.__initialcolor = initialcolor self.__databasefile = databasefile self.__initfile = initfile or os.path.expanduser('~/.pynche') self.__ignore = ignore self.__pw = None self.__wantspec = wantspec | 2be858230a1253b773a7e0d004ac84fae785d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2be858230a1253b773a7e0d004ac84fae785d8b9/pyColorChooser.py |
|
self.__initialcolor = initialcolor | def __init__(self, master = None, initialcolor = None, databasefile = None, initfile = None, ignore = None, wantspec = None): self.__master = master self.__initialcolor = initialcolor self.__databasefile = databasefile self.__initfile = initfile or os.path.expanduser('~/.pynche') self.__ignore = ignore self.__pw = None self.__wantspec = wantspec | 2be858230a1253b773a7e0d004ac84fae785d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2be858230a1253b773a7e0d004ac84fae785d8b9/pyColorChooser.py |
|
def show(self): | def show(self, color=None): if not self.__master: from Tkinter import Tk self.__master = Tk() | def show(self): if not self.__pw: self.__pw, self.__sb = \ Main.build(master = self.__master, initialcolor = self.__initialcolor, initfile = self.__initfile, ignore = self.__ignore) Main.run(self.__pw, self.__sb) rgbtuple = self.__sb.current_rgb() self.__pw.withdraw() # check to see if the cancel button was pushed if self.__sb.canceled_p(): return None, None colordb = self.__sb.colordb() # try to return the color name from the database if there is an exact # match, otherwise use the "#rrggbb" spec. TBD: Forget about color # aliases for now, maybe later we should return these too. name = None if not self.__wantspec: try: name = colordb.find_byrgb(rgbtuple)[0] except ColorDB.BadColor: pass if name is None: name = ColorDB.triplet_to_rrggbb(rgbtuple) return rgbtuple, name | 2be858230a1253b773a7e0d004ac84fae785d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2be858230a1253b773a7e0d004ac84fae785d8b9/pyColorChooser.py |
initialcolor = self.__initialcolor, | def show(self): if not self.__pw: self.__pw, self.__sb = \ Main.build(master = self.__master, initialcolor = self.__initialcolor, initfile = self.__initfile, ignore = self.__ignore) Main.run(self.__pw, self.__sb) rgbtuple = self.__sb.current_rgb() self.__pw.withdraw() # check to see if the cancel button was pushed if self.__sb.canceled_p(): return None, None colordb = self.__sb.colordb() # try to return the color name from the database if there is an exact # match, otherwise use the "#rrggbb" spec. TBD: Forget about color # aliases for now, maybe later we should return these too. name = None if not self.__wantspec: try: name = colordb.find_byrgb(rgbtuple)[0] except ColorDB.BadColor: pass if name is None: name = ColorDB.triplet_to_rrggbb(rgbtuple) return rgbtuple, name | 2be858230a1253b773a7e0d004ac84fae785d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2be858230a1253b773a7e0d004ac84fae785d8b9/pyColorChooser.py |
|
colordb = self.__sb.colordb() | def show(self): if not self.__pw: self.__pw, self.__sb = \ Main.build(master = self.__master, initialcolor = self.__initialcolor, initfile = self.__initfile, ignore = self.__ignore) Main.run(self.__pw, self.__sb) rgbtuple = self.__sb.current_rgb() self.__pw.withdraw() # check to see if the cancel button was pushed if self.__sb.canceled_p(): return None, None colordb = self.__sb.colordb() # try to return the color name from the database if there is an exact # match, otherwise use the "#rrggbb" spec. TBD: Forget about color # aliases for now, maybe later we should return these too. name = None if not self.__wantspec: try: name = colordb.find_byrgb(rgbtuple)[0] except ColorDB.BadColor: pass if name is None: name = ColorDB.triplet_to_rrggbb(rgbtuple) return rgbtuple, name | 2be858230a1253b773a7e0d004ac84fae785d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2be858230a1253b773a7e0d004ac84fae785d8b9/pyColorChooser.py |
|
return apply(Chooser, (), options).show() | global _chooser if not _chooser: _chooser = apply(Chooser, (), options) return _chooser.show(color) | def askcolor(color = None, **options): """Ask for a color""" return apply(Chooser, (), options).show() | 2be858230a1253b773a7e0d004ac84fae785d8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2be858230a1253b773a7e0d004ac84fae785d8b9/pyColorChooser.py |
elif usage.startswith("usage: "): | elif usage.lower().startswith("usage: "): | def set_usage (self, usage): if usage is None: self.usage = "%prog [options]" elif usage is SUPPRESS_USAGE: self.usage = None elif usage.startswith("usage: "): # for backwards compatibility with Optik 1.3 and earlier self.usage = usage[7:] else: self.usage = usage | 56d7913baebe520015c4d25dd1a7469cfd918527 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/56d7913baebe520015c4d25dd1a7469cfd918527/optparse.py |
readermode=None): | readermode=None, usenetrc=True): | def __init__(self, host, port=NNTP_PORT, user=None, password=None, readermode=None): """Initialize an instance. Arguments: - host: hostname to connect to - port: port to connect to (default the standard NNTP port) - user: username to authenticate with - password: password to use with username - readermode: if true, send 'mode reader' command after connecting. | 9513e34ac405344e1ae78b14cb65e02f7b57a6f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9513e34ac405344e1ae78b14cb65e02f7b57a6f5/nntplib.py |
if not user: | if usenetrc and not user: | def __init__(self, host, port=NNTP_PORT, user=None, password=None, readermode=None): """Initialize an instance. Arguments: - host: hostname to connect to - port: port to connect to (default the standard NNTP port) - user: username to authenticate with - password: password to use with username - readermode: if true, send 'mode reader' command after connecting. | 9513e34ac405344e1ae78b14cb65e02f7b57a6f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9513e34ac405344e1ae78b14cb65e02f7b57a6f5/nntplib.py |
import os | def verisnot(a, b): if a is b: raise TestFailed, "%r is %r" % (a, b) | 2f6d4da2784c79bfc8f3c38fda1ac4c95f6a3b11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2f6d4da2784c79bfc8f3c38fda1ac4c95f6a3b11/test_bool.py |
|
while p: | while n: | def normalize(p): # Strip unnecessary zero coefficients n = len(p) while p: if p[n-1]: return p[:n] n = n-1 return [] | 11a8d0b684f86edb2760020371b53dc9377a9dbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/11a8d0b684f86edb2760020371b53dc9377a9dbd/poly.py |
class M2(object, D): | class M2(D, object): | def all_method(self): return "D b" | 9a81892100fe14f74629f5e9cefddda631c6a5ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a81892100fe14f74629f5e9cefddda631c6a5ee/test_descr.py |
vereq(M2.__mro__, (M2, object, D, C)) | vereq(M2.__mro__, (M2, D, C, object)) | def all_method(self): return "M2 b" | 9a81892100fe14f74629f5e9cefddda631c6a5ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a81892100fe14f74629f5e9cefddda631c6a5ee/test_descr.py |
class M3(M1, object, M2): | class M3(M1, M2, object): | def all_method(self): return "M2 b" | 9a81892100fe14f74629f5e9cefddda631c6a5ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a81892100fe14f74629f5e9cefddda631c6a5ee/test_descr.py |
vereq(M3.__mro__, (M3, M1, M2, D, C, object)) | vereq(M3.__mro__, (M3, M1, M2, D, C, object)) | def all_method(self): return "M3 b" | 9a81892100fe14f74629f5e9cefddda631c6a5ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a81892100fe14f74629f5e9cefddda631c6a5ee/test_descr.py |
class F(D, E): pass vereq(F().spam(), "B") vereq(F().boo(), "B") vereq(F.__mro__, (F, D, E, B, C, A, object)) class G(E, D): pass vereq(G().spam(), "B") vereq(G().boo(), "C") vereq(G.__mro__, (G, E, D, C, B, A, object)) | try: class F(D, E): pass except TypeError: pass else: raise TestFailed, "expected MRO order disagreement (F)" try: class G(E, D): pass except TypeError: pass else: raise TestFailed, "expected MRO order disagreement (G)" def ex5(): if verbose: print "Testing ex5 from C3 switch discussion..." class A(object): pass class B(object): pass class C(object): pass class X(A): pass class Y(A): pass class Z(X,B,Y,C): pass vereq(Z.__mro__, (Z, X, B, Y, A, C, object)) def monotonicity(): if verbose: print "Testing MRO monotonicity..." class Boat(object): pass class DayBoat(Boat): pass class WheelBoat(Boat): pass class EngineLess(DayBoat): pass class SmallMultihull(DayBoat): pass class PedalWheelBoat(EngineLess,WheelBoat): pass class SmallCatamaran(SmallMultihull): pass class Pedalo(PedalWheelBoat,SmallCatamaran): pass vereq(PedalWheelBoat.__mro__, (PedalWheelBoat, EngineLess, DayBoat, WheelBoat, Boat, object)) vereq(SmallCatamaran.__mro__, (SmallCatamaran, SmallMultihull, DayBoat, Boat, object)) vereq(Pedalo.__mro__, (Pedalo, PedalWheelBoat, EngineLess, SmallCatamaran, SmallMultihull, DayBoat, WheelBoat, Boat, object)) def consistency_with_epg(): if verbose: print "Testing consistentcy with EPG..." class Pane(object): pass class ScrollingMixin(object): pass class EditingMixin(object): pass class ScrollablePane(Pane,ScrollingMixin): pass class EditablePane(Pane,EditingMixin): pass class EditableScrollablePane(ScrollablePane,EditablePane): pass vereq(EditableScrollablePane.__mro__, (EditableScrollablePane, ScrollablePane, EditablePane, Pane, ScrollingMixin, EditingMixin, object)) | def boo(self): return "C" | 9a81892100fe14f74629f5e9cefddda631c6a5ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a81892100fe14f74629f5e9cefddda631c6a5ee/test_descr.py |
class C3(C1, C2): __slots__ = [] class C4(C2, C1): __slots__ = [] | def slotspecials(): if verbose: print "Testing __dict__ and __weakref__ in __slots__..." class D(object): __slots__ = ["__dict__"] a = D() verify(hasattr(a, "__dict__")) verify(not hasattr(a, "__weakref__")) a.foo = 42 vereq(a.__dict__, {"foo": 42}) class W(object): __slots__ = ["__weakref__"] a = W() verify(hasattr(a, "__weakref__")) verify(not hasattr(a, "__dict__")) try: a.foo = 42 except AttributeError: pass else: raise TestFailed, "shouldn't be allowed to set a.foo" class C1(W, D): __slots__ = [] a = C1() verify(hasattr(a, "__dict__")) verify(hasattr(a, "__weakref__")) a.foo = 42 vereq(a.__dict__, {"foo": 42}) class C2(D, W): __slots__ = [] a = C2() verify(hasattr(a, "__dict__")) verify(hasattr(a, "__weakref__")) a.foo = 42 vereq(a.__dict__, {"foo": 42}) class C3(C1, C2): __slots__ = [] class C4(C2, C1): __slots__ = [] | 9a81892100fe14f74629f5e9cefddda631c6a5ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a81892100fe14f74629f5e9cefddda631c6a5ee/test_descr.py |
|
class X(A,B,C,D): | class X(D,B,C,A): | def mro(cls): L = type.mro(cls) L.reverse() return L | 9a81892100fe14f74629f5e9cefddda631c6a5ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a81892100fe14f74629f5e9cefddda631c6a5ee/test_descr.py |
def spam(self): return 42 | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
||
dict["__dynamic__"] = 1 | assert dict.get("__dynamic__", 1) | def __new__(metaclass, name, bases, dict): # XXX Should check that name isn't already a base class name dict["__dynamic__"] = 1 cls = super(autosuper, metaclass).__new__(metaclass, name, bases, dict) # Name mangling for __super removes leading underscores while name[:1] == "_": name = name[1:] if name: name = "_%s__super" % name else: name = "__super" setattr(cls, name, super(cls)) return cls | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
__dynamic__ = 1 | __dynamic__ = 1 | def mysetattr(self, name, value): if name == "spam": raise AttributeError return object.__setattr__(self, name, value) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
__dynamic__ = 1 | __dynamic__ = 1 | def mysetattr(self, name, value): if name == "spam": raise AttributeError return object.__setattr__(self, name, value) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
__dynamic__ = 1 | __dynamic__ = 1 | def mysetattr(self, name, value): if name == "spam": raise AttributeError return object.__setattr__(self, name, value) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
__dynamic__ = 1 | __dynamic__ = 1 | def __getitem__(self, i): if 0 <= i < 10: return i raise IndexError | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
__dynamic__ = 0 | __dynamic__ = 0 | def __repr__(self): return "%.*g" % (self.prec, self) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
verify(base.__class__ is complex) | veris(base.__class__, complex) | def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
verify(complex(a).__class__ is complex) | veris(complex(a).__class__, complex) | def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
verify(complex(a).__class__ is complex) | veris(complex(a).__class__, complex) | def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
verify((+a).__class__ is complex) verify((a + 0).__class__ is complex) | veris((+a).__class__, complex) veris((a + 0).__class__, complex) | def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
verify((a - 0).__class__ is complex) | veris((a - 0).__class__, complex) | def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
verify((a * 1).__class__ is complex) | veris((a * 1).__class__, complex) | def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
verify((a / 1).__class__ is complex) | veris((a / 1).__class__, complex) | def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) | 875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/875eeaa193fd8e02d1a8b6d0d6f2768b55b0fff3/test_descr.py |
delimiter string. If maxsplit is given, splits into at most maxsplit words. If sep is not specified, any whitespace string is a separator. | delimiter string. If maxsplit is given, splits at no more than maxsplit places (resulting in at most maxsplit+1 words). If sep is not specified, any whitespace string is a separator. | def split(s, sep=None, maxsplit=-1): """split(s [,sep [,maxsplit]]) -> list of strings Return a list of the words in the string s, using sep as the delimiter string. If maxsplit is given, splits into at most maxsplit words. If sep is not specified, any whitespace string is a separator. (split and splitfields are synonymous) """ return s.split(sep, maxsplit) | 1453754fcda8d9f48e484ce39e80ef5b27aada99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1453754fcda8d9f48e484ce39e80ef5b27aada99/string.py |
except UnboundLocalError: | except NameError: | def inner(): return y | c76770c68c40021322c221dd6bcd62bf98356a33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c76770c68c40021322c221dd6bcd62bf98356a33/test_scope.py |
self.geometry("+%d+%d" % (parent.winfo_rootx()+50, parent.winfo_rooty()+50)) | if self.parent is not None: self.geometry("+%d+%d" % (parent.winfo_rootx()+50, parent.winfo_rooty()+50)) | def __init__(self, parent, title = None): | 6b04ffe9e59dc8df46f2d68646ed82cbbef0714c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6b04ffe9e59dc8df46f2d68646ed82cbbef0714c/tkSimpleDialog.py |
override if you don't want the standard buttons | override if you do not want the standard buttons | def buttonbox(self): '''add standard button box. | 6b04ffe9e59dc8df46f2d68646ed82cbbef0714c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6b04ffe9e59dc8df46f2d68646ed82cbbef0714c/tkSimpleDialog.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.