rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
self._file.seek(0, 2) self._file_length = self._file.tell()
def _generate_toc(self): """Generate key-to-(start, stop) table of contents.""" starts, stops = [], [] self._file.seek(0) next_pos = 0 label_lists = [] while True: line_pos = next_pos line = self._file.readline() next_pos = self._file.tell() if line == '\037\014' + os.linesep: if len(stops) < len(starts): stops.append(...
02edb28d051210c4c2067bb5857dcb8965f81bae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02edb28d051210c4c2067bb5857dcb8965f81bae/mailbox.py
exec("""def __%(method)s__(self, *args):
exec """def __%(method)s__(self, *args):
exec("""def __%(method)s__(self, *args): print "__%(method)s__:", args
30070b29a906b89aa0167c41e37bcd4dce483321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30070b29a906b89aa0167c41e37bcd4dce483321/test_class.py
"""%locals(), AllTests.__dict__);
"""%locals() in AllTests.__dict__
exec("""def __%(method)s__(self, *args): print "__%(method)s__:", args
30070b29a906b89aa0167c41e37bcd4dce483321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30070b29a906b89aa0167c41e37bcd4dce483321/test_class.py
f.seek(0)
def test_truncate(self): eq = self.assertEqual f = self.MODULE.StringIO() f.write(self._lines) f.seek(10) f.truncate() eq(f.getvalue(), 'abcdefghij') f.seek(0) f.truncate(5) eq(f.getvalue(), 'abcde') f.close() self.assertRaises(ValueError, f.write, 'frobnitz')
d46fa054924ab904f291940c65c8eea6341ec139 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d46fa054924ab904f291940c65c8eea6341ec139/test_StringIO.py
def testMultiply(self);
def testMultiply(self):
def testMultiply(self); self.assertEquals((0 * 10), 0) self.assertEquals((5 * 8), 40)
fda3a193436562e79bcd598f024a5c115e31f3fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fda3a193436562e79bcd598f024a5c115e31f3fa/unittest.py
contain tuples of (testcase, exceptioninfo), where exceptioninfo is a tuple of values as returned by sys.exc_info().
contain tuples of (testcase, exceptioninfo), where exceptioninfo is the formatted traceback of the error that occurred
def testMultiply(self); self.assertEquals((0 * 10), 0) self.assertEquals((5 * 8), 40)
fda3a193436562e79bcd598f024a5c115e31f3fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fda3a193436562e79bcd598f024a5c115e31f3fa/unittest.py
"Called when an error has occurred" self.errors.append((test, err))
"""Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info(). """ self.errors.append((test, self._exc_info_to_string(err)))
def addError(self, test, err): "Called when an error has occurred" self.errors.append((test, err))
fda3a193436562e79bcd598f024a5c115e31f3fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fda3a193436562e79bcd598f024a5c115e31f3fa/unittest.py
"Called when a failure has occurred" self.failures.append((test, err))
"""Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().""" self.failures.append((test, self._exc_info_to_string(err)))
def addFailure(self, test, err): "Called when a failure has occurred" self.failures.append((test, err))
fda3a193436562e79bcd598f024a5c115e31f3fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fda3a193436562e79bcd598f024a5c115e31f3fa/unittest.py
for line in apply(traceback.format_exception, err): for l in string.split(line,"\n")[:-1]: self.stream.writeln("%s" % l)
self.stream.writeln("%s" % err)
def printErrorList(self, flavour, errors): for test, err in errors: self.stream.writeln(self.separator1) self.stream.writeln("%s: %s" % (flavour,self.getDescription(test))) self.stream.writeln(self.separator2) for line in apply(traceback.format_exception, err): for l in string.split(line,"\n")[:-1]: self.stream.writeln...
fda3a193436562e79bcd598f024a5c115e31f3fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fda3a193436562e79bcd598f024a5c115e31f3fa/unittest.py
spec_file.append('Source0: %{name}-%{version}.tar.bz2')
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.repl...
ff1a21a4aeb64a346b28b694dfe3a94ca76c3d3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff1a21a4aeb64a346b28b694dfe3a94ca76c3d3a/bdist_rpm.py
spec_file.append('Source0: %{name}-%{version}.tar.gz')
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.repl...
ff1a21a4aeb64a346b28b694dfe3a94ca76c3d3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff1a21a4aeb64a346b28b694dfe3a94ca76c3d3a/bdist_rpm.py
('prep', 'prep_script', "%setup"),
('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.repl...
ff1a21a4aeb64a346b28b694dfe3a94ca76c3d3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff1a21a4aeb64a346b28b694dfe3a94ca76c3d3a/bdist_rpm.py
origin_req_host = cookielib.request_host(self)
origin_req_host = request_host(self)
def __init__(self, url, data=None, headers={}, origin_req_host=None, unverifiable=False): # unwrap('<URL:type://host/path>') --> 'type://host/path' self.__original = unwrap(url) self.type = None # self.__r_type is what's left after doing the splittype self.host = None self.port = None self.data = data self.headers = {}...
8d4c20e0146b99c7f6d61cdcdd906d6df062b865 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8d4c20e0146b99c7f6d61cdcdd906d6df062b865/urllib2.py
if inspect.isclass(check):
if isclass(check):
def build_opener(*handlers): """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP and FTP. If any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used. """ opener = OpenerDirector() de...
8d4c20e0146b99c7f6d61cdcdd906d6df062b865 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8d4c20e0146b99c7f6d61cdcdd906d6df062b865/urllib2.py
if inspect.isclass(h):
if isclass(h):
def build_opener(*handlers): """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP and FTP. If any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used. """ opener = OpenerDirector() de...
8d4c20e0146b99c7f6d61cdcdd906d6df062b865 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8d4c20e0146b99c7f6d61cdcdd906d6df062b865/urllib2.py
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.called...
d3a06038ac78c63781c2f43d7b89ba6dc1234ba2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d3a06038ac78c63781c2f43d7b89ba6dc1234ba2/trace.py
thingie = pickle.load(open(self.infile, 'r')) if isinstance(thingie, dict): self.update(self.__class__(thingie)) elif isinstance(thingie, tuple) and len(thingie) == 2: counts, calledfuncs = thingie self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError), err:
counts, calledfuncs = pickle.load(open(self.infile, 'r')) self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError, ValueError), err:
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.called...
d3a06038ac78c63781c2f43d7b89ba6dc1234ba2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d3a06038ac78c63781c2f43d7b89ba6dc1234ba2/trace.py
bool,
def update(self): self.w.browser.update()
a31b9562fa60d4de0be9dfdd99f5bf0ad26178b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a31b9562fa60d4de0be9dfdd99f5bf0ad26178b1/PyBrowser.py
items = map(None, range(len(seq)), seq) items = map(lambda (k, v), type = type, simp = SIMPLE_TYPES, indent = indent: (k, v, not type(v) in simp, indent), items) return items
return [(i, v, not isinstance(v, SIMPLE_TYPES), indent) for i, v in enumerate(seq)]
def unpack_sequence(seq, indent = 0): items = map(None, range(len(seq)), seq) items = map(lambda (k, v), type = type, simp = SIMPLE_TYPES, indent = indent: (k, v, not type(v) in simp, indent), items) return items
a31b9562fa60d4de0be9dfdd99f5bf0ad26178b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a31b9562fa60d4de0be9dfdd99f5bf0ad26178b1/PyBrowser.py
def buildappbundle(executable, output=None, copyfunc=None, creator=None, plist=None, nib=None, resources=None): if not output: output = os.path.split(executable)[1] + '.app' if not copyfunc: copyfunc = shutil.copy2 if not creator: creator='????' if not resources: resources = [] if nib: resources = resources + [nib] ...
def buildappbundle(executable, output=None, copyfunc=None, creator=None, plist=None, nib=None, resources=None): if not output: output = os.path.split(executable)[1] + '.app' if not copyfunc: copyfunc = shutil.copy2 if not creator: creator='????' if not resources: resources = [] if nib: resources = resources + [nib] # #...
e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17/buildappbundle.py
print "buildappbundle creates an application bundle" print "Usage:" print " buildappbundle [options] executable" print "Options:" print " --output o Output file; default executable with .app appended, short -o" print " --link Symlink the executable (default: copy), short -l" print " --plist file Plist fi...
print __doc__
def usage(): print "buildappbundle creates an application bundle" print "Usage:" print " buildappbundle [options] executable" print "Options:" print " --output o Output file; default executable with .app appended, short -o" print " --link Symlink the executable (default: copy), short -l" print " --plist f...
e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17/buildappbundle.py
output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help")
output = None symlink = 0 creator = "????" plist = None nib = None resources = [] verbosity = 0 SHORTOPTS = "o:ln:r:p:c:v?h" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help", "verbose")
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17/buildappbundle.py
copyfunc = os.symlink
symlink = 1
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17/buildappbundle.py
elif opt in ('-?', '--help'):
elif opt in ('-v', '--verbose'): verbosity += 1 elif opt in ('-?', '-h', '--help'):
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17/buildappbundle.py
buildappbundle(args[0], output=output, copyfunc=copyfunc, creator=creator, plist=plist, resources=resources)
if output is not None: builddir, bundlename = os.path.split(output) else: builddir = os.curdir bundlename = None if plist is not None: plist = Plist.fromFile(plist) builder = AppBuilder(name=bundlename, executable=executable, builddir=builddir, creator=creator, plist=plist, resources=resources, symlink=symlink, verbos...
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17/buildappbundle.py
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9d33f103e82fa58ed5906c6ccf3ccd9d68cdd17/buildappbundle.py
def updatecache(filename): """Update a cache entry and return its list of lines. If something's wrong, print a message, discard the cache entry, and return an empty list.""" if cache.has_key(filename): del cache[filename] if not filename or filename[0] + filename[-1] == '<>': return [] fullname = filename try: stat = ...
c190a197b3662c9fb19ad7c57343231c4f26e491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c190a197b3662c9fb19ad7c57343231c4f26e491/linecache.py
fullname = os.path.join(dirname, basename)
def updatecache(filename): """Update a cache entry and return its list of lines. If something's wrong, print a message, discard the cache entry, and return an empty list.""" if cache.has_key(filename): del cache[filename] if not filename or filename[0] + filename[-1] == '<>': return [] fullname = filename try: stat = ...
c190a197b3662c9fb19ad7c57343231c4f26e491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c190a197b3662c9fb19ad7c57343231c4f26e491/linecache.py
stat = os.stat(fullname) break except os.error:
fullname = os.path.join(dirname, basename) except (TypeError, AttributeError):
def updatecache(filename): """Update a cache entry and return its list of lines. If something's wrong, print a message, discard the cache entry, and return an empty list.""" if cache.has_key(filename): del cache[filename] if not filename or filename[0] + filename[-1] == '<>': return [] fullname = filename try: stat = ...
c190a197b3662c9fb19ad7c57343231c4f26e491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c190a197b3662c9fb19ad7c57343231c4f26e491/linecache.py
interp_path = os.path.join(sys.exec_prefix, "bin", "python")
interp_path = os.path.join(sys.exec_prefix, "Resources", "Python.app", "Contents", "MacOS", "Python") if not os.path.exists(interp_path): interp_path = os.path.join(sys.exec_prefix, "bin", "python")
def _run_with_cl_interpreter(self): import Terminal interp_path = os.path.join(sys.exec_prefix, "bin", "python") file_path = self.path if not os.path.exists(interp_path): # This "can happen" if we are running IDE under MacPython-OS9. raise W.AlertError, "Can't find command-line Python" cmd = '"%s" "%s" ; exit' % (inter...
4100ecb8775b46f7723c3b70ed948f9faa155c25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4100ecb8775b46f7723c3b70ed948f9faa155c25/PyEdit.py
t.do_script(with_command=cmd)
t.do_script(cmd)
def _run_with_cl_interpreter(self): import Terminal interp_path = os.path.join(sys.exec_prefix, "bin", "python") file_path = self.path if not os.path.exists(interp_path): # This "can happen" if we are running IDE under MacPython-OS9. raise W.AlertError, "Can't find command-line Python" cmd = '"%s" "%s" ; exit' % (inter...
4100ecb8775b46f7723c3b70ed948f9faa155c25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4100ecb8775b46f7723c3b70ed948f9faa155c25/PyEdit.py
if time.strftime(directive, time_tuple).find('00'):
if '00' in time.strftime(directive, time_tuple):
def __calc_date_time(self): # Set self.date_time, self.date, & self.time by using # time.strftime().
8e5d300333160c9b1c3467a7b83fbe1c0451e15f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8e5d300333160c9b1c3467a7b83fbe1c0451e15f/_strptime.py
list.append('%s: %s\n' % (str(stype), str(value))) return list
list.append('%s: %s\n' % (str(stype), _some_str(value))) return list def _some_str(value): try: return str(value) except: return '<unprintable %s object>' % type(value).__name__
def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError...
395120312fa2fe6ac8b2d5bbe9001ad3ed958f59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/395120312fa2fe6ac8b2d5bbe9001ad3ed958f59/traceback.py
def loop(timeout=30.0, use_poll=0, map=None):
def loop(timeout=30.0, use_poll=False, map=None):
def loop(timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll and hasattr(select, 'poll'): poll_fun = poll2 else: poll_fun = poll while map: poll_fun(timeout, map)
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
debug = 0 connected = 0 accepting = 0 closing = 0
debug = False connected = False accepting = False closing = False
def loop(timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll and hasattr(select, 'poll'): poll_fun = poll2 else: poll_fun = poll while map: poll_fun(timeout, map)
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.connected = 1
self.connected = True
def __init__(self, sock=None, map=None): if map is None: self._map = socket_map else: self._map = map
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.accepting = 1
self.accepting = True
def listen(self, num): self.accepting = 1 if os.name == 'nt' and num > 5: num = 1 return self.socket.listen(num)
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.connected = 0
self.connected = False
def connect(self, address): self.connected = 0 err = self.socket.connect_ex(address) # XXX Should interpret Winsock return values if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): return if err in (0, EISCONN): self.addr = address self.connected = 1 self.handle_connect() else: raise socket.error, err
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.connected = 1
self.connected = True
def connect(self, address): self.connected = 0 err = self.socket.connect_ex(address) # XXX Should interpret Winsock return values if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): return if err in (0, EISCONN): self.addr = address self.connected = 1 self.handle_connect() else: raise socket.error, err
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.connected = 1
self.connected = True
def handle_read_event(self): if self.accepting: # for an accepting socket, getting a read implies # that we are connected if not self.connected: self.connected = 1 self.handle_accept() elif not self.connected: self.handle_connect() self.connected = 1 self.handle_read() else: self.handle_read()
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.connected = 1
self.connected = True
def handle_read_event(self): if self.accepting: # for an accepting socket, getting a read implies # that we are connected if not self.connected: self.connected = 1 self.handle_accept() elif not self.connected: self.handle_connect() self.connected = 1 self.handle_read() else: self.handle_read()
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.connected = 1
self.connected = True
def handle_write_event(self): # getting a write implies that we are connected if not self.connected: self.handle_connect() self.connected = 1 self.handle_write()
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
self.connected = 1
self.connected = True
def __init__(self, fd): dispatcher.__init__(self) self.connected = 1 # set it to non-blocking mode flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0) flags = flags | os.O_NONBLOCK fcntl.fcntl(fd, fcntl.F_SETFL, flags) self.set_file(fd)
f94fbfa5fad912cd8d3e8c9796714e413449545b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94fbfa5fad912cd8d3e8c9796714e413449545b/asyncore.py
try: import win32api import win32con except ImportError:
if not _can_read_reg:
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
for base in (win32con.HKEY_CLASSES_ROOT, win32con.HKEY_LOCAL_MACHINE, win32con.HKEY_CURRENT_USER, win32con.HKEY_USERS):
for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS):
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
k = win32api.RegOpenKeyEx(base,K)
k = _RegOpenKeyEx(base,K)
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
p = win32api.RegEnumKey(k,i)
p = _RegEnumKey(k,i)
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
except win32api.error:
except _RegError:
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
except win32api.error:
except _RegError:
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
try: import win32api import win32con except ImportError:
if not _can_read_reg:
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" try: import win32api import win32con except ImportError: return [] L = [] i...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
for base in (win32con.HKEY_CLASSES_ROOT, win32con.HKEY_LOCAL_MACHINE, win32con.HKEY_CURRENT_USER, win32con.HKEY_USERS):
for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS):
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" try: import win32api import win32con except ImportError: return [] L = [] i...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
k = win32api.RegOpenKeyEx(base,K)
k = _RegOpenKeyEx(base,K)
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" try: import win32api import win32con except ImportError: return [] L = [] i...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
(p,v,t) = win32api.RegEnumValue(k,i)
(p,v,t) = _RegEnumValue(k,i)
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" try: import win32api import win32con except ImportError: return [] L = [] i...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
except win32api.error:
except _RegError:
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" try: import win32api import win32con except ImportError: return [] L = [] i...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
except win32api.error:
except _RegError:
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" try: import win32api import win32con except ImportError: return [] L = [] i...
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
return None
return self.pimpprefs.check()
def setuppimp(self, url): self.pimpprefs = pimp.PimpPreferences() self.pimpdb = pimp.PimpDatabase(self.pimpprefs) self.pimpinstaller = pimp.PimpInstaller(self.pimpdb) if not url: url = self.pimpprefs.pimpDatabase try: self.pimpdb.appendURL(url) except IOError, arg: return "Cannot open %s: %s" % (url, arg) return None
c2a603ef4072459f4f476169491c81c7af0e21ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2a603ef4072459f4f476169491c81c7af0e21ad/PackageManager.py
"""Return a random string usable as a multipart boundary. The method used is so that it is *very* unlikely that the same string of characters will every occur again in the Universe, so the caller needn't check the data it is packing for the occurrence of the boundary.
"""Return a string usable as a multipart boundary. The string chosen is unique within a single program run, and incorporates the user id (if available), process id (if available), and current time. So it's very unlikely the returned string appears in message text, but there's no guarantee.
def choose_boundary(): """Return a random string usable as a multipart boundary. The method used is so that it is *very* unlikely that the same string of characters will every occur again in the Universe, so the caller needn't check the data it is packing for the occurrence of the boundary. The boundary contains dots ...
b88933f5ae6ea190eaa76d2a1423cf8300d4bab1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b88933f5ae6ea190eaa76d2a1423cf8300d4bab1/mimetools.py
timestamp = '%.3f' % time.time() seed = `random.randint(0, 32767)` return _prefix + '.' + timestamp + '.' + seed
return "%s.%.3f.%d" % (_prefix, time.time(), _get_next_counter())
def choose_boundary(): """Return a random string usable as a multipart boundary. The method used is so that it is *very* unlikely that the same string of characters will every occur again in the Universe, so the caller needn't check the data it is packing for the occurrence of the boundary. The boundary contains dots ...
b88933f5ae6ea190eaa76d2a1423cf8300d4bab1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b88933f5ae6ea190eaa76d2a1423cf8300d4bab1/mimetools.py
editor.ted.WEUseText(Res.Resource(Text)) editor.ted.WECalText() editor.SetPort() editor.GetWindow().InvalWindowRect(editor._bounds)
editor.set(Text)
def replaceall(self): editor = findeditor(self) if not editor: return if self.visible: self.getparmsfromwindow() W.SetCursor("watch") find = self.parms["find"] if not find: return findlen = len(find) replace = self.parms["replace"] replacelen = len(replace) Text = editor.get() if not self.parms["casesens"]: find = stri...
33a2ed43cf3eeee59cd862ac6ebbdb178363c6f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33a2ed43cf3eeee59cd862ac6ebbdb178363c6f2/PyEdit.py
tmpdir = os.path.realpath(tmpdir)
cwd = os.getcwd() os.chdir(tmpdir) tmpdir = os.getcwd() os.chdir(cwd)
def test_cwd(self): tmpdir = os.getenv("TEMP", "/tmp") tmpdir = os.path.realpath(tmpdir) p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' \ 'sys.stdout.write(os.getcwd())'], stdout=subprocess.PIPE, cwd=tmpdir) normcase = os.path.normcase self.assertEqual(normcase(p.stdout.read()), normcase(tmpdir))
ce5241099ff6131975a3e947fb3e95206b9dd588 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ce5241099ff6131975a3e947fb3e95206b9dd588/test_subprocess.py
+ If you continue a line via backslashing in an interactive session, or for any other reason use a backslash, you need to double the backslash in the docstring version. This is simply because you're in a string, and so the backslash must be escaped for it to survive intact. Like: >>> if "yes" == \\ ... "y" + \...
+ If you continue a line via backslashing in an interactive session, or for any other reason use a backslash, you should use a raw docstring, which will preserve your backslahses exactly as you type them: >>> def f(x): ... r'''Backslashes in a raw docstring: m\n''' >>> print f.__doc__ Backslashes in a raw docstrin...
def _test(): import doctest import sys verbose = "-v" in sys.argv for mod in modules: doctest.testmod(mod, verbose=verbose, report=0) doctest.master.summarize()
651b47440af47278ada127b05ed0edf0823a735b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/651b47440af47278ada127b05ed0edf0823a735b/doctest.py
tabnanny.reset_globals()
def tabnanny(self, filename): import tabnanny import tokenize tabnanny.reset_globals() f = open(filename, 'r') try: tokenize.tokenize(f.readline, tabnanny.tokeneater) except tokenize.TokenError, msg: self.errorbox("Token error", "Token error:\n%s" % str(msg)) return 0 except tabnanny.NannyNag, nag: # The error messages...
49b4f6b194551ba768e422fae957cccebe69adf2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49b4f6b194551ba768e422fae957cccebe69adf2/ScriptBinding.py
tokenize.tokenize(f.readline, tabnanny.tokeneater)
tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
def tabnanny(self, filename): import tabnanny import tokenize tabnanny.reset_globals() f = open(filename, 'r') try: tokenize.tokenize(f.readline, tabnanny.tokeneater) except tokenize.TokenError, msg: self.errorbox("Token error", "Token error:\n%s" % str(msg)) return 0 except tabnanny.NannyNag, nag: # The error messages...
49b4f6b194551ba768e422fae957cccebe69adf2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49b4f6b194551ba768e422fae957cccebe69adf2/ScriptBinding.py
def __init__(self, sock, debuglevel=0):
def __init__(self, sock, debuglevel=0, strict=0):
def __init__(self, sock, debuglevel=0): self.fp = sock.makefile('rb', 0) self.debuglevel = debuglevel
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
version = "HTTP/0.9" status = "200" reason = "" if version[:5] != 'HTTP/': self.close() raise BadStatusLine(line)
version = "" if not version.startswith('HTTP/'): if self.strict: self.close() raise BadStatusLine(line) else: self.fp = LineAndFileWrapper(line, self.fp) return "HTTP/0.9", 200, ""
def _read_status(self): line = self.fp.readline() if self.debuglevel > 0: print "reply:", repr(line) try: [version, status, reason] = line.split(None, 2) except ValueError: try: [version, status] = line.split(None, 1) reason = "" except ValueError: version = "HTTP/0.9" status = "200" reason = "" if version[:5] != 'HTTP...
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
def __init__(self, host, port=None):
strict = 0 def __init__(self, host, port=None, strict=None):
def getheader(self, name, default=None): if self.msg is None: raise ResponseNotReady() return self.msg.getheader(name, default)
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
def __init__(self, host, port=None): self.sock = None self.__response = None self.__state = _CS_IDLE
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
response = self.response_class(self.sock, self.debuglevel) else: response = self.response_class(self.sock)
response = self.response_class(self.sock, self.debuglevel, strict=self.strict) else: response = self.response_class(self.sock, strict=self.strict)
def getresponse(self): "Get the response from the server."
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
def __init__(self, host, port=None, key_file=None, cert_file=None): HTTPConnection.__init__(self, host, port)
def __init__(self, host, port=None, key_file=None, cert_file=None, strict=None): HTTPConnection.__init__(self, host, port, strict)
def __init__(self, host, port=None, key_file=None, cert_file=None): HTTPConnection.__init__(self, host, port) self.key_file = key_file self.cert_file = cert_file
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
def __init__(self, host='', port=None):
def __init__(self, host='', port=None, strict=None):
def __init__(self, host='', port=None): "Provide a default host, since the superclass requires one."
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
self._setup(self._connection_class(host, port))
self._setup(self._connection_class(host, port, strict))
def __init__(self, host='', port=None): "Provide a default host, since the superclass requires one."
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
def __init__(self, host='', port=None, **x509):
def __init__(self, host='', port=None, key_file=None, cert_file=None, strict=None):
def __init__(self, host='', port=None, **x509): # provide a default host, pass the X509 cert info
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
self._setup(self._connection_class(host, port, **x509))
self._setup(self._connection_class(host, port, key_file, cert_file, strict))
def __init__(self, host='', port=None, **x509): # provide a default host, pass the X509 cert info
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file')
self.key_file = key_file self.cert_file = cert_file
def __init__(self, host='', port=None, **x509): # provide a default host, pass the X509 cert info
6d636f9fc61e4b385bf7a786538edd4605353b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d636f9fc61e4b385bf7a786538edd4605353b13/httplib.py
supported_dists=('SuSE','debian','redhat','mandrake')):
supported_dists=('SuSE', 'debian', 'fedora', 'redhat', 'mandrake')):
def dist(distname='',version='',id='', supported_dists=('SuSE','debian','redhat','mandrake')): """ Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in /etc and then reverts to _dist_try_harder() in case no suitable files are found. Returns a tup...
ccc2a5b2493fee9a85ba9fb0fe7968b61af99d17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ccc2a5b2493fee9a85ba9fb0fe7968b61af99d17/platform.py
def run (self):
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
info = metadata.long_description + '\n'
info = metadata.long_description or '' + '\n'
def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst.
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
inifile.write ("pyc_compile=%d\n" % self.target_compile) inifile.write ("pyo_compile=%d\n" % self.target_optimize)
def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst.
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
vers_minor = string.split (self.target_version, '.')[1] inifile.write ("vers_minor=%s\n" % vers_minor)
inifile.write ("target_version=%s\n" % self.target_version)
def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst.
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
import struct, zlib
import struct
def create_exe (self, arcname, fullname): import struct, zlib
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
comp_method = zlib.DEFLATED co = zlib.compressobj (zlib.Z_DEFAULT_COMPRESSION, comp_method, -15) zcfgdata = co.compress (cfgdata) + co.flush()
def create_exe (self, arcname, fullname): import struct, zlib
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
file.write (zcfgdata) crc32 = zlib.crc32 (cfgdata) header = struct.pack ("<iiiiiiii", 0x12345678, comp_method, crc32, len (cfgdata), len (zcfgdata), 0, 0, 0)
file.write (cfgdata) header = struct.pack ("<ii", 0x12345679, len (cfgdata))
def create_exe (self, arcname, fullname): import struct, zlib
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
import zlib, base64 return zlib.decompress (base64.decodestring (EXEDATA))
import base64 return base64.decodestring (EXEDATA)
def get_exe_bytes (self): import zlib, base64 return zlib.decompress (base64.decodestring (EXEDATA))
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
import zlib, base64 file = r"c:\wininst\wininst.exe"
import base64 file = r"..\..\misc\wininst.exe"
def get_exe_bytes (self): import zlib, base64 return zlib.decompress (base64.decodestring (EXEDATA))
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
cdata = zlib.compress (data, 9) bdata = base64.encodestring (cdata)
bdata = base64.encodestring (data)
def get_exe_bytes (self): import zlib, base64 return zlib.decompress (base64.decodestring (EXEDATA))
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
print "%d %d %d" % (len (data), len (cdata), len (bdata)) EXEDATA = """ eNrtfQt4U9eV7pEl28IIJIJNlMRJlCBaN3JcE5uMiYDK2HJMsI1s2TIkDsbYMrLwK9IRj4akENkT DhvlMU06aW/bSZp2pnMnM5OZ5jY0bYONSQzkwcMp0JJpIO1NZQyEJATMU/df+2z5BalnvszMN/f7 fPi29jl7r7X2WmuvvdbaW0em9P6nJK0kSTqUWEyStknq5ZDGv46iTL31tanSK5PeuW2bpuSd2yp9 TUFLe6BtVaCuxVJf...
print "%d %d" % (len (data), len (bdata)) EXEDATA = """\ TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAA4AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ZGUuDQ0KJAAAAAAAAADq0pWMrrP7366z+9+us/vf1a/336+z+98tr/XfrLP731GT/9+ss/vfzKzo 36az+9+us/rf9rP7366z+9+js/vfUZP...
def get_exe_bytes (self): import zlib, base64 return zlib.decompress (base64.decodestring (EXEDATA))
485dbaf1a2f675601619bb4d577c072654460eec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/485dbaf1a2f675601619bb4d577c072654460eec/bdist_wininst.py
def testboth(formatstr, *args): testformat(formatstr, *args) testformat(unicode(formatstr), *args)
f9d20acd9e7f7aa53b8d24fbe83f144f45b1a658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f9d20acd9e7f7aa53b8d24fbe83f144f45b1a658/test_format.py
def test_getstatus(self): # This pattern should match 'ls -ld /bin/ls' on any posix # system, however perversely configured. pat = r'''[l-]..x..x..x # It is executable. (May be a symlink.) \s+\d+ # It has some number of links. \s+\w+\s+\w+ # It has a user and group, which may # be named anything. [^/]* ...
b78d4701a1f3bdb036d433cf90a93c4345713ca7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b78d4701a1f3bdb036d433cf90a93c4345713ca7/test_commands.py
pat = r'''[l-]..x..x..x
pat = r'''d.........
def test_getstatus(self): # This pattern should match 'ls -ld /bin/ls' on any posix # system, however perversely configured. pat = r'''[l-]..x..x..x # It is executable. (May be a symlink.) \s+\d+ # It has some number of links. \s+\w+\s+\w+ # It has a user and group, which may # be named anything. [^/]* ...
b78d4701a1f3bdb036d433cf90a93c4345713ca7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b78d4701a1f3bdb036d433cf90a93c4345713ca7/test_commands.py
/bin/ls
/.
def test_getstatus(self): # This pattern should match 'ls -ld /bin/ls' on any posix # system, however perversely configured. pat = r'''[l-]..x..x..x # It is executable. (May be a symlink.) \s+\d+ # It has some number of links. \s+\w+\s+\w+ # It has a user and group, which may # be named anything. [^/]* ...
b78d4701a1f3bdb036d433cf90a93c4345713ca7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b78d4701a1f3bdb036d433cf90a93c4345713ca7/test_commands.py
self.assert_(re.match(pat, getstatus("/bin/ls"), re.VERBOSE))
self.assert_(re.match(pat, getstatus("/."), re.VERBOSE))
def test_getstatus(self): # This pattern should match 'ls -ld /bin/ls' on any posix # system, however perversely configured. pat = r'''[l-]..x..x..x # It is executable. (May be a symlink.) \s+\d+ # It has some number of links. \s+\w+\s+\w+ # It has a user and group, which may # be named anything. [^/]* ...
b78d4701a1f3bdb036d433cf90a93c4345713ca7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b78d4701a1f3bdb036d433cf90a93c4345713ca7/test_commands.py
a = -1 b = -1 c = -1
Unpack list
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
if verbose: print 'unpack tuple' a, b, c = t if a != 1 or b != 2 or c != 3: raise TestFailed
>>> l = [4, 5, 6] >>> a, b, c = l >>> a == 4 and b == 5 and c == 6 True
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
if verbose: print 'unpack list' a, b, c = l if a != 4 or b != 5 or c != 6: raise TestFailed
Unpack implied tuple
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
if verbose: print 'unpack implied tuple' a, b, c = 7, 8, 9 if a != 7 or b != 8 or c != 9: raise TestFailed
>>> a, b, c = 7, 8, 9 >>> a == 7 and b == 8 and c == 9 True
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
if verbose: print 'unpack string' a, b, c = 'one' if a != 'o' or b != 'n' or c != 'e': raise TestFailed
Unpack string... fun!
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
if verbose: print 'unpack sequence' a, b, c = Seq() if a != 0 or b != 1 or c != 2: raise TestFailed
>>> a, b, c = 'one' >>> a == 'o' and b == 'n' and c == 'e' True
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
if verbose: print 'unpack single tuple/list' st = (99,) sl = [100] a, = st if a != 99: raise TestFailed b, = sl if b != 100: raise TestFailed
Unpack generic sequence
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
>>> class Seq: ... def __getitem__(self, i): ... if i >= 0 and i < 3: return i ... raise IndexError ... >>> a, b, c = Seq() >>> a == 0 and b == 1 and c == 2 True
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py
if verbose: print 'unpack non-sequence' try: a, b, c = 7 raise TestFailed except TypeError: pass
Single element unpacking, with extra syntax
def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError
989a9d01aa1cbad29606c3b177b5c247a75fefc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/989a9d01aa1cbad29606c3b177b5c247a75fefc0/test_unpack.py