rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for item in walk_packages(path, name+'.'):
for item in walk_packages(path, name+'.', onerror):
def seen(p, m={}): if p in m: return True m[p] = True
69b9b677b091fe770d73a22e0d4a11a15364bc4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69b9b677b091fe770d73a22e0d4a11a15364bc4a/pkgutil.py
"""Yield submodule names+loaders for path or sys.path"""
"""Yields (module_loader, name, ispkg) for all submodules on path, or, if path is None, all top-level modules on sys.path. 'path' should be either None or a list of paths to look for modules in. 'prefix' is a string to output on the front of every module name on output. """
def iter_modules(path=None, prefix=''): """Yield submodule names+loaders for path or sys.path""" if path is None: importers = iter_importers() else: importers = map(get_importer, path) yielded = {} for i in importers: for name, ispkg in iter_importer_modules(i, prefix): if name not in yielded: yielded[name] = 1 yield ...
69b9b677b091fe770d73a22e0d4a11a15364bc4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69b9b677b091fe770d73a22e0d4a11a15364bc4a/pkgutil.py
self.__buf = self.__buf + \ (chr(int(x>>24 & 0xff)) + chr(int(x>>16 & 0xff)) + \ chr(int(x>>8 & 0xff)) + chr(int(x & 0xff))) if _USE_MACHINE_REP: def pack_uint(self, x): if type(x) == LongType: x = int((x + 0x80000000L) % 0x100000000L - 0x80000000L) self.__buf = self.__buf + struct.pack('l', x)
self.__buf = self.__buf + struct.pack('>L', x)
def pack_uint(self, x):
6083f0e9ce84de9f8b3aa0531a833b9de285438d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6083f0e9ce84de9f8b3aa0531a833b9de285438d/xdrlib.py
raise ConversionError('Not supported')
try: self.__buf = self.__buf + struct.pack('>f', x) except struct.error, msg: raise ConversionError(msg)
def pack_float(self, x):
6083f0e9ce84de9f8b3aa0531a833b9de285438d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6083f0e9ce84de9f8b3aa0531a833b9de285438d/xdrlib.py
raise ConversionError('Not supported') if _xdr: def pack_float(self, x): try: self.__buf = self.__buf + _xdr.pack_float(x) except _xdr.error, msg: raise ConversionError(msg) def pack_double(self, x): try: self.__buf = self.__buf + _xdr.pack_double(x) except _xdr.error, msg: raise ConversionError(msg)
try: self.__buf = self.__buf + struct.pack('>d', x) except struct.error, msg: raise ConversionError(msg)
def pack_double(self, x):
6083f0e9ce84de9f8b3aa0531a833b9de285438d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6083f0e9ce84de9f8b3aa0531a833b9de285438d/xdrlib.py
x = long(ord(data[0]))<<24 | ord(data[1])<<16 | \ ord(data[2])<<8 | ord(data[3]) if x < 0x80000000L: x = int(x) return x if _USE_MACHINE_REP: def unpack_uint(self): i = self.__pos self.__pos = j = i+4 data = self.__buf[i:j] if len(data) < 4: raise EOFError return struct.unpack('l', data)[0]
x = struct.unpack('>L', data)[0] try: return int(x) except OverflowError: return x
def unpack_uint(self):
6083f0e9ce84de9f8b3aa0531a833b9de285438d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6083f0e9ce84de9f8b3aa0531a833b9de285438d/xdrlib.py
x = self.unpack_uint() if x >= 0x80000000L: x = x - 0x100000000L return int(x)
i = self.__pos self.__pos = j = i+4 data = self.__buf[i:j] if len(data) < 4: raise EOFError return struct.unpack('>l', data)[0]
def unpack_int(self):
6083f0e9ce84de9f8b3aa0531a833b9de285438d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6083f0e9ce84de9f8b3aa0531a833b9de285438d/xdrlib.py
raise ConversionError('Not supported')
i = self.__pos self.__pos = j = i+4 data = self.__buf[i:j] if len(data) < 4: raise EOFError return struct.unpack('>f', data)[0]
def unpack_float(self):
6083f0e9ce84de9f8b3aa0531a833b9de285438d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6083f0e9ce84de9f8b3aa0531a833b9de285438d/xdrlib.py
raise ConversionError('Not supported') if _xdr: def unpack_float(self): i = self.__pos self.__pos = j = i+4 data = self.__buf[i:j] if len(data) < 4: raise EOFError try: return _xdr.unpack_float(data) except _xdr.error, msg: raise ConversionError(msg) def unpack_double(self): i = self.__pos self.__pos = j = i+8 data =...
i = self.__pos self.__pos = j = i+8 data = self.__buf[i:j] if len(data) < 8: raise EOFError return struct.unpack('>d', data)[0]
def unpack_double(self):
6083f0e9ce84de9f8b3aa0531a833b9de285438d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6083f0e9ce84de9f8b3aa0531a833b9de285438d/xdrlib.py
k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v
if ':' in item: k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v lastk = k elif lastk: self._info[lastk] += '\n' + item
def _parse(self, fp): """Override this method to support alternative .mo formats.""" unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} self.plural = lambda n: int(n != 1) # germanic plural by default buf ...
7de63f57c881cb94ba89c2a1dfaf79af1bba52bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7de63f57c881cb94ba89c2a1dfaf79af1bba52bb/gettext.py
import pdb ; pdb.set_trace()
def extractarg(self, part): mode = "InMode" if self.asplit.match(part) < 0: self.error("Indecipherable argument: %s", `part`) import pdb ; pdb.set_trace() return ("unknown", part, mode) type, name, array = self.asplit.group('type', 'name', 'array') if array: # array matches an optional [] after the argument name type =...
3d3a91c18854aabb4f32cfd4a894de5099d4832a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3d3a91c18854aabb4f32cfd4a894de5099d4832a/scantools.py
if name in ('os2', ):
if name in ('os2', 'nt', 'dos'):
def _execvpe(file, args, env = None): if env: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath import string PATH = st...
da4d6daa4a4a95f7031f9b8c3e76222ec4fd509e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da4d6daa4a4a95f7031f9b8c3e76222ec4fd509e/os.py
key = string.upper(key)
def __setitem__(self, key, item): key = string.upper(key) putenv(key, item) self.data[key] = item
da4d6daa4a4a95f7031f9b8c3e76222ec4fd509e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da4d6daa4a4a95f7031f9b8c3e76222ec4fd509e/os.py
def __getitem__(self, key): return self.data[string.upper(key)] else: class _Environ(UserDict.UserDict): def __init__(self, environ): UserDict.UserDict.__init__(self) self.data = environ def __getinitargs__(self): import copy return (copy.copy(self.data),) def __setitem__(self, key, item): putenv(key, item) self.data[...
def __getitem__(self, key): return self.data[string.upper(key)]
da4d6daa4a4a95f7031f9b8c3e76222ec4fd509e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da4d6daa4a4a95f7031f9b8c3e76222ec4fd509e/os.py
path = [module.__filename__]
head, tail = os.path.split(module.__filename__) path = [head]
def reload(self, module, path=None): if path is None and hasattr(module, '__filename__'): path = [module.__filename__] return ihooks.ModuleImporter.reload(self, module, path)
18596003572b715d57ecb6d357cebc4257c0bb31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/18596003572b715d57ecb6d357cebc4257c0bb31/rexec.py
def readline(self): if not self._file: if not self._files: return "" self._filename = self._files[0] self._files = self._files[1:] self._filelineno = 0 self._file = None self._isstdin = 0 self._backupfilename = 0 if self._filename == '-': self._filename = '<stdin>' self._file = sys.stdin self._isstdin = 1 else: if self...
dcb8583c180bc9c477f58f77166dc2abbccadc11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dcb8583c180bc9c477f58f77166dc2abbccadc11/fileinput.py
self._output = open(self._filename, "w")
try: perm = os.fstat(self._file.fileno())[stat.ST_MODE] except: self._output = open(self._filename, "w") else: fd = os.open(self._filename, os.O_CREAT | os.O_WRONLY | os.O_TRUNC, perm) self._output = os.fdopen(fd, "w") try: os.chmod(self._filename, perm) except: pass
def readline(self): if not self._file: if not self._files: return "" self._filename = self._files[0] self._files = self._files[1:] self._filelineno = 0 self._file = None self._isstdin = 0 self._backupfilename = 0 if self._filename == '-': self._filename = '<stdin>' self._file = sys.stdin self._isstdin = 1 else: if self...
dcb8583c180bc9c477f58f77166dc2abbccadc11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dcb8583c180bc9c477f58f77166dc2abbccadc11/fileinput.py
self.file.write('\n' + '\n'*blankline)
self.file.write('\n'*blankline)
def send_paragraph(self, blankline): self.file.write('\n' + '\n'*blankline) self.col = 0 self.atbreak = 0
f4bb656a4ff1b06c0af4e340edd60159a3d4522a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4bb656a4ff1b06c0af4e340edd60159a3d4522a/formatter.py
return getattr(self, self.err)
return getattr(self.err, attr)
def __getattr__(self, attr): return getattr(self, self.err)
846d6dbbe6b5663dc2437c46815fda98eb24a934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/846d6dbbe6b5663dc2437c46815fda98eb24a934/test_cgi.py
self.assertEqual(rem, 0) self.assertEqual(r1, r2)
self.assertEqual(rem, 0, '%s != 0 for %s' % (rem, i)) self.assertEqual(r1, r2, '%s != %s for %s' % (r1, r2, i))
def test_count(self): self.checkequal(3, 'aaa', 'count', 'a') self.checkequal(0, 'aaa', 'count', 'b') self.checkequal(3, 'aaa', 'count', 'a') self.checkequal(0, 'aaa', 'count', 'b') self.checkequal(3, 'aaa', 'count', 'a') self.checkequal(0, 'aaa', 'count', 'b') self.checkequal(0, 'aaa', 'count', 'b') self.checkequal(2,...
f71ec5a0acbf606abd8a19519829db8de20352ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f71ec5a0acbf606abd8a19519829db8de20352ec/string_tests.py
>>> print a.__dict__ {'default': -1000, 'x2': 200, 'x1': 100}
>>> print sortdict(a.__dict__) {'default': -1000, 'x1': 100, 'x2': 200}
>>> def sorted(seq):
e2052ab82aad273fa547fb91e09d63a15b3be305 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e2052ab82aad273fa547fb91e09d63a15b3be305/test_descrtut.py
"""Configure resources of an item.
"""Configure resources of an ITEM.
def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an item.
09f1ad854237542315ec86151aa56b143e54d1d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09f1ad854237542315ec86151aa56b143e54d1d2/Tkinter.py
self.file = self.sock.makefile('rb')
if self.file is None: self.file = self.sock.makefile('rb')
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
f123f84f66bded5a5554f7130cf823d53d3304cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f123f84f66bded5a5554f7130cf823d53d3304cd/smtplib.py
try: errcode = string.atoi(code) except ValueError: errcode = -1 break
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
f123f84f66bded5a5554f7130cf823d53d3304cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f123f84f66bded5a5554f7130cf823d53d3304cd/smtplib.py
try: errcode = string.atoi(code) except(ValueError): errcode = -1
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
f123f84f66bded5a5554f7130cf823d53d3304cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f123f84f66bded5a5554f7130cf823d53d3304cd/smtplib.py
for (extension_name, build_info) in extensions:
for (extension_name, build_info) in self.extensions:
def get_source_files (self):
48697d931bb86ddd114a42ccb89adb6374aef4ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48697d931bb86ddd114a42ccb89adb6374aef4ff/build_ext.py
if sources is None or type (sources) is not ListType:
if sources is None or type (sources) not in (ListType, TupleType):
def build_extensions (self, extensions):
48697d931bb86ddd114a42ccb89adb6374aef4ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48697d931bb86ddd114a42ccb89adb6374aef4ff/build_ext.py
includes=include_dirs)
include_dirs=include_dirs)
def build_extensions (self, extensions):
48697d931bb86ddd114a42ccb89adb6374aef4ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48697d931bb86ddd114a42ccb89adb6374aef4ff/build_ext.py
import sys
def __init__(self, indent=1, width=80, depth=None, stream=None): """Handle pretty printing operations onto a stream using a set of configured parameters.
1ef106c94d7ec70f6f4ca756fa47852404556b6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ef106c94d7ec70f6f4ca756fa47852404556b6d/pprint.py
if not (typ in (DictType, ListType, TupleType) and object):
if not (typ in (DictType, ListType, TupleType, StringType) and object):
def _safe_repr(object, context, maxlevels=None, level=0): level += 1 typ = type(object) if not (typ in (DictType, ListType, TupleType) and object): rep = `object` return rep, (rep and (rep[0] != '<')), 0 if context.has_key(id(object)): return `_Recursion(object)`, 0, 1 objid = id(object) context[objid] = 1 readable =...
1ef106c94d7ec70f6f4ca756fa47852404556b6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ef106c94d7ec70f6f4ca756fa47852404556b6d/pprint.py
for base in cls.__bases__: if hasattr(base, "_getDefaults"): defaults.update(base._getDefaults())
def _getDefaults(cls): defaults = {} for name, value in cls.__dict__.items(): if name[0] != "_" and not isinstance(value, (function, classmethod)): defaults[name] = deepcopy(value) for base in cls.__bases__: if hasattr(base, "_getDefaults"): defaults.update(base._getDefaults()) return defaults
ed8bfce0028ecd7e7c3b778f70b24d8d03809a05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ed8bfce0028ecd7e7c3b778f70b24d8d03809a05/bundlebuilder.py
self.ofp.write(struct.pack('>h', self.crc))
if self.crc < 0: fmt = '>h' else: fmt = '>H' self.ofp.write(struct.pack(fmt, self.crc))
def _writecrc(self): # XXXX Should this be here?? # self.crc = binascii.crc_hqx('\0\0', self.crc) self.ofp.write(struct.pack('>h', self.crc)) self.crc = 0
910a08f6da226b892b8bfdb69c61b80386627fd2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/910a08f6da226b892b8bfdb69c61b80386627fd2/binhex.py
copier = x.__deepcopy__ except AttributeError:
issc = issubclass(type(x), type) except TypeError: issc = 0 if issc: y = _deepcopy_dispatch[type](x, memo) else:
def deepcopy(x, memo = None): """Deep copy operation on arbitrary Python objects. See the module's __doc__ string for more info. """ if memo is None: memo = {} d = id(x) if d in memo: return memo[d] try: copierfunction = _deepcopy_dispatch[type(x)] except KeyError: try: copier = x.__deepcopy__ except AttributeError: ...
11ade1ddc053dcec884e2431b55fb1c1727c65d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/11ade1ddc053dcec884e2431b55fb1c1727c65d7/copy.py
reductor = x.__reduce__
copier = x.__deepcopy__
def deepcopy(x, memo = None): """Deep copy operation on arbitrary Python objects. See the module's __doc__ string for more info. """ if memo is None: memo = {} d = id(x) if d in memo: return memo[d] try: copierfunction = _deepcopy_dispatch[type(x)] except KeyError: try: copier = x.__deepcopy__ except AttributeError: ...
11ade1ddc053dcec884e2431b55fb1c1727c65d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/11ade1ddc053dcec884e2431b55fb1c1727c65d7/copy.py
raise error, \ "un-deep-copyable object of type %s" % type(x)
try: reductor = x.__reduce__ except AttributeError: raise error, \ "un-deep-copyable object of type %s" % type(x) else: y = _reconstruct(x, reductor(), 1, memo)
def deepcopy(x, memo = None): """Deep copy operation on arbitrary Python objects. See the module's __doc__ string for more info. """ if memo is None: memo = {} d = id(x) if d in memo: return memo[d] try: copierfunction = _deepcopy_dispatch[type(x)] except KeyError: try: copier = x.__deepcopy__ except AttributeError: ...
11ade1ddc053dcec884e2431b55fb1c1727c65d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/11ade1ddc053dcec884e2431b55fb1c1727c65d7/copy.py
y = _reconstruct(x, reductor(), 1, memo) else: y = copier(memo)
y = copier(memo)
def deepcopy(x, memo = None): """Deep copy operation on arbitrary Python objects. See the module's __doc__ string for more info. """ if memo is None: memo = {} d = id(x) if d in memo: return memo[d] try: copierfunction = _deepcopy_dispatch[type(x)] except KeyError: try: copier = x.__deepcopy__ except AttributeError: ...
11ade1ddc053dcec884e2431b55fb1c1727c65d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/11ade1ddc053dcec884e2431b55fb1c1727c65d7/copy.py
result.addError(self,self.__exc_info())
result.addError(self,sys.exc_info())
def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
result.addFailure(self,self.__exc_info())
result.addFailure(self,sys.exc_info())
def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
result.addError(self,self.__exc_info())
result.addError(self,sys.exc_info())
def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
result.addError(self,self.__exc_info())
result.addError(self,sys.exc_info())
def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
def __exc_info(self): """Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed. """ exctype, excvalue, tb = sys.exc_info() newtb = tb.tb_next if newtb is None: return (exctype, excvalue, tb) return (exctype, excvalue, newtb)
def __exc_info(self): """Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed. """ exctype, excvalue, tb = sys.exc_info() newtb = tb.tb_next if newtb is None: return (exctype, excvalue, tb) return (exctype, excvalue, newtb)
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
module = __import__(parts)
parts_copy = parts[:] while parts_copy: try: module = __import__(string.join(parts_copy,'.')) break except ImportError: del parts_copy[-1] if not parts_copy: raise
def loadTestsFromName(self, name, module=None): parts = string.split(name, '.') if module is None: if not parts: raise ValueError, "incomplete test name: %s" % name else: module = __import__(parts) parts = parts[1:] obj = module for part in parts: obj = getattr(obj, part)
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
Usage: %(progName)s [options] [test[:(casename|prefix-)]] [...]
Usage: %(progName)s [options] [test] [...]
def run(self, test): "Run the given test case or test suite." result = self._makeResult() startTime = time.time() test(result) stopTime = time.time() timeTaken = float(stopTime - startTime) result.printErrors() self.stream.writeln(result.separator2) run = result.testsRun self.stream.writeln("Ran %d test%s in %.3fs" % (...
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
screenbounds = Qd.qd.screenBits.bounds screenbounds = screenbounds[0]+4, screenbounds[1]+4, \ screenbounds[2]-4, screenbounds[3]-4
def AskYesNoCancel(question, default = 0):
1d63d8c8290e801f8a1d9041a8073e0ca79be56e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d63d8c8290e801f8a1d9041a8073e0ca79be56e/EasyDialogs.py
def __init__(self, label="Working...", maxval=100): self.label = label
def __init__(self, title="Working...", maxval=100, 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, label) self._update(0)
1d63d8c8290e801f8a1d9041a8073e0ca79be56e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d63d8c8290e801f8a1d9041a8073e0ca79be56e/EasyDialogs.py
SetDialogItemText(text_h, label) self._update(0)
SetDialogItemText(text_h, self._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, label) self._update(0)
1d63d8c8290e801f8a1d9041a8073e0ca79be56e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d63d8c8290e801f8a1d9041a8073e0ca79be56e/EasyDialogs.py
if ModalDialog(_ProgressBar_filterfunc) == 1: raise KeyboardInterrupt
ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 ) if ready : what,msg,when,where,mod = ev part = Win.FindWindow(where)[0] if Dlg.IsDialogEvent(ev): ds = Dlg.DialogSelect(ev) if ds[0] and ds[1] == self.d and ds[-1] == 1: raise KeyboardInterrupt, ev else: if part == 4: self.d.DragWindow(where, screenbounds) else: Ma...
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) l, t, r, b = inner_rect
1d63d8c8290e801f8a1d9041a8073e0ca79be56e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d63d8c8290e801f8a1d9041a8073e0ca79be56e/EasyDialogs.py
def _ProgressBar_filterfunc(*args): return 2
def inc(self, n=1): """inc(amt) - Increment progress bar position""" self.set(self.curval + n)
def set(self, value): if value < 0: value = 0 if value > self.maxval: value = self.maxval self._update(value)
1d63d8c8290e801f8a1d9041a8073e0ca79be56e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d63d8c8290e801f8a1d9041a8073e0ca79be56e/EasyDialogs.py
bar = ProgressBar("Counting...", 100) for i in range(100): bar.set(i) del bar
text = ( "Working Hard...", "Hardly Working..." , "So far, so good!", "Keep on truckin'" ) bar = ProgressBar("Progress, progress...", 100) try: appsw = MacOS.EnableAppswitch(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) finally: del bar...
def test(): Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") if ok > 0: s = AskString("Enter your first name") Message("Thank you,\015%s" % `s`) bar = ProgressBar("Counting...", 100) for i in range(100): bar.set(i) del bar
1d63d8c8290e801f8a1d9041a8073e0ca79be56e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d63d8c8290e801f8a1d9041a8073e0ca79be56e/EasyDialogs.py
test()
try: test() except KeyboardInterrupt: Message("Operation Canceled.")
def test(): Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") if ok > 0: s = AskString("Enter your first name") Message("Thank you,\015%s" % `s`) bar = ProgressBar("Counting...", 100) for i in range(100): bar.set(i) del bar
1d63d8c8290e801f8a1d9041a8073e0ca79be56e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d63d8c8290e801f8a1d9041a8073e0ca79be56e/EasyDialogs.py
self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args)
self.rpcpid = os.spawnv(os.P_NOWAIT, sys.executable, args)
def spawn_subprocess(self): args = self.subprocess_arglist self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args)
b785518d051dab322feafaed0fc79d7218ce6cb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b785518d051dab322feafaed0fc79d7218ce6cb0/PyShell.py
return [sys.executable] + w + ["-c", command, str(self.port)]
if sys.platform[:3] == 'win' and ' ' in sys.executable: decorated_exec = '"%s"' % sys.executable else: decorated_exec = sys.executable return [decorated_exec] + w + ["-c", command, str(self.port)]
def build_subprocess_arglist(self): w = ['-W' + s for s in sys.warnoptions] # Maybe IDLE is installed and is being accessed via sys.path, # or maybe it's not installed and the idle.py script is being # run from the IDLE source directory. del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc', default=False...
b785518d051dab322feafaed0fc79d7218ce6cb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b785518d051dab322feafaed0fc79d7218ce6cb0/PyShell.py
fp.write("\tif hasattr(v, '_superclassnames') and v._superclassnames:\n")
fp.write("\tif hasattr(v, '_superclassnames') and not hasattr(v, '_propdict'):\n")
fp.write("def getbaseclasses(v):\n")
7ff034b65b85265989b8fd256febc88ae9e8947d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ff034b65b85265989b8fd256febc88ae9e8947d/gensuitemodule.py
fp.write("\t\tv._superclassnames = None\n")
fp.write("def getbaseclasses(v):\n")
7ff034b65b85265989b8fd256febc88ae9e8947d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ff034b65b85265989b8fd256febc88ae9e8947d/gensuitemodule.py
def _cmp(a, b):
def _cmp(a, b, sh, st):
def _cmp(a, b): try: return not abs(cmp(a, b)) except os.error: return 2
afb17fc7b2782bddd74ffcf4f5b51efc9a9b4545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/afb17fc7b2782bddd74ffcf4f5b51efc9a9b4545/filecmp.py
return not abs(cmp(a, b))
return not abs(cmp(a, b, sh, st))
def _cmp(a, b): try: return not abs(cmp(a, b)) except os.error: return 2
afb17fc7b2782bddd74ffcf4f5b51efc9a9b4545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/afb17fc7b2782bddd74ffcf4f5b51efc9a9b4545/filecmp.py
sys.stderr.write('MH error: %\n' % (msg % args))
sys.stderr.write('MH error: %s\n' % (msg % args))
def error(self, msg, *args): sys.stderr.write('MH error: %\n' % (msg % args))
508a092e2e44332c2f1ac381bdb956e3b94e0cc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/508a092e2e44332c2f1ac381bdb956e3b94e0cc2/mhlib.py
mode = eval('0' + protect)
mode = string.atoi(protect, 8)
def makefolder(self, name): protect = pickline(self.profile, 'Folder-Protect') if protect and isnumeric(protect): mode = eval('0' + protect) else: mode = FOLDER_PROTECT os.mkdir(os.path.join(self.getpath(), name), mode)
508a092e2e44332c2f1ac381bdb956e3b94e0cc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/508a092e2e44332c2f1ac381bdb956e3b94e0cc2/mhlib.py
if isnumeric(name): messages.append(eval(name))
if name[0] != "," and \ numericprog.match(name) == len(name): messages.append(string.atoi(name))
def listmessages(self): messages = [] for name in os.listdir(self.getfullname()): if isnumeric(name): messages.append(eval(name)) messages.sort() if messages: self.last = max(messages) else: self.last = 0 return messages
508a092e2e44332c2f1ac381bdb956e3b94e0cc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/508a092e2e44332c2f1ac381bdb956e3b94e0cc2/mhlib.py
path = self.getmessagefilename(n)
def openmessage(self, n): path = self.getmessagefilename(n) return Message(self, n)
508a092e2e44332c2f1ac381bdb956e3b94e0cc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/508a092e2e44332c2f1ac381bdb956e3b94e0cc2/mhlib.py
newline = '%s: %s' % (key, value)
newline = '%s: %s\n' % (key, value)
def updateline(file, key, value, casefold = 1): try: f = open(file, 'r') lines = f.readlines() f.close() except IOError: lines = [] pat = key + ':\(.*\)\n' if casefold: prog = regex.compile(pat, regex.casefold) else: prog = regex.compile(pat) if value is None: newline = None else: newline = '%s: %s' % (key, value) for ...
508a092e2e44332c2f1ac381bdb956e3b94e0cc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/508a092e2e44332c2f1ac381bdb956e3b94e0cc2/mhlib.py
specialsre = re.compile(r'[][\()<>@,:;".]') escapesre = re.compile(r'[][\()"]')
specialsre = re.compile(r'[][\\()<>@,:;".]') escapesre = re.compile(r'[][\\()"]')
def _qdecode(s): import quopri as _quopri
a2369928b52ddcbadb5709cfa5df0b502d861090 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2369928b52ddcbadb5709cfa5df0b502d861090/Utils.py
if msilib.msi_type=="Intel64;1033": sqlite_arch = "/ia64" elif msilib.msi_type=="x64;1033": sqlite_arch = "/amd64" else: sqlite_arch = "" lib.add_file(srcdir+"/"+sqlite_dir+sqlite_arch+"/sqlite3.dll")
def add_files(db): cab = CAB("python") tmpfiles = [] # Add all executables, icons, text files into the TARGETDIR component root = PyDirectory(db, cab, None, srcdir, "TARGETDIR", "SourceDir") default_feature.set_current() if not msilib.Win64: root.add_file("PCBuild/w9xpopen.exe") root.add_file("README.txt", src="README"...
88ef6377773b9bafdec0c7d85d3eefccf8209c61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/88ef6377773b9bafdec0c7d85d3eefccf8209c61/msi.py
raise error, "flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags"
raise db.DBError, "flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags"
def open(filename, flags=db.DB_CREATE, mode=0660, filetype=db.DB_HASH, dbenv=None, dbname=None): """ A simple factory function for compatibility with the standard shleve.py module. It can be used like this, where key is a string and data is a pickleable object: from bsddb import dbshelve db = dbshelve.open(filename) ...
1281f76606cc4195f57d3446b42b97063c3adc1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1281f76606cc4195f57d3446b42b97063c3adc1d/dbshelve.py
data = cPickle.dumps(value, self.binary) return self.db.append(data, txn)
if self.get_type() != db.DB_RECNO: self.append = self.__append return self.append(value, txn=txn) raise db.DBError, "append() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO"
def append(self, value, txn=None): data = cPickle.dumps(value, self.binary) return self.db.append(data, txn)
1281f76606cc4195f57d3446b42b97063c3adc1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1281f76606cc4195f57d3446b42b97063c3adc1d/dbshelve.py
if os.sep != '/' and os.sep in pathname: raise ValueError, \ "path '%s' cannot contain '%c' character" % \ (pathname, os.sep) paths = string.split (pathname, '/') return apply (os.path.join, paths)
if os.sep != '/': if os.sep in pathname: raise ValueError, \ "path '%s' cannot contain '%c' character" % (pathname, os.sep) else: paths = string.split (pathname, '/') return apply (os.path.join, paths)
def native_path (pathname): """Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention...
464023fb64dd590b91cab7059dffdf0756eecbce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/464023fb64dd590b91cab7059dffdf0756eecbce/util.py
s = "\\pdfoutline goto name{page.%d}" % pageno
s = "\\pdfoutline goto name{page.%dx}" % pageno
def write_toc_entry(entry, fp, layer): stype, snum, title, pageno, toc = entry s = "\\pdfoutline goto name{page.%d}" % pageno if toc: s = "%s count -%d" % (s, len(toc)) if snum: title = "%s %s" % (snum, title) s = "%s {%s}\n" % (s, title) fp.write(s) for entry in toc: write_toc_entry(entry, fp, layer + 1)
a88d681255b8f4d5883e9ad245f00dae15c5c473 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a88d681255b8f4d5883e9ad245f00dae15c5c473/toc2bkm.py
try:
def __repr__ (self): try: status = [self.__class__.__module__+"."+self.__class__.__name__] 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...
eee80ee2efa5288b3e30d3336a9fce0ebdde68eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eee80ee2efa5288b3e30d3336a9fce0ebdde68eb/asyncore.py
if self.addr: if type(self.addr) == types.TupleType:
if self.addr is not None: try:
def __repr__ (self): try: status = [self.__class__.__module__+"."+self.__class__.__name__] 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...
eee80ee2efa5288b3e30d3336a9fce0ebdde68eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eee80ee2efa5288b3e30d3336a9fce0ebdde68eb/asyncore.py
else: status.append (self.addr)
except TypeError: status.append (repr(self.addr))
def __repr__ (self): try: status = [self.__class__.__module__+"."+self.__class__.__name__] 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...
eee80ee2efa5288b3e30d3336a9fce0ebdde68eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eee80ee2efa5288b3e30d3336a9fce0ebdde68eb/asyncore.py
except: pass try: ar = repr (self.addr) except AttributeError: ar = 'no self.addr!' return '<__repr__() failed for %s instance at %x (addr=%s)>' % \ (self.__class__.__name__, id (self), ar)
def __repr__ (self): try: status = [self.__class__.__module__+"."+self.__class__.__name__] 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...
eee80ee2efa5288b3e30d3336a9fce0ebdde68eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eee80ee2efa5288b3e30d3336a9fce0ebdde68eb/asyncore.py
"verify we can open a file known to be a hash v2 file"
def test_open_existing_hash(self): "verify we can open a file known to be a hash v2 file" db = bsddb185.hashopen(findfile("185test.db")) self.assertEqual(db["1"], "1") db.close()
065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d/test_bsddb185.py
"verify that whichdb correctly sniffs the known hash v2 file"
def test_whichdb(self): "verify that whichdb correctly sniffs the known hash v2 file" self.assertEqual(whichdb.whichdb(findfile("185test.db")), "bsddb185")
065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d/test_bsddb185.py
"verify that anydbm.open does *not* create a bsddb185 file"
def test_anydbm_create(self): "verify that anydbm.open does *not* create a bsddb185 file" tmpdir = tempfile.mkdtemp() try: try: dbfile = os.path.join(tmpdir, "foo.db") anydbm.open(dbfile, "c").close() ftype = whichdb.whichdb(findfile("foo.db")) self.assertNotEqual(ftype, "bsddb185") finally: os.unlink(dbfile) finally: ...
065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d/test_bsddb185.py
anydbm.open(dbfile, "c").close() ftype = whichdb.whichdb(findfile("foo.db"))
anydbm.open(os.path.splitext(dbfile)[0], "c").close() ftype = whichdb.whichdb(dbfile)
def test_anydbm_create(self): "verify that anydbm.open does *not* create a bsddb185 file" tmpdir = tempfile.mkdtemp() try: try: dbfile = os.path.join(tmpdir, "foo.db") anydbm.open(dbfile, "c").close() ftype = whichdb.whichdb(findfile("foo.db")) self.assertNotEqual(ftype, "bsddb185") finally: os.unlink(dbfile) finally: ...
065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/065f7b8626ac2cc7be26a3cc1bd5d9ba51b5125d/test_bsddb185.py
while not os.path.isdir(":Mac:Plugins"):
while not os.path.isdir(":Mac:PlugIns"):
def gotopluginfolder(): """Go to the plugin folder, assuming we are somewhere in the Python tree""" import os while not os.path.isdir(":Mac:Plugins"): os.chdir("::") os.chdir(":Mac:Plugins") if verbose: print "current directory is", os.getcwd()
786cb11e51ecc5b2cf402badcb3e5f056a65341d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/786cb11e51ecc5b2cf402badcb3e5f056a65341d/ConfigurePython.py
os.chdir(":Mac:Plugins")
os.chdir(":Mac:PlugIns")
def gotopluginfolder(): """Go to the plugin folder, assuming we are somewhere in the Python tree""" import os while not os.path.isdir(":Mac:Plugins"): os.chdir("::") os.chdir(":Mac:Plugins") if verbose: print "current directory is", os.getcwd()
786cb11e51ecc5b2cf402badcb3e5f056a65341d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/786cb11e51ecc5b2cf402badcb3e5f056a65341d/ConfigurePython.py
if not os.path.exists(src): if not os.path.exists(altsrc):
if not os.path.exists(os.path.join(sys.exec_prefix, src)): if not os.path.exists(os.path.join(sys.exec_prefix, altsrc)):
def mkcorealias(src, altsrc): import string import macostools version = string.split(sys.version)[0] dst = getextensiondirfile(src+ ' ' + version) if not os.path.exists(src): if not os.path.exists(altsrc): if verbose: print '*', src, 'not found' return 0 src = altsrc try: os.unlink(dst) except os.error: pass macostool...
786cb11e51ecc5b2cf402badcb3e5f056a65341d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/786cb11e51ecc5b2cf402badcb3e5f056a65341d/ConfigurePython.py
macostools.mkalias(src, dst)
macostools.mkalias(os.path.join(sys.exec_prefix, src), dst)
def mkcorealias(src, altsrc): import string import macostools version = string.split(sys.version)[0] dst = getextensiondirfile(src+ ' ' + version) if not os.path.exists(src): if not os.path.exists(altsrc): if verbose: print '*', src, 'not found' return 0 src = altsrc try: os.unlink(dst) except os.error: pass macostool...
786cb11e51ecc5b2cf402badcb3e5f056a65341d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/786cb11e51ecc5b2cf402badcb3e5f056a65341d/ConfigurePython.py
from distutils.core import DEBUG
def parse_config_files (self, filenames=None):
7146073850f16465b1888ad46e7dd4072f0a31cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7146073850f16465b1888ad46e7dd4072f0a31cd/dist.py
from distutils.core import DEBUG
def get_command_obj (self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return None. """ from distutils.core impo...
7146073850f16465b1888ad46e7dd4072f0a31cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7146073850f16465b1888ad46e7dd4072f0a31cd/dist.py
from distutils.core import DEBUG
def _set_command_options (self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command').
7146073850f16465b1888ad46e7dd4072f0a31cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7146073850f16465b1888ad46e7dd4072f0a31cd/dist.py
def small(text): return '<small>' + text + '</small>' def strong(text): return '<strong>' + text + '</strong>' def grey(text): return '<font color="
def small(text): if text: return '<small>' + text + '</small>' else: return '' def strong(text): if text: return '<strong>' + text + '</strong>' else: return '' def grey(text): if text: return '<font color=" else: return ''
def small(text): return '<small>' + text + '</small>'
5fcefdb32600fa64d3160f031d48fb033150fdb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5fcefdb32600fa64d3160f031d48fb033150fdb3/cgitb.py
'<big><big><strong>%s</strong></big></big>' % str(etype),
'<big><big>%s</big></big>' % strong(pydoc.html.escape(str(etype))),
def html((etype, evalue, etb), context=5): """Return a nice HTML document describing a given traceback.""" import os, types, time, traceback, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.tim...
5fcefdb32600fa64d3160f031d48fb033150fdb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5fcefdb32600fa64d3160f031d48fb033150fdb3/cgitb.py
function calls leading up to the error, in the order they occurred.'''
function calls leading up to the error, in the order they occurred.</p>'''
def html((etype, evalue, etb), context=5): """Return a nice HTML document describing a given traceback.""" import os, types, time, traceback, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.tim...
5fcefdb32600fa64d3160f031d48fb033150fdb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5fcefdb32600fa64d3160f031d48fb033150fdb3/cgitb.py
frames.append('''<p>
frames.append('''
def reader(lnum=[lnum]): highlight[lnum[0]] = 1 try: return linecache.getline(file, lnum[0]) finally: lnum[0] += 1
5fcefdb32600fa64d3160f031d48fb033150fdb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5fcefdb32600fa64d3160f031d48fb033150fdb3/cgitb.py
register("gnome", None, BackgroundBrowser(commd))
register("gnome", None, BackgroundBrowser(commd.split()))
def register_X_browsers(): # The default Gnome browser if _iscommand("gconftool-2"): # get the web browser string from gconftool gc = 'gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null' out = os.popen(gc) commd = out.read().strip() retncode = out.close() # if successful, register it if retncode is No...
bbcb2814f2745ddd652480c3a932911680881544 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbcb2814f2745ddd652480c3a932911680881544/webbrowser.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...
067d734f9e54fa7685ab9bd44e2221c04a52f292 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/067d734f9e54fa7685ab9bd44e2221c04a52f292/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...
067d734f9e54fa7685ab9bd44e2221c04a52f292 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/067d734f9e54fa7685ab9bd44e2221c04a52f292/Debugger.py
lines = f.readlines()
lines = [] line = f.readline() while line: lines.append(line.strip()) line = f.readline()
def read(self): opener = URLopener() f = opener.open(self.url) lines = f.readlines() self.errcode = opener.errcode if self.errcode == 401 or self.errcode == 403: self.disallow_all = 1 _debug("disallow all") elif self.errcode >= 400: self.allow_all = 1 _debug("allow all") elif self.errcode == 200 and lines: _debug("pars...
d22368ffb368198320d29518264a64a87b4f9b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d22368ffb368198320d29518264a64a87b4f9b03/robotparser.py
line = line.strip()
def parse(self, lines): """parse the input lines from a robot.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.""" state = 0 linenumber = 0 entry = Entry()
d22368ffb368198320d29518264a64a87b4f9b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d22368ffb368198320d29518264a64a87b4f9b03/robotparser.py
self.tries = 0 self.maxtries = 10
def __init__(self, *args): apply(urllib.FancyURLopener.__init__, (self,) + args) self.errcode = 200 self.tries = 0 self.maxtries = 10
d22368ffb368198320d29518264a64a87b4f9b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d22368ffb368198320d29518264a64a87b4f9b03/robotparser.py
def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): self.tries += 1 if self.tries >= self.maxtries: return self.http_error_default(url, fp, 500, "Internal Server Error: Redirect Recursion", headers) result = urllib.FancyURLopener.http_error_302(self, url, fp, errcode, errmsg, headers, data) self.tr...
def http_error_default(self, url, fp, errcode, errmsg, headers): self.errcode = errcode return urllib.FancyURLopener.http_error_default(self, url, fp, errcode, errmsg, headers)
d22368ffb368198320d29518264a64a87b4f9b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d22368ffb368198320d29518264a64a87b4f9b03/robotparser.py
frozendllmain_c, extensions_c] + files
frozendllmain_c, os.path.basename(extensions_c)] + files
def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] exclude = [] # settable with -x option addn_link = [] # settable with -l, but only honored under Windows. path = sys.p...
7039f50828473a030123d2bc2990532bcac9b5d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7039f50828473a030123d2bc2990532bcac9b5d9/freeze.py
def split(p): d, p = splitdrive(p) slashes = '' while p and p[-1:] in '/\\': slashes = slashes + p[-1] p = p[:-1] if p == '': p = p + slashes head, tail = '', '' for c in p: tail = tail + c if c in '/\\': head, tail = head + tail, '' slashes = '' while head and head[-1:] in '/\\': slashes = slashes + head[-1] head = he...
73e122f56383e15dc8045caeb5cc853430dd96e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73e122f56383e15dc8045caeb5cc853430dd96e9/ntpath.py
if c in '/\\':
if c in ['/','\\']:
def splitext(p): root, ext = '', '' for c in p: if c in '/\\': root, ext = root + ext + c, '' elif c == '.' or ext: ext = ext + c else: root = root + c return root, ext
73e122f56383e15dc8045caeb5cc853430dd96e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73e122f56383e15dc8045caeb5cc853430dd96e9/ntpath.py
elif c == '.' or ext:
elif c == '.': if ext: root, ext = root + ext, c else: ext = c elif ext:
def splitext(p): root, ext = '', '' for c in p: if c in '/\\': root, ext = root + ext + c, '' elif c == '.' or ext: ext = ext + c else: root = root + c return root, ext
73e122f56383e15dc8045caeb5cc853430dd96e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73e122f56383e15dc8045caeb5cc853430dd96e9/ntpath.py
save_warnings_filters = warnings.filters[:] globals = func.func_globals if '__warningregistry__' in globals: del globals['__warningregistry__'] warnings.filterwarnings("error", r"""^struct.*""", DeprecationWarning) warnings.filterwarnings("error", r""".*format requires.*""", DeprecationWarning)
def deprecated_err(func, *args): # The `warnings` module doesn't have an advertised way to restore # its filter list. Cheat. save_warnings_filters = warnings.filters[:] # Grrr, we need this function to warn every time. Without removing # the warningregistry, running test_tarfile then test_struct would fail # on 64-bi...
e6c9f982a057208e15f884384ba389778b8518c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6c9f982a057208e15f884384ba389778b8518c0/test_struct.py
try: func(*args) except (struct.error, TypeError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: raise TestFailed, "%s%s expected to raise struct.error" % ( func.__name__, args) else: raise TestFailed, "%s%s did not raise error" % (
func(*args) except (struct.error, TypeError): pass except DeprecationWarning: if not PY_STRUCT_OVERFLOW_MASKING: raise TestFailed, "%s%s expected to raise struct.error" % (
def deprecated_err(func, *args): # The `warnings` module doesn't have an advertised way to restore # its filter list. Cheat. save_warnings_filters = warnings.filters[:] # Grrr, we need this function to warn every time. Without removing # the warningregistry, running test_tarfile then test_struct would fail # on 64-bi...
e6c9f982a057208e15f884384ba389778b8518c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6c9f982a057208e15f884384ba389778b8518c0/test_struct.py
finally: warnings.filters[:] = save_warnings_filters[:]
else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) deprecated_err = with_warning_restore(deprecated_err)
def deprecated_err(func, *args): # The `warnings` module doesn't have an advertised way to restore # its filter list. Cheat. save_warnings_filters = warnings.filters[:] # Grrr, we need this function to warn every time. Without removing # the warningregistry, running test_tarfile then test_struct would fail # on 64-bi...
e6c9f982a057208e15f884384ba389778b8518c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6c9f982a057208e15f884384ba389778b8518c0/test_struct.py