rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
traceback.print_exc()
traceback.print_exc()
def handle_error(self, request, client_address): """Handle an error gracefully. May be overridden.
6ec81d9983655c1decc44a7d9d7195ed1148d6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ec81d9983655c1decc44a7d9d7195ed1148d6ba/SocketServer.py
self.socket.close()
self.server_close()
def process_request(self, request, client_address): """Fork a new subprocess to process the request.""" self.collect_children() pid = os.fork() if pid: # Parent process if self.active_children is None: self.active_children = [] self.active_children.append(pid) return else: # Child process. # This must never return, hen...
6ec81d9983655c1decc44a7d9d7195ed1148d6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ec81d9983655c1decc44a7d9d7195ed1148d6ba/SocketServer.py
"""Configure resources of an item.
"""Configure resources of an ITEM.
def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an item.
b866941ab00820b51b584c3ec67bfce168797161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b866941ab00820b51b584c3ec67bfce168797161/Tkinter.py
hasn't been loaded yet). The file is searched on sys.path."""
hasn't been loaded yet). The file is searched on sys.path; the .py suffix may be omitted."""
def help_b(self): print """b(reak) ([file:]lineno | function) [, "condition"]
e6af561e644b3c3d27f74762680a82963535cb3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6af561e644b3c3d27f74762680a82963535cb3b/pdb.py
print """cl(ear) [lineno]
print """cl(ear) [file:][lineno]
def help_cl(self): print """cl(ear) [lineno]
e6af561e644b3c3d27f74762680a82963535cb3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6af561e644b3c3d27f74762680a82963535cb3b/pdb.py
hasn't been loaded yet). The file is searched on sys.path."""
hasn't been loaded yet). The file is searched on sys.path; the .py suffix may be omitted."""
def help_cl(self): print """cl(ear) [lineno]
e6af561e644b3c3d27f74762680a82963535cb3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6af561e644b3c3d27f74762680a82963535cb3b/pdb.py
Output("static int %s_init(PyObject *self, PyObject *args, PyObject *kwds)", self.prefix)
Output("static int %s_tp_init(PyObject *self, PyObject *args, PyObject *kwds)", self.prefix)
def output_tp_init(self): if self.output_tp_initBody: Output("static int %s_init(PyObject *self, PyObject *args, PyObject *kwds)", self.prefix) OutLbrace() self.output_tp_initBody() OutRbrace() else: Output("#define %s_tp_init 0", self.prefix) Output()
f719d6ba9e91a494416bc42472d9a4d945672b3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f719d6ba9e91a494416bc42472d9a4d945672b3f/bgenObjectDefinition.py
os.environ.update(env)
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip...
ed3ac1f6fb54732fb22e4dbf537cf8eb804d1761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ed3ac1f6fb54732fb22e4dbf537cf8eb804d1761/CGIHTTPServer.py
os.environ.update(env)
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip...
ed3ac1f6fb54732fb22e4dbf537cf8eb804d1761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ed3ac1f6fb54732fb22e4dbf537cf8eb804d1761/CGIHTTPServer.py
if os.path.isabs(curkeyvalue):
if string.lower(curkeyvalue[:10]) == '{compiler}': curkeyvalue = curkeyvalue[10:] self.dict['pathtype'] = 'CodeWarrior' elif string.lower(curkeyvalue[:9]) == '{project}': curkeyvalue = curkeyvalue[9:] self.dict['pathtype'] = 'Project' elif curkeyvalue[0] == '{': raise Error, "Unknown {} escape in %s"%curkeyvalue elif o...
def _generate_one_template(self, tmpl): resultname, datasource, dataname, key = tmpl result = '' if key: # This is a multi-element rule. Run for every item in dict[key] if self.dict.has_key(key): keyvalues = self.dict[key] try: if not type(keyvalues) in (type(()), type([])): raise Error, "List or tuple expected for %s"...
4381cff6296f227219b0b364ed22e1d0970ea76d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4381cff6296f227219b0b364ed22e1d0970ea76d/cwxmlgen.py
def yview(self, *what):
def xview_moveto(self, fraction): """Adjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.""" self.tk.call(self._w, 'xview', 'moveto', fraction) def xview_scroll(self, number, what): """Shift the x-view according to NUMBER which is measured in "units" or "pages" (WH...
def yview(self, *what): """Query and change vertical position of the view.""" if not what: return self._getdoubles(self.tk.call(self._w, 'yview')) self.tk.call((self._w, 'yview') + what)
f22ed0a21188a02a1ed8f474529824e96ad0bdde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f22ed0a21188a02a1ed8f474529824e96ad0bdde/Tkinter.py
if not what:
if not args:
def yview(self, *what): """Query and change vertical position of the view.""" if not what: return self._getdoubles(self.tk.call(self._w, 'yview')) self.tk.call((self._w, 'yview') + what)
f22ed0a21188a02a1ed8f474529824e96ad0bdde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f22ed0a21188a02a1ed8f474529824e96ad0bdde/Tkinter.py
self.tk.call((self._w, 'yview') + what)
self.tk.call((self._w, 'yview') + args) def yview_moveto(self, fraction): """Adjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.""" self.tk.call(self._w, 'yview', 'moveto', fraction) def yview_scroll(self, number, what): """Shift the y-view according to NUMBER whi...
def yview(self, *what): """Query and change vertical position of the view.""" if not what: return self._getdoubles(self.tk.call(self._w, 'yview')) self.tk.call((self._w, 'yview') + what)
f22ed0a21188a02a1ed8f474529824e96ad0bdde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f22ed0a21188a02a1ed8f474529824e96ad0bdde/Tkinter.py
self.tabCols=IntVar(self)
def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabPa...
273f638753836ea9e35ef1fa89d88d1a9d1b31fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/273f638753836ea9e35ef1fa89d88d1a9d1b31fe/configDialog.py
orient='horizontal',tickinterval=2,from_=2,to=8)
orient='horizontal',tickinterval=2,from_=2,to=10)
def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabPa...
273f638753836ea9e35ef1fa89d88d1a9d1b31fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/273f638753836ea9e35ef1fa89d88d1a9d1b31fe/configDialog.py
self.tabCols.trace_variable('w',self.VarChanged_tabCols)
def AttachVarCallbacks(self): self.fontSize.trace_variable('w',self.VarChanged_fontSize) self.fontName.trace_variable('w',self.VarChanged_fontName) self.fontBold.trace_variable('w',self.VarChanged_fontBold) self.spaceNum.trace_variable('w',self.VarChanged_spaceNum) self.tabCols.trace_variable('w',self.VarChanged_tabCol...
273f638753836ea9e35ef1fa89d88d1a9d1b31fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/273f638753836ea9e35ef1fa89d88d1a9d1b31fe/configDialog.py
def VarChanged_tabCols(self,*params): value=self.tabCols.get() self.AddChangedItem('main','Indent','tab-cols',value)
def VarChanged_tabCols(self,*params): value=self.tabCols.get() self.AddChangedItem('main','Indent','tab-cols',value)
273f638753836ea9e35ef1fa89d88d1a9d1b31fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/273f638753836ea9e35ef1fa89d88d1a9d1b31fe/configDialog.py
if pw:
if pw is not None:
def retry_http_basic_auth(self, host, req, realm): user,pw = self.passwd.find_user_password(realm, host) if pw: raw = "%s:%s" % (user, pw) auth = 'Basic %s' % base64.encodestring(raw).strip() if req.headers.get(self.auth_header, None) == auth: return None req.add_header(self.auth_header, auth) return self.parent.open(r...
7aed4543999ecf820fd35689ae78d4075ccf213a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7aed4543999ecf820fd35689ae78d4075ccf213a/urllib2.py
vars, lasttoken, parent, prefix = [], None, None, ''
vars, lasttoken, parent, prefix, value = [], None, None, '', __UNDEF__
def scanvars(reader, frame, locals): """Scan one logical line of Python and look up values of variables used.""" import tokenize, keyword vars, lasttoken, parent, prefix = [], None, None, '' for ttype, token, start, end, line in tokenize.generate_tokens(reader): if ttype == tokenize.NEWLINE: break if ttype == tokenize....
6168e0a8bd85aa62e38cf9ffb93a175197a177cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6168e0a8bd85aa62e38cf9ffb93a175197a177cc/cgitb.py
<<<<<<< Vrec.py
def main(): format = SV.RGB8_FRAMES qsize = 2 audio = 0 rate = 2 width = 0 norecord = 0 drop = 0 mono = 0 grey = 0 monotreshold = -1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:w:ndgmM:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': qsize = string.atoi(arg) elif opt == '-r': rate = string.atoi(...
cc4967ad870844fcd568bf1e374c367ab53cff8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc4967ad870844fcd568bf1e374c367ab53cff8d/Vrec.py
======= param = [SV.FIELDDROP, 0] v.SetParam(param) >>>>>>> 1.7
def main(): format = SV.RGB8_FRAMES qsize = 2 audio = 0 rate = 2 width = 0 norecord = 0 drop = 0 mono = 0 grey = 0 monotreshold = -1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:w:ndgmM:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': qsize = string.atoi(arg) elif opt == '-r': rate = string.atoi(...
cc4967ad870844fcd568bf1e374c367ab53cff8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc4967ad870844fcd568bf1e374c367ab53cff8d/Vrec.py
queue.put(data, int(id*tpf))
queue.put((data, int(id*tpf)))
def record(v, info, filename, audiofilename, mono, grey, monotreshold): import thread format, x, y, qsize, rate = info fps = 59.64 # Fields per second # XXX (Strange: need fps of Indigo monitor, not of PAL or NTSC!) tpf = 1000.0 / fps # Time per field in msec if filename: vout = VFile.VoutFile().init(filename) if mono:...
cc4967ad870844fcd568bf1e374c367ab53cff8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc4967ad870844fcd568bf1e374c367ab53cff8d/Vrec.py
print 'Captured',count*2, 'fields,', 0.1*int(count*20000.0/(t1-t0)), 'f/s', print count*200.0/lastid, '%,', print count*rate*200.0/lastid, '% of wanted rate'
print 'Captured',count*2, 'fields,', print 0.1*int(count*20000.0/(t1-t0)), 'f/s', if lastid: print count*200.0/lastid, '%,', print count*rate*200.0/lastid, '% of wanted rate', print
def record(v, info, filename, audiofilename, mono, grey, monotreshold): import thread format, x, y, qsize, rate = info fps = 59.64 # Fields per second # XXX (Strange: need fps of Indigo monitor, not of PAL or NTSC!) tpf = 1000.0 / fps # Time per field in msec if filename: vout = VFile.VoutFile().init(filename) if mono:...
cc4967ad870844fcd568bf1e374c367ab53cff8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc4967ad870844fcd568bf1e374c367ab53cff8d/Vrec.py
print 'ratecv' state = (-8000, ((256, 512),)) if audioop.ratecv(data[0], 1, 1, 8000, 16000, state) != \ ('\001\000\000\001\001\002', state): return 0
print 'ratecv' state = None d1, state = audioop.ratecv(data[0], 1, 1, 8000, 16000, state) d2, state = audioop.ratecv(data[0], 1, 1, 8000, 16000, state) if d1 + d2 != '\000\000\001\001\002\001\000\000\001\001\002': return 0
def testratecv(data): if verbose: print 'ratecv' state = (-8000, ((256, 512),)) if audioop.ratecv(data[0], 1, 1, 8000, 16000, state) != \ ('\001\000\000\001\001\002', state): return 0 return 1
8c511db5a463b1ee6190e846b4b4c33970acee2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c511db5a463b1ee6190e846b4b4c33970acee2b/test_audioop.py
@contextmanager
@contextfactory
def contextfactory(func): """@contextfactory decorator. Typical usage: @contextmanager def some_generator(<arguments>): <setup> try: yield <value> finally: <cleanup> This makes this: with some_generator(<arguments>) as <variable>: <body> equivalent to this: <setup> try: <variable> = <value> <body> finally: <clean...
e58215e8d2938e0002b5c116711f9b4e619080f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e58215e8d2938e0002b5c116711f9b4e619080f9/contextlib.py
def read(self,size=None):
def read(self, size=None):
def read(self,size=None): if self.extrasize <= 0 and self.fileobj is None: return ''
aab6114b4ac22af79a626d35d5a460c8cca77f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aab6114b4ac22af79a626d35d5a460c8cca77f9e/gzip.py
self.extrasize = len(buf) + self.extrasize
self.extrasize = len(self.extrabuf)
def _unread(self, buf): self.extrabuf = buf + self.extrabuf self.extrasize = len(buf) + self.extrasize
aab6114b4ac22af79a626d35d5a460c8cca77f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aab6114b4ac22af79a626d35d5a460c8cca77f9e/gzip.py
bufs.append(c[:i])
bufs.append(c[:i+1])
def readline(self): bufs = [] readsize = 100 while 1: c = self.read(readsize) i = string.find(c, '\n') if i >= 0 or c == '': bufs.append(c[:i]) self._unread(c[i+1:]) return string.join(bufs, '') bufs.append(c) readsize = readsize * 2
aab6114b4ac22af79a626d35d5a460c8cca77f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aab6114b4ac22af79a626d35d5a460c8cca77f9e/gzip.py
def get_python_version ():
def get_python_version():
def get_python_version (): """Return a string containing the major and minor Python version, leaving off the patchlevel. Sample return values could be '1.5' or '2.2'. """ return sys.version[:3]
2356cd82c3490347fc50ac030d0ebcb8dc8543a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2356cd82c3490347fc50ac030d0ebcb8dc8543a5/sysconfig.py
return os.path.join(prefix, "include", "python" + sys.version[:3])
return os.path.join(prefix, "include", "python" + get_python_version())
def get_python_inc(plat_specific=0, prefix=None): """Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely pycon...
2356cd82c3490347fc50ac030d0ebcb8dc8543a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2356cd82c3490347fc50ac030d0ebcb8dc8543a5/sysconfig.py
if sys.version < "2.2":
if get_python_version() < "2.2":
def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the ...
2356cd82c3490347fc50ac030d0ebcb8dc8543a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2356cd82c3490347fc50ac030d0ebcb8dc8543a5/sysconfig.py
if sys.version < '2.2':
if get_python_version() < '2.2':
def get_config_h_filename(): """Return full pathname of installed pyconfig.h file.""" if python_build: inc_dir = os.curdir else: inc_dir = get_python_inc(plat_specific=1) if sys.version < '2.2': config_h = 'config.h' else: # The name of the config.h file changed in 2.2 config_h = 'pyconfig.h' return os.path.join(inc_di...
2356cd82c3490347fc50ac030d0ebcb8dc8543a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2356cd82c3490347fc50ac030d0ebcb8dc8543a5/sysconfig.py
elif sys.version < '2.1':
elif get_python_version() < '2.1':
def _init_posix(): """Initialize the module as appropriate for POSIX systems.""" g = {} # load the installed Makefile: try: filename = get_makefile_filename() parse_makefile(filename, g) except IOError, msg: my_msg = "invalid Python installation: unable to open %s" % filename if hasattr(msg, "strerror"): my_msg = my_ms...
2356cd82c3490347fc50ac030d0ebcb8dc8543a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2356cd82c3490347fc50ac030d0ebcb8dc8543a5/sysconfig.py
(linkerscript, PREFIX, sys.version[0:3]))
(linkerscript, PREFIX, get_python_version()))
def _init_posix(): """Initialize the module as appropriate for POSIX systems.""" g = {} # load the installed Makefile: try: filename = get_makefile_filename() parse_makefile(filename, g) except IOError, msg: my_msg = "invalid Python installation: unable to open %s" % filename if hasattr(msg, "strerror"): my_msg = my_ms...
2356cd82c3490347fc50ac030d0ebcb8dc8543a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2356cd82c3490347fc50ac030d0ebcb8dc8543a5/sysconfig.py
if pass_iso8859: i = i % 128 if 32 <= i <= 126:
if 32 <= (i % mod) <= 126:
def make_escapes(pass_iso8859): global escapes for i in range(256): if pass_iso8859: # Allow iso-8859 characters to pass through so that e.g. 'msgid # "Hhe"' would result not result in 'msgid "H\366he"'. Otherwise # we escape any character outside the 32..126 range. i = i % 128 if 32 <= i <= 126: escapes.append(chr(i)...
ae9dcec4f9019ecf6d72d3a00fb672f2d65697f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ae9dcec4f9019ecf6d72d3a00fb672f2d65697f9/pygettext.py
make_escapes(options.escapes)
make_escapes(options.escape)
def main(): default_keywords = ['_'] try: opts, args = getopt.getopt( sys.argv[1:], 'ad:Ehk:n:o:p:Vvw:x:', ['extract-all', 'default-domain', 'escape', 'help', 'keyword', 'add-location', 'no-location', 'output=', 'output-dir=', 'verbose', 'version', 'width=', 'exclude-file=', ]) except getopt.error, msg: usage(1, msg) ...
ae9dcec4f9019ecf6d72d3a00fb672f2d65697f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ae9dcec4f9019ecf6d72d3a00fb672f2d65697f9/pygettext.py
mainname = os.path.basename(self.mainprogram) self.files.append((self.mainprogram, pathjoin(resdir, mainname))) mainprogram = self.mainprogram
mainprogram = os.path.basename(self.mainprogram) self.files.append((self.mainprogram, pathjoin(resdir, mainprogram)))
def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execname = self.name else: execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.appe...
3b64c2b31cddc5ef8bf1569d9df6834e1957d5bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b64c2b31cddc5ef8bf1569d9df6834e1957d5bd/bundlebuilder.py
mainwrapperpath = pathjoin(execdir, self.name)
bootstrappath = pathjoin(execdir, self.name)
def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execname = self.name else: execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.appe...
3b64c2b31cddc5ef8bf1569d9df6834e1957d5bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b64c2b31cddc5ef8bf1569d9df6834e1957d5bd/bundlebuilder.py
open(mainwrapperpath, "w").write(BOOTSTRAP_SCRIPT % locals()) os.chmod(mainwrapperpath, 0775)
open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals()) os.chmod(bootstrappath, 0775)
def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execname = self.name else: execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.appe...
3b64c2b31cddc5ef8bf1569d9df6834e1957d5bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b64c2b31cddc5ef8bf1569d9df6834e1957d5bd/bundlebuilder.py
id(data),
id(data)+12,
def mk16pixmap(w, h, data): """kludge a pixmap together""" rv = struct.pack("lhhhhhhhlllhhhhlll", id(data), w*2 + 0x8000, 0, 0, h, w, 0, 0, 0, # XXXX? 72<<16, 72<<16, 16, 16, # XXXX 3, 5, 0, 0, 0) print 'Our pixmap, size %d:'%len(rv) dumppixmap(rv) return Qd.RawBitMap(rv)
f57e01671ffea648c2744881410675be1ce3c6ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f57e01671ffea648c2744881410675be1ce3c6ce/imgbrowse.py
currect, QuickDraw.srcCopy, None)
currect, QuickDraw.srcCopy+QuickDraw.ditherCopy, None)
def do_update(self, *args): pass currect = self.fitrect() print 'PICT:', self.pictrect print 'WIND:', currect print 'ARGS:', (self.pixmap, self.wid.GetWindowPort().portBits, self.pictrect, currect, QuickDraw.srcCopy, None) self.info() Qd.CopyBits(self.pixmap, self.wid.GetWindowPort().portBits, self.pictrect, currect, Q...
f57e01671ffea648c2744881410675be1ce3c6ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f57e01671ffea648c2744881410675be1ce3c6ce/imgbrowse.py
handler=None):
handler=None):
def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT, handler=None): ThreadingTCPServer.__init__(self, (host, port), handler) logging._acquireLock() self.abort = 0 logging._releaseLock() self.timeout = 1
02536bca15e9c3f50065c8ce3449adb01bd62573 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02536bca15e9c3f50065c8ce3449adb01bd62573/config.py
def serve(rcvr, hdlr): server = rcvr(handler=hdlr)
def serve(rcvr, hdlr, port): server = rcvr(port=port, handler=hdlr)
def serve(rcvr, hdlr): server = rcvr(handler=hdlr) global _listener logging._acquireLock() _listener = server logging._releaseLock() server.serve_until_stopped()
02536bca15e9c3f50065c8ce3449adb01bd62573 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02536bca15e9c3f50065c8ce3449adb01bd62573/config.py
return threading.Thread(target=serve, args=(ConfigSocketReceiver, ConfigStreamHandler))
return threading.Thread(target=serve, args=(ConfigSocketReceiver, ConfigStreamHandler, port))
def serve(rcvr, hdlr): server = rcvr(handler=hdlr) global _listener logging._acquireLock() _listener = server logging._releaseLock() server.serve_until_stopped()
02536bca15e9c3f50065c8ce3449adb01bd62573 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02536bca15e9c3f50065c8ce3449adb01bd62573/config.py
self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs
self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet()
def RemoveKeybindings(self): "Remove the keybindings before they are changed." # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist) for extensionName in self.get_stan...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: for event, keylist in keydefs.items():
xkeydefs = idleConf.GetExtensionBindings(extensionName) if xkeydefs: for event, keylist in xkeydefs.items():
def RemoveKeybindings(self): "Remove the keybindings before they are changed." # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist) for extensionName in self.get_stan...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
self.Bindings.default_keydefs=idleConf.GetCurrentKeySet()
self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet()
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs)
xkeydefs = idleConf.GetExtensionBindings(extensionName) if xkeydefs: self.apply_bindings(xkeydefs)
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
menuEventDict={}
menuEventDict = {}
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
menuEventDict[menu[0]]={}
menuEventDict[menu[0]] = {}
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1]
menuEventDict[menu[0]][prepstr(item[0])[1]] = item[1]
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator')
menu = self.menudict[menubarItem] end = menu.index(END) + 1 for index in range(0, end): if menu.type(index) == 'command': accel = menu.entrycget(index, 'accelerator')
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
itemName=menu.entrycget(index,'label') event=''
itemName = menu.entrycget(index, 'label') event = ''
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
event=menuEventDict[menubarItem][itemName]
event = menuEventDict[menubarItem][itemName]
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
accel = get_accelerator(keydefs, event) menu.entryconfig(index, accelerator=accel)
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.appl...
a945eef857307bb62f421da83331c51112ecdc94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a945eef857307bb62f421da83331c51112ecdc94/EditorWindow.py
"""Basic (multiple values per field) form content as dictionary.
"""Form content as dictionary with a list of values per field.
def make_file(self, binary=None): """Overridable: return a readable & writable file.
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
"""Strict single-value expecting form content as dictionary. IF you only expect a single value for each field, then form[key]
"""Form content as dictionary expecting a single value per field. If you only expect a single value for each field, then form[key]
def __init__(self, environ=os.environ): self.dict = self.data = parse(environ=environ) self.query_string = environ['QUERY_STRING']
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
that expectation is not true. IF you expect a field to have
that expectation is not true. If you expect a field to have
def __init__(self, environ=os.environ): self.dict = self.data = parse(environ=environ) self.query_string = environ['QUERY_STRING']
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
lis = [] for each in self.dict.values(): if len( each ) == 1 : lis.append(each[0]) else: lis.append(each) return lis
result = [] for value in self.dict.values(): if len(value) == 1: result.append(value[0]) else: result.append(value) return result
def values(self): lis = [] for each in self.dict.values(): if len( each ) == 1 : lis.append(each[0]) else: lis.append(each) return lis
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
lis = [] for key,value in self.dict.items(): if len(value) == 1 : lis.append((key, value[0])) else: lis.append((key, value)) return lis
result = [] for key, value in self.dict.items(): if len(value) == 1: result.append((key, value[0])) else: result.append((key, value)) return result
def items(self): lis = [] for key,value in self.dict.items(): if len(value) == 1 : lis.append((key, value[0])) else: lis.append((key, value)) return lis
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
def __getitem__( self, key ): v = SvFormContentDict.__getitem__( self, key ) if v[0] in string.digits+'+-.' : try: return string.atoi( v )
def __getitem__(self, key): v = SvFormContentDict.__getitem__(self, key) if v[0] in string.digits + '+-.': try: return string.atoi(v)
def __getitem__( self, key ): v = SvFormContentDict.__getitem__( self, key ) if v[0] in string.digits+'+-.' : try: return string.atoi( v ) except ValueError: try: return string.atof( v ) except ValueError: pass return string.strip(v)
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
try: return string.atof( v )
try: return string.atof(v)
def __getitem__( self, key ): v = SvFormContentDict.__getitem__( self, key ) if v[0] in string.digits+'+-.' : try: return string.atoi( v ) except ValueError: try: return string.atof( v ) except ValueError: pass return string.strip(v)
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
def values( self ): lis = []
def values(self): result = []
def values( self ): lis = [] for key in self.keys(): try: lis.append( self[key] ) except IndexError: lis.append( self.dict[key] ) return lis
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
lis.append( self[key] )
result.append(self[key])
def values( self ): lis = [] for key in self.keys(): try: lis.append( self[key] ) except IndexError: lis.append( self.dict[key] ) return lis
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
lis.append( self.dict[key] ) return lis def items( self ): lis = []
result.append(self.dict[key]) return result def items(self): result = []
def values( self ): lis = [] for key in self.keys(): try: lis.append( self[key] ) except IndexError: lis.append( self.dict[key] ) return lis
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
lis.append( (key, self[key]) )
result.append((key, self[key]))
def items( self ): lis = [] for key in self.keys(): try: lis.append( (key, self[key]) ) except IndexError: lis.append( (key, self.dict[key]) ) return lis
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
lis.append( (key, self.dict[key]) ) return lis
result.append((key, self.dict[key])) return result
def items( self ): lis = [] for key in self.keys(): try: lis.append( (key, self[key]) ) except IndexError: lis.append( (key, self.dict[key]) ) return lis
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
if len (self.dict[key]) > location:
if len(self.dict[key]) > location:
def indexed_value(self, key, location): if self.dict.has_key(key): if len (self.dict[key]) > location: return self.dict[key][location] else: return None else: return None
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
print_directory() print_arguments()
def test(environ=os.environ): """Robust test CGI script, usable as main program. Write minimal HTTP headers and dump all information provided to the script in HTML form. """ import traceback print "Content-type: text/html" print sys.stderr = sys.stdout try: form = FieldStorage() # Replace with other classes to test...
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
print_directory() print_arguments()
def g(f=f): f()
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
def TemporaryFile(mode='w+b', bufsize=-1, suffix=""): """Create and return a temporary file (opened read-write by default).""" name = mktemp(suffix) if os.name == 'posix': # Unix -- be very careful fd = os.open(name, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700) try: os.unlink(name) return os.fdopen(fd, mode, bufsize) except: ...
3d5a17255312ca86473303031cddfae3bdd292f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3d5a17255312ca86473303031cddfae3bdd292f8/tempfile.py
SetDialogItemText(text_h, "Progress...")
SetDialogItemText(text_h, label)
def __init__(self, label="Working...", maxval=100): self.label = label self.maxval = maxval self.curval = -1 self.d = GetNewDialog(259, -1) tp, text_h, rect = self.d.GetDialogItem(2) SetDialogItemText(text_h, "Progress...") self._update(0)
2129e221120e08a1eefab8748e6939420d54fd11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2129e221120e08a1eefab8748e6939420d54fd11/EasyDialogs.py
Qd.PaintRect(inner_rect) l, t, r, b = inner_rect r = int(l + (r-l)*value/self.maxval) inner_rect = l, t, r, b Qd.ForeColor(QuickDraw.blackColor) Qd.BackColor(QuickDraw.blackColor) Qd.PaintRect(inner_rect)
Qd.PaintRect((int(l + (r-l)*value/self.maxval), t, r, b))
def _update(self, value): tp, h, bar_rect = self.d.GetDialogItem(3) Qd.SetPort(self.d) Qd.FrameRect(bar_rect) # Draw outline inner_rect = Qd.InsetRect(bar_rect, 1, 1) Qd.ForeColor(QuickDraw.whiteColor) Qd.BackColor(QuickDraw.whiteColor) Qd.PaintRect(inner_rect) # Clear internal l, t, r, b = inner_rect r = int(l + (r...
2129e221120e08a1eefab8748e6939420d54fd11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2129e221120e08a1eefab8748e6939420d54fd11/EasyDialogs.py
if __name__ == "__main__":
def test_main():
def get_file(): return __file__
e9cd2764f2f8cd75be50c60205ddddc71055927a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9cd2764f2f8cd75be50c60205ddddc71055927a/test_zipimport.py
attrs.getQNames() == [] and \
(attrs.getQNames() == [] or attrs.getQNames() == ["ns:attr"]) and \
def test_expat_nsattrs_wattr(): parser = create_parser(1) gather = AttrGatherer() parser.setContentHandler(gather) parser.feed("<doc xmlns:ns='%s' ns:attr='val'/>" % ns_uri) parser.close() attrs = gather._attrs return attrs.getLength() == 1 and \ attrs.getNames() == [(ns_uri, "attr")] and \ attrs.getQNames() == [] a...
7bcb37027a4735c4464be5a61bbbce7a7e57bfa5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7bcb37027a4735c4464be5a61bbbce7a7e57bfa5/test_sax.py
import sys, traceback
import traceback
def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in reverse order so functions are executed last in, first out. """ exc_info = None while _exithandlers: func, targs, kargs = _exithandlers.pop() try: func(*targs, **kargs) except SystemExit: exc_info = sys.exc_info() except: import ...
3edfc10ec846fafad364bae00027a5b64e89576c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3edfc10ec846fafad364bae00027a5b64e89576c/atexit.py
import sys
def register(func, *targs, **kargs): """register a function to be executed upon normal program termination func - function to be called at exit targs - optional arguments to pass to func kargs - optional keyword arguments to pass to func """ _exithandlers.append((func, targs, kargs))
3edfc10ec846fafad364bae00027a5b64e89576c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3edfc10ec846fafad364bae00027a5b64e89576c/atexit.py
del sys
def register(func, *targs, **kargs): """register a function to be executed upon normal program termination func - function to be called at exit targs - optional arguments to pass to func kargs - optional keyword arguments to pass to func """ _exithandlers.append((func, targs, kargs))
3edfc10ec846fafad364bae00027a5b64e89576c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3edfc10ec846fafad364bae00027a5b64e89576c/atexit.py
def check_module_event(self, event):
def check_module_event(self, event=None):
def check_module_event(self, event): filename = self.getfilename() if not filename: return if not self.tabnanny(filename): return self.checksyntax(filename)
824886b867c82dd47df08da580c55289f9c45ba7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/824886b867c82dd47df08da580c55289f9c45ba7/ScriptBinding.py
filename = self.getfilename() if not filename: return if not self.tabnanny(filename): return code = self.checksyntax(filename)
code = self.check_module_event(event)
def run_module_event(self, event): """Run the module after setting up the environment.
824886b867c82dd47df08da580c55289f9c45ba7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/824886b867c82dd47df08da580c55289f9c45ba7/ScriptBinding.py
self.saved_dbc_key = c.current(0,0,0)[0]
try: self.saved_dbc_key = c.current(0,0,0)[0] except db.DBError: pass
def _closeCursors(self, save=1): if self.dbc: c = self.dbc self.dbc = None if save: self.saved_dbc_key = c.current(0,0,0)[0] c.close() del c for cref in self._cursor_refs.values(): c = cref() if c is not None: c.close()
da9c65cacc1f104fdfe92d5de64a01e9af294cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da9c65cacc1f104fdfe92d5de64a01e9af294cf7/__init__.py
self.reset()
def feed(self, data, isFinal = 0): if not self._parsing: self._parsing = 1 self.reset() self._cont_handler.startDocument()
66f0b01fc08ab4416867e9677a1d1876c15b366a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66f0b01fc08ab4416867e9677a1d1876c15b366a/expatreader.py
import difflib a = expected.splitlines() b = output.splitlines()
a = expected.splitlines(1) b = output.splitlines(1)
def reportdiff(expected, output): print "*" * 70 import difflib a = expected.splitlines() b = output.splitlines() sm = difflib.SequenceMatcher(a=a, b=b) tuples = sm.get_opcodes() def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1) for op, a0, a1, b0, b1 in tuples: if op == 'equal': pas...
5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c/regrtest.py
return str(x0) else: return "%d,%d" % (x0, x1)
return "line " + str(x0) else: return "lines %d-%d" % (x0, x1)
def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1)
5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c/regrtest.py
print pair(a0, a1) + "d" + pair(b0, b1)
print "***", pair(a0, a1), "of expected output missing:"
def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1)
5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c/regrtest.py
print "<", line
print "-", line,
def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1)
5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c/regrtest.py
print pair(a0, a1) + "c" + pair(b0, b1) for line in a[a0:a1]: print "<", line print "---"
print "*** mismatch between", pair(a0, a1), "of expected", \ "output and", pair(b0, b1), "of actual output:" for line in difflib.ndiff(a[a0:a1], b[b0:b1]): print line, elif op == 'insert': print "***", pair(b0, b1), "of actual output doesn't appear", \ "in expected output after line", str(a1)+":"
def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1)
5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c/regrtest.py
print ">", line elif op == 'insert': print str(a0) + "a" + pair(b0, b1) for line in b[b0:b1]: print ">", line
print "+", line,
def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1)
5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d5cbea13a7ce3fec0f1eaea43acaa3a9b6fb93c/regrtest.py
try: del sys.modules[modname] except KeyError: pass
def check_all(modname): names = {} try: exec "import %s" % modname in names except ImportError: # silent fail here seems the best route since some modules # may not be available in all environments return verify(hasattr(sys.modules[modname], "__all__"), "%s has no __all__ attribute" % modname) names = {} exec "from %s ...
cea5d26962361bbffe973a7cd56b982fddb9da43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cea5d26962361bbffe973a7cd56b982fddb9da43/test___all__.py
def basic_test_inplace_repeat(self, size): l = [''] l *= size self.assertEquals(len(l), size) self.failUnless(l[0] is l[-1]) del l l = [''] * size l *= 2 self.assertEquals(len(l), size * 2) self.failUnless(l[size - 1] is l[-1]) @bigmemtest(minsize=_2G // 2 + 2, memuse=16) def test_inplace_repeat_small(self, size): re...
def test_repeat_large(self, size): return self.basic_test_repeat(size)
a7bdc715c90e8ff03c83a1e3e3f5c78545b87b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a7bdc715c90e8ff03c83a1e3e3f5c78545b87b1f/test_bigmem.py
@bigmemtest(minsize=_2G // 2 + 2, memuse=8)
@bigmemtest(minsize=_2G // 2 + 2, memuse=16)
def basic_test_extend(self, size): l = [file] * size l.extend(l) self.assertEquals(len(l), size * 2) self.failUnless(l[0] is l[-1]) self.failUnless(l[size - 1] is l[size + 1])
a7bdc715c90e8ff03c83a1e3e3f5c78545b87b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a7bdc715c90e8ff03c83a1e3e3f5c78545b87b1f/test_bigmem.py
@bigmemtest(minsize=_2G + 2, memuse=8)
@bigmemtest(minsize=_2G + 2, memuse=16)
def test_extend_small(self, size): return self.basic_test_extend(size)
a7bdc715c90e8ff03c83a1e3e3f5c78545b87b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a7bdc715c90e8ff03c83a1e3e3f5c78545b87b1f/test_bigmem.py
def user_line(self, frame): # get the currently executing function ##print>>sys.__stderr__, "*function: ", frame.f_code.co_name ##print>>sys.__stderr__, "*file: ", frame.f_code.co_filename ##print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno co_filename = frame.f_code.co_filename co_name = frame.f_cod...
5da7e431bc05216e5364bde17a39e5d00c77bece /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5da7e431bc05216e5364bde17a39e5d00c77bece/Debugger.py
if co_filename in ('rpc.py', '<string>'):
if co_filename in (r'.\rpc.py', 'rpc.py','<string>'):
def user_line(self, frame): # get the currently executing function ##print>>sys.__stderr__, "*function: ", frame.f_code.co_name ##print>>sys.__stderr__, "*file: ", frame.f_code.co_filename ##print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno co_filename = frame.f_code.co_filename co_name = frame.f_cod...
5da7e431bc05216e5364bde17a39e5d00c77bece /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5da7e431bc05216e5364bde17a39e5d00c77bece/Debugger.py
return WeakValuedItemIterator(self)
for wr in self.data.itervalues(): value = wr() if value is not None: yield wr.key, value
def iteritems(self): return WeakValuedItemIterator(self)
4fd20c6c44f74cca2cf3674f367c51fe70a1883b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fd20c6c44f74cca2cf3674f367c51fe70a1883b/weakref.py
__iter__ = iterkeys
def __iter__(self): return self.data.iterkeys()
def iterkeys(self): return self.data.iterkeys()
4fd20c6c44f74cca2cf3674f367c51fe70a1883b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fd20c6c44f74cca2cf3674f367c51fe70a1883b/weakref.py
return WeakValuedValueIterator(self)
for wr in self.data.itervalues(): obj = wr() if obj is not None: yield obj
def itervalues(self): return WeakValuedValueIterator(self)
4fd20c6c44f74cca2cf3674f367c51fe70a1883b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fd20c6c44f74cca2cf3674f367c51fe70a1883b/weakref.py
return WeakKeyedItemIterator(self)
for wr, value in self.data.iteritems(): key = wr() if key is not None: yield key, value
def iteritems(self): return WeakKeyedItemIterator(self)
4fd20c6c44f74cca2cf3674f367c51fe70a1883b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fd20c6c44f74cca2cf3674f367c51fe70a1883b/weakref.py
return WeakKeyedKeyIterator(self) __iter__ = iterkeys
for wr in self.data.iterkeys(): obj = wr() if obj is not None: yield obj def __iter__(self): return self.iterkeys()
def iterkeys(self): return WeakKeyedKeyIterator(self)
4fd20c6c44f74cca2cf3674f367c51fe70a1883b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fd20c6c44f74cca2cf3674f367c51fe70a1883b/weakref.py
def WeakKeyedKeyIterator(weakdict): for wr in weakdict.data.iterkeys(): obj = wr() if obj is not None: yield obj def WeakKeyedItemIterator(weakdict): for wr, value in weakdict.data.iteritems(): key = wr() if key is not None: yield key, value def WeakValuedValueIterator(weakdict): for wr in weakdict.data.itervalues(...
def update(self, dict=None, **kwargs): d = self.data if dict is not None: if not hasattr(dict, "items"): dict = type({})(dict) for key, value in dict.items(): d[ref(key, self._remove)] = value if len(kwargs): self.update(kwargs)
4fd20c6c44f74cca2cf3674f367c51fe70a1883b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fd20c6c44f74cca2cf3674f367c51fe70a1883b/weakref.py