rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for file in config_c_in, makefile_in, frozenmain_c:
for file in [config_c_in, makefile_in] + supp_sources:
def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target
150316ee2e7db3d0ad633f2dbe53a066add49e45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/150316ee2e7db3d0ad633f2dbe53a066add49e45/freeze.py
files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \
files = ['$(OPT)', config_c, frozen_c] + \ supp_sources + addfiles + libs + \
def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target
150316ee2e7db3d0ad633f2dbe53a066add49e45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/150316ee2e7db3d0ad633f2dbe53a066add49e45/freeze.py
def read(self,size=None):
def read(self, size=None):
def read(self,size=None): if self.extrasize <= 0 and self.fileobj is None: return ''
ee918cb48794ca18dbce6b3449d6f977d2142c60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee918cb48794ca18dbce6b3449d6f977d2142c60/gzip.py
self.extrasize = len(buf) + self.extrasize
self.extrasize = len(self.extrabuf)
def _unread(self, buf): self.extrabuf = buf + self.extrabuf self.extrasize = len(buf) + self.extrasize
ee918cb48794ca18dbce6b3449d6f977d2142c60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee918cb48794ca18dbce6b3449d6f977d2142c60/gzip.py
bufs.append(c[:i])
bufs.append(c[:i+1])
def readline(self): bufs = [] readsize = 100 while 1: c = self.read(readsize) i = string.find(c, '\n') if i >= 0 or c == '': bufs.append(c[:i]) self._unread(c[i+1:]) return string.join(bufs, '') bufs.append(c) readsize = readsize * 2
ee918cb48794ca18dbce6b3449d6f977d2142c60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee918cb48794ca18dbce6b3449d6f977d2142c60/gzip.py
except RuntimeError:
except (RuntimeError, MacOS.Error):
def _mac_ver_lookup(selectors,default=None): from gestalt import gestalt l = [] append = l.append for selector in selectors: try: append(gestalt(selector)) except RuntimeError: append(default) return l
a290e3d7c6c15454496d5a8bb163af61f99f52c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a290e3d7c6c15454496d5a8bb163af61f99f52c0/platform.py
exit_status = not main()
exit_status = int(not main())
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ "[-x regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" print "-q: quiet operation" print "-d destdir: purported directory name for error messages" print " if no directory arguments, -l sys.path is assumed" print "-x regexp: skip files matching the regular expression regexp" print " the regexp is search for in the full path of the file" sys.exit(2) maxlevels = 10 ddir = None force = 0 quiet = 0 rx = None for o, a in opts: if o == '-l': maxlevels = 0 if o == '-d': ddir = a if o == '-f': force = 1 if o == '-q': quiet = 1 if o == '-x': import re rx = re.compile(a) if ddir: if len(args) != 1: print "-d destdir require exactly one directory argument" sys.exit(2) success = 1 try: if args: for dir in args: if not compile_dir(dir, maxlevels, ddir, force, rx, quiet): success = 0 else: success = compile_path() except KeyboardInterrupt: print "\n[interrupt]" success = 0 return success
7b4b788eaadb36f65b08a4a84e7096bb03dcc12b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7b4b788eaadb36f65b08a4a84e7096bb03dcc12b/compileall.py
if ((template_exists and template_newer) or self.force_manifest or self.manifest_only):
if ((template_exists and (template_newer or setup_newer)) or self.force_manifest or self.manifest_only):
def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.files'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the state of the filesystem. """ template_exists = os.path.isfile (self.template) if template_exists: template_newer = newer (self.template, self.manifest)
b2db0eb695d2d62cb1a74c51bb005a23821a76ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2db0eb695d2d62cb1a74c51bb005a23821a76ce/sdist.py
if DEBUG:
if DEBUG:
def write(self, data): if DEBUG:
ac7c0dfa93b76c89416cc86644554c96069937c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ac7c0dfa93b76c89416cc86644554c96069937c5/binhex.py
"""Reset the list of warnings filters to its default state."""
"""Clear the list of warning filters, so that no filters are active."""
def resetwarnings(): """Reset the list of warnings filters to its default state.""" filters[:] = []
c86c1b88f96ec48e5502b9b8ba5cc833f57ce476 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c86c1b88f96ec48e5502b9b8ba5cc833f57ce476/warnings.py
for i in range(100):
for i in range(60):
def test_nonrecursive_deep(self): a = [] for i in range(100): a = [a] b = self.loads(self.dumps(a)) self.assertEqual(a, b)
7107a7fbcc424fbe4ceb3de523db4d51f34d3f37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7107a7fbcc424fbe4ceb3de523db4d51f34d3f37/test_cpickle.py
if verbose or generate:
if verbose:
def runtest(test, generate, verbose, quiet, testdir = None): """Run a single test. test -- the name of the test generate -- if true, generate output, instead of running the test and comparing it to a previously created output file verbose -- if true, print more messages quiet -- if true, don't print 'skipped' messages (probably redundant) testdir -- test directory """ test_support.unload(test) if not testdir: testdir = findtestdir() outputdir = os.path.join(testdir, "output") outputfile = os.path.join(outputdir, test) if verbose or generate: cfp = None else: cfp = StringIO.StringIO() try: save_stdout = sys.stdout try: if cfp: sys.stdout = cfp print test # Output file starts with test name the_module = __import__(test, globals(), locals(), []) # Most tests run to completion simply as a side-effect of # being imported. For the benefit of tests that can't run # that way (like test_threaded_import), explicitly invoke # their test_main() function (if it exists). indirect_test = getattr(the_module, "test_main", None) if indirect_test is not None: indirect_test() finally: sys.stdout = save_stdout except (ImportError, test_support.TestSkipped), msg: if not quiet: print "test", test, "skipped --", msg return -1 except KeyboardInterrupt: raise except test_support.TestFailed, msg: print "test", test, "failed --", msg return 0 except: type, value = sys.exc_info()[:2] print "test", test, "crashed --", str(type) + ":", value if verbose: traceback.print_exc(file=sys.stdout) return 0 else: if not cfp: return 1 output = cfp.getvalue() if generate: if output == test + "\n": if os.path.exists(outputfile): # Write it since it already exists (and the contents # may have changed), but let the user know it isn't # needed: print "output file", outputfile, \ "is no longer needed; consider removing it" else: # We don't need it, so don't create it. return 1 fp = open(outputfile, "w") fp.write(output) fp.close() return 1 if os.path.exists(outputfile): fp = open(outputfile, "r") expected = fp.read() fp.close() else: expected = test + "\n" if output == expected: return 1 print "test", test, "produced unexpected output:" reportdiff(expected, output) return 0
9390cc15da5cd6920bd41bb4cd146d5d0601345f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9390cc15da5cd6920bd41bb4cd146d5d0601345f/regrtest.py
self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG' ]
if self.__version >= 7: self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG' ] else: self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG' ]
def __init__ (self, verbose=0, dry_run=0, force=0): CCompiler.__init__ (self, verbose, dry_run, force) self.__version = get_build_version() if self.__version >= 7: self.__root = r"Software\Microsoft\VisualStudio" self.__macros = MacroExpander(self.__version) else: self.__root = r"Software\Microsoft\Devstudio" self.__paths = self.get_msvc_paths("path")
41f7038a3e685a05b648b1d920bfb0bbcba5e632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/41f7038a3e685a05b648b1d920bfb0bbcba5e632/msvccompiler.py
self.filename = _normpath(filename)
self.orig_filename = filename null_byte = filename.find(chr(0)) if null_byte >= 0: filename = filename[0:null_byte] print "File name %s contains a suspicious null byte!" % filename if os.sep != "/": filename = filename.replace(os.sep, "/") self.filename = filename
def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)): self.filename = _normpath(filename) # Name of the file in the archive self.date_time = date_time # year, month, day, hour, min, sec # Standard values: self.compress_type = ZIP_STORED # Type of compression for the file self.comment = "" # Comment for each file self.extra = "" # ZIP extra data self.create_system = 0 # System which created ZIP archive self.create_version = 20 # Version which created ZIP archive self.extract_version = 20 # Version needed to extract archive self.reserved = 0 # Must be zero self.flag_bits = 0 # ZIP flag bits self.volume = 0 # Volume number of file header self.internal_attr = 0 # Internal attributes self.external_attr = 0 # External file attributes # Other attributes are set by class ZipFile: # header_offset Byte offset to the file header # file_offset Byte offset to the start of the file data # CRC CRC-32 of the uncompressed file # compress_size Size of the compressed file # file_size Size of the uncompressed file
8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32/zipfile.py
if os.sep != "/": def _normpath(path): return path.replace(os.sep, "/") else: def _normpath(path): return path
def FileHeader(self): """Return the per-file header as a string.""" dt = self.date_time dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2] dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2) if self.flag_bits & 0x08: # Set these to zero because we write them after the file data CRC = compress_size = file_size = 0 else: CRC = self.CRC compress_size = self.compress_size file_size = self.file_size header = struct.pack(structFileHeader, stringFileHeader, self.extract_version, self.reserved, self.flag_bits, self.compress_type, dostime, dosdate, CRC, compress_size, file_size, len(self.filename), len(self.extra)) return header + self.filename + self.extra
8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32/zipfile.py
if fname != data.filename:
if fname != data.orig_filename:
def _RealGetContents(self): """Read in the table of contents for the ZIP file.""" fp = self.fp endrec = _EndRecData(fp) if not endrec: raise BadZipfile, "File is not a zip file" if self.debug > 1: print endrec size_cd = endrec[5] # bytes in central directory offset_cd = endrec[6] # offset of central directory self.comment = endrec[8] # archive comment # endrec[9] is the offset of the "End of Central Dir" record x = endrec[9] - size_cd # "concat" is zero, unless zip was concatenated to another file concat = x - offset_cd if self.debug > 2: print "given, inferred, offset", offset_cd, x, concat # self.start_dir: Position of start of central directory self.start_dir = offset_cd + concat fp.seek(self.start_dir, 0) total = 0 while total < size_cd: centdir = fp.read(46) total = total + 46 if centdir[0:4] != stringCentralDir: raise BadZipfile, "Bad magic number for central directory" centdir = struct.unpack(structCentralDir, centdir) if self.debug > 2: print centdir filename = fp.read(centdir[_CD_FILENAME_LENGTH]) # Create ZipInfo instance to store file information x = ZipInfo(filename) x.extra = fp.read(centdir[_CD_EXTRA_FIELD_LENGTH]) x.comment = fp.read(centdir[_CD_COMMENT_LENGTH]) total = (total + centdir[_CD_FILENAME_LENGTH] + centdir[_CD_EXTRA_FIELD_LENGTH] + centdir[_CD_COMMENT_LENGTH]) x.header_offset = centdir[_CD_LOCAL_HEADER_OFFSET] + concat # file_offset must be computed below... (x.create_version, x.create_system, x.extract_version, x.reserved, x.flag_bits, x.compress_type, t, d, x.CRC, x.compress_size, x.file_size) = centdir[1:12] x.volume, x.internal_attr, x.external_attr = centdir[15:18] # Convert date/time code to (year, month, day, hour, min, sec) x.date_time = ( (d>>9)+1980, (d>>5)&0xF, d&0x1F, t>>11, (t>>5)&0x3F, (t&0x1F) * 2 ) self.filelist.append(x) self.NameToInfo[x.filename] = x if self.debug > 2: print "total", total for data in self.filelist: fp.seek(data.header_offset, 0) fheader = fp.read(30) if fheader[0:4] != stringFileHeader: raise BadZipfile, "Bad magic number for file header" fheader = struct.unpack(structFileHeader, fheader) # file_offset is computed here, since the extra field for # the central directory and for the local file header # refer to different fields, and they can have different # lengths data.file_offset = (data.header_offset + 30 + fheader[_FH_FILENAME_LENGTH] + fheader[_FH_EXTRA_FIELD_LENGTH]) fname = fp.read(fheader[_FH_FILENAME_LENGTH]) if fname != data.filename: raise RuntimeError, \ 'File name in directory "%s" and header "%s" differ.' % ( data.filename, fname)
8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32/zipfile.py
data.filename, fname)
data.orig_filename, fname)
def _RealGetContents(self): """Read in the table of contents for the ZIP file.""" fp = self.fp endrec = _EndRecData(fp) if not endrec: raise BadZipfile, "File is not a zip file" if self.debug > 1: print endrec size_cd = endrec[5] # bytes in central directory offset_cd = endrec[6] # offset of central directory self.comment = endrec[8] # archive comment # endrec[9] is the offset of the "End of Central Dir" record x = endrec[9] - size_cd # "concat" is zero, unless zip was concatenated to another file concat = x - offset_cd if self.debug > 2: print "given, inferred, offset", offset_cd, x, concat # self.start_dir: Position of start of central directory self.start_dir = offset_cd + concat fp.seek(self.start_dir, 0) total = 0 while total < size_cd: centdir = fp.read(46) total = total + 46 if centdir[0:4] != stringCentralDir: raise BadZipfile, "Bad magic number for central directory" centdir = struct.unpack(structCentralDir, centdir) if self.debug > 2: print centdir filename = fp.read(centdir[_CD_FILENAME_LENGTH]) # Create ZipInfo instance to store file information x = ZipInfo(filename) x.extra = fp.read(centdir[_CD_EXTRA_FIELD_LENGTH]) x.comment = fp.read(centdir[_CD_COMMENT_LENGTH]) total = (total + centdir[_CD_FILENAME_LENGTH] + centdir[_CD_EXTRA_FIELD_LENGTH] + centdir[_CD_COMMENT_LENGTH]) x.header_offset = centdir[_CD_LOCAL_HEADER_OFFSET] + concat # file_offset must be computed below... (x.create_version, x.create_system, x.extract_version, x.reserved, x.flag_bits, x.compress_type, t, d, x.CRC, x.compress_size, x.file_size) = centdir[1:12] x.volume, x.internal_attr, x.external_attr = centdir[15:18] # Convert date/time code to (year, month, day, hour, min, sec) x.date_time = ( (d>>9)+1980, (d>>5)&0xF, d&0x1F, t>>11, (t>>5)&0x3F, (t&0x1F) * 2 ) self.filelist.append(x) self.NameToInfo[x.filename] = x if self.debug > 2: print "total", total for data in self.filelist: fp.seek(data.header_offset, 0) fheader = fp.read(30) if fheader[0:4] != stringFileHeader: raise BadZipfile, "Bad magic number for file header" fheader = struct.unpack(structFileHeader, fheader) # file_offset is computed here, since the extra field for # the central directory and for the local file header # refer to different fields, and they can have different # lengths data.file_offset = (data.header_offset + 30 + fheader[_FH_FILENAME_LENGTH] + fheader[_FH_EXTRA_FIELD_LENGTH]) fname = fp.read(fheader[_FH_FILENAME_LENGTH]) if fname != data.filename: raise RuntimeError, \ 'File name in directory "%s" and header "%s" differ.' % ( data.filename, fname)
8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8e36d28f3c082d7c10e5d7cbbb5301ec6e0d7d32/zipfile.py
flags = _checkflag(flag)
flags = _checkflag(flag, file)
def hashopen(file, flag='c', mode=0666, pgsize=None, ffactor=None, nelem=None, cachesize=None, lorder=None, hflags=0): flags = _checkflag(flag) e = _openDBEnv() d = db.DB(e) d.set_flags(hflags) if cachesize is not None: d.set_cachesize(0, cachesize) if pgsize is not None: d.set_pagesize(pgsize) if lorder is not None: d.set_lorder(lorder) if ffactor is not None: d.set_h_ffactor(ffactor) if nelem is not None: d.set_h_nelem(nelem) d.open(file, db.DB_HASH, flags, mode) return _DBWithCursor(d)
a6b3caad417c0472b611be251d623331744079a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6b3caad417c0472b611be251d623331744079a5/__init__.py
flags = _checkflag(flag)
flags = _checkflag(flag, file)
def btopen(file, flag='c', mode=0666, btflags=0, cachesize=None, maxkeypage=None, minkeypage=None, pgsize=None, lorder=None): flags = _checkflag(flag) e = _openDBEnv() d = db.DB(e) if cachesize is not None: d.set_cachesize(0, cachesize) if pgsize is not None: d.set_pagesize(pgsize) if lorder is not None: d.set_lorder(lorder) d.set_flags(btflags) if minkeypage is not None: d.set_bt_minkey(minkeypage) if maxkeypage is not None: d.set_bt_maxkey(maxkeypage) d.open(file, db.DB_BTREE, flags, mode) return _DBWithCursor(d)
a6b3caad417c0472b611be251d623331744079a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6b3caad417c0472b611be251d623331744079a5/__init__.py
flags = _checkflag(flag)
flags = _checkflag(flag, file)
def rnopen(file, flag='c', mode=0666, rnflags=0, cachesize=None, pgsize=None, lorder=None, rlen=None, delim=None, source=None, pad=None): flags = _checkflag(flag) e = _openDBEnv() d = db.DB(e) if cachesize is not None: d.set_cachesize(0, cachesize) if pgsize is not None: d.set_pagesize(pgsize) if lorder is not None: d.set_lorder(lorder) d.set_flags(rnflags) if delim is not None: d.set_re_delim(delim) if rlen is not None: d.set_re_len(rlen) if source is not None: d.set_re_source(source) if pad is not None: d.set_re_pad(pad) d.open(file, db.DB_RECNO, flags, mode) return _DBWithCursor(d)
a6b3caad417c0472b611be251d623331744079a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6b3caad417c0472b611be251d623331744079a5/__init__.py
def _checkflag(flag):
def _checkflag(flag, file):
def _checkflag(flag): if flag == 'r': flags = db.DB_RDONLY elif flag == 'rw': flags = 0 elif flag == 'w': flags = db.DB_CREATE elif flag == 'c': flags = db.DB_CREATE elif flag == 'n': flags = db.DB_CREATE | db.DB_TRUNCATE else: raise error, "flags should be one of 'r', 'w', 'c' or 'n'" return flags | db.DB_THREAD
a6b3caad417c0472b611be251d623331744079a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6b3caad417c0472b611be251d623331744079a5/__init__.py
flags = db.DB_CREATE | db.DB_TRUNCATE
flags = db.DB_CREATE if os.path.isfile(file): os.unlink(file)
def _checkflag(flag): if flag == 'r': flags = db.DB_RDONLY elif flag == 'rw': flags = 0 elif flag == 'w': flags = db.DB_CREATE elif flag == 'c': flags = db.DB_CREATE elif flag == 'n': flags = db.DB_CREATE | db.DB_TRUNCATE else: raise error, "flags should be one of 'r', 'w', 'c' or 'n'" return flags | db.DB_THREAD
a6b3caad417c0472b611be251d623331744079a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6b3caad417c0472b611be251d623331744079a5/__init__.py
def tearDown(self): """Restore sys.path""" sys.path = self.sys_path
ebd95222bf732f78b3a443d57d00174fbee8904e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebd95222bf732f78b3a443d57d00174fbee8904e/test_site.py
def test_init_pathinfo(self): dir_set = site._init_pathinfo() for entry in [site.makepath(path)[1] for path in sys.path if path and os.path.isdir(path)]: self.failUnless(entry in dir_set, "%s from sys.path not found in set returned " "by _init_pathinfo(): %s" % (entry, dir_set))
ebd95222bf732f78b3a443d57d00174fbee8904e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebd95222bf732f78b3a443d57d00174fbee8904e/test_site.py
def test_addpackage(self): # Make sure addpackage() imports if the line starts with 'import', # otherwise add a directory combined from sitedir and 'name'. # Must also skip comment lines. dir_path, file_name, new_dir = createpth() try: site.addpackage(dir_path, file_name, set()) self.failUnless(site.makepath(os.path.join(dir_path, new_dir))[0] in sys.path) finally: cleanuppth(dir_path, file_name, new_dir)
ebd95222bf732f78b3a443d57d00174fbee8904e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebd95222bf732f78b3a443d57d00174fbee8904e/test_site.py
for module in sys.modules.values():
for module in (sys, os, __builtin__):
def test_abs__file__(self): # Make sure all imported modules have their __file__ attribute # as an absolute path. # Handled by abs__file__() site.abs__file__() for module in sys.modules.values(): try: self.failUnless(os.path.isabs(module.__file__)) except AttributeError: continue
ebd95222bf732f78b3a443d57d00174fbee8904e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebd95222bf732f78b3a443d57d00174fbee8904e/test_site.py
self.failUnless(os.path.isabs(module.__file__))
self.failUnless(os.path.isabs(module.__file__), `module`)
def test_abs__file__(self): # Make sure all imported modules have their __file__ attribute # as an absolute path. # Handled by abs__file__() site.abs__file__() for module in sys.modules.values(): try: self.failUnless(os.path.isabs(module.__file__)) except AttributeError: continue
ebd95222bf732f78b3a443d57d00174fbee8904e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebd95222bf732f78b3a443d57d00174fbee8904e/test_site.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 None and commd: register("gnome", None, BackgroundBrowser(commd)) # First, the Mozilla/Netscape browsers for browser in ("mozilla-firefox", "firefox", "mozilla-firebird", "firebird", "seamonkey", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Mozilla(browser)) # Konqueror/kfm, the KDE browser. if _iscommand("kfm"): register("kfm", Konqueror, Konqueror("kfm")) elif _iscommand("konqueror"): register("konqueror", Konqueror, Konqueror("konqueror")) # Gnome's Galeon and Epiphany for browser in ("galeon", "epiphany"): if _iscommand(browser): register(browser, None, Galeon(browser)) # Skipstone, another Gtk/Mozilla based browser if _iscommand("skipstone"): register("skipstone", None, BackgroundBrowser("skipstone")) # Opera, quite popular if _iscommand("opera"): register("opera", None, Opera("opera")) # Next, Mosaic -- old but still in use. if _iscommand("mosaic"): register("mosaic", None, BackgroundBrowser("mosaic")) # Grail, the Python browser. Does anybody still use it? if _iscommand("grail"): register("grail", Grail, None)
8c6674511b7fd0cafcdf00011eb91c3216be094f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8c6674511b7fd0cafcdf00011eb91c3216be094f/webbrowser.py
cmdline = "%s %s" % (interp, cmdline)
cmdline = "%s -u %s" % (interp, cmdline)
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): self.send_error(403, "CGI script is not a plain file (%s)" % `scriptname`) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) return if not self.is_executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return
16fd3381d4e5ba884c5b9e5135a1d7cc5e5e9a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/16fd3381d4e5ba884c5b9e5135a1d7cc5e5e9a2c/CGIHTTPServer.py
fi, fo = os.popen2(cmdline)
fi, fo = os.popen2(cmdline, 'b')
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): self.send_error(403, "CGI script is not a plain file (%s)" % `scriptname`) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) return if not self.is_executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return
16fd3381d4e5ba884c5b9e5135a1d7cc5e5e9a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/16fd3381d4e5ba884c5b9e5135a1d7cc5e5e9a2c/CGIHTTPServer.py
self.implib_dir = self.build_temp
def finalize_options (self): from distutils import sysconfig
18b9b93df3cf304a2506a44e1e3bfd95bd53e511 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/18b9b93df3cf304a2506a44e1e3bfd95bd53e511/build_ext.py
def get_ext_libname (self, ext_name): ext_path = string.split (ext_name, '.') if os.name == 'nt' and self.debug: return apply (os.path.join, ext_path) + '_d.lib' return apply (os.path.join, ext_path) + '.lib'
def get_ext_libname (self, ext_name): # create a filename for the (unneeded) lib-file. # extensions in debug_mode are named 'module_d.pyd' under windows ext_path = string.split (ext_name, '.') if os.name == 'nt' and self.debug: return apply (os.path.join, ext_path) + '_d.lib' return apply (os.path.join, ext_path) + '.lib'
18b9b93df3cf304a2506a44e1e3bfd95bd53e511 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/18b9b93df3cf304a2506a44e1e3bfd95bd53e511/build_ext.py
if sys.platform == "win32": pythonlib = ("python%d%d" % (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
from distutils.msvccompiler import MSVCCompiler if sys.platform == "win32" and \ not isinstance(self.compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' pythonlib = (template % (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
def get_libraries (self, ext): """Return the list of libraries to link against when building a shared extension. On most platforms, this is just 'ext.libraries'; on Windows, we add the Python library (eg. python20.dll). """ # The python library is always needed on Windows. For MSVC, this # is redundant, since the library is mentioned in a pragma in # config.h that MSVC groks. The other Windows compilers all seem # to need it mentioned explicitly, though, so that's what we do. if sys.platform == "win32": pythonlib = ("python%d%d" % (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) # don't extend ext.libraries, it may be shared with other # extensions, it is a reference to the original list return ext.libraries + [pythonlib] else: return ext.libraries
18b9b93df3cf304a2506a44e1e3bfd95bd53e511 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/18b9b93df3cf304a2506a44e1e3bfd95bd53e511/build_ext.py
opt_dict[opt] = (filename, parser.get(section,opt))
val = parser.get(section,opt) opt = string.replace(opt, '-', '_') opt_dict[opt] = (filename, val)
def parse_config_files (self, filenames=None):
ceb9e226a638301e68420d7b6728bdc86fd30f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ceb9e226a638301e68420d7b6728bdc86fd30f0c/dist.py
true if command-line were successfully parsed and we should carry
true if command-line was successfully parsed and we should carry
def parse_command_line (self): """Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution instance. Then, it is alternately scanned for Distutils commands and options for that command. Each new command terminates the options for the previous command. The allowed options for a command are determined by the 'user_options' attribute of the command class -- thus, we have to be able to load command classes in order to parse the command line. Any error in that 'options' attribute raises DistutilsGetoptError; any error on the command-line raises DistutilsArgError. If no Distutils commands were found on the command line, raises DistutilsArgError. Return true if command-line were successfully parsed and we should carry on with executing commands; false if no errors but we shouldn't execute commands (currently, this only happens if user asks for help). """ # We have to parse the command line a bit at a time -- global # options, then the first command, then its options, and so on -- # because each command will be handled by a different class, and # the options that are valid for a particular class aren't known # until we have loaded the command class, which doesn't happen # until we know what the command is.
ceb9e226a638301e68420d7b6728bdc86fd30f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ceb9e226a638301e68420d7b6728bdc86fd30f0c/dist.py
'command_obj' must be a Commnd instance. If 'option_dict' is not
'command_obj' must be a Command instance. If 'option_dict' is not
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').
ceb9e226a638301e68420d7b6728bdc86fd30f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ceb9e226a638301e68420d7b6728bdc86fd30f0c/dist.py
if not hasattr(command_obj, option): raise DistutilsOptionError, \ ("error in %s: command '%s' has no such option '%s'") % \ (source, command_name, option) setattr(command_obj, option, value)
try: bool_opts = command_obj.boolean_options except AttributeError: bool_opts = [] try: neg_opt = command_obj.negative_opt except AttributeError: neg_opt = {} try: if neg_opt.has_key(option): setattr(command_obj, neg_opt[option], not strtobool(value)) elif option in bool_opts: setattr(command_obj, option, strtobool(value)) elif hasattr(command_obj, option): setattr(command_obj, option, value) else: raise DistutilsOptionError, \ ("error in %s: command '%s' has no such option '%s'" % (source, command_name, option)) except ValueError, msg: raise DistutilsOptionError, msg
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').
ceb9e226a638301e68420d7b6728bdc86fd30f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ceb9e226a638301e68420d7b6728bdc86fd30f0c/dist.py
os.execve(scriptfile, args, env)
os.execve(scriptfile, args, os.environ)
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): self.send_error(403, "CGI script is not a plain file (%s)" % `scriptname`) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2 or self.have_popen3): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) return if not self.is_executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return
92f200b569d402e1c4adabfb4c7dc7c9c11891fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/92f200b569d402e1c4adabfb4c7dc7c9c11891fe/CGIHTTPServer.py
fp = open(temp_filename, 'wt')
mode = 'w' if sys.platform not in ['cygwin']: mode += 't' fp = open(temp_filename, mode)
def setUp (self): fp = open(temp_filename, 'wt') fp.write(TEST_NETRC) fp.close() self.netrc = netrc.netrc(temp_filename)
0fd54d8050f2a4181066c185e6ac465133646f05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0fd54d8050f2a4181066c185e6ac465133646f05/test_netrc.py
def asList(nodes):
def asList(nodearg):
def asList(nodes): l = [] for item in nodes: if hasattr(item, "asList"): l.append(item.asList()) else: t = type(item) if t is TupleType or t is ListType: l.append(tuple(asList(item))) else: l.append(item) return l
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
for item in nodes:
for item in nodearg:
def asList(nodes): l = [] for item in nodes: if hasattr(item, "asList"): l.append(item.asList()) else: t = type(item) if t is TupleType or t is ListType: l.append(tuple(asList(item))) else: l.append(item) return l
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.expr) if self.lower is not None: nodes.append(self.lower) if self.upper is not None: nodes.append(self.upper) return tuple(nodes)
nodelist = [] nodelist.append(self.expr) if self.lower is not None: nodelist.append(self.lower) if self.upper is not None: nodelist.append(self.upper) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.expr) if self.lower is not None: nodes.append(self.lower) if self.upper is not None: nodes.append(self.upper) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] if self.expr1 is not None: nodes.append(self.expr1) if self.expr2 is not None: nodes.append(self.expr2) if self.expr3 is not None: nodes.append(self.expr3) return tuple(nodes)
nodelist = [] if self.expr1 is not None: nodelist.append(self.expr1) if self.expr2 is not None: nodelist.append(self.expr2) if self.expr3 is not None: nodelist.append(self.expr3) return tuple(nodelist)
def getChildNodes(self): nodes = [] if self.expr1 is not None: nodes.append(self.expr1) if self.expr2 is not None: nodes.append(self.expr2) if self.expr3 is not None: nodes.append(self.expr3) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.assign) nodes.append(self.list) nodes.append(self.body) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
nodelist = [] nodelist.append(self.assign) nodelist.append(self.list) nodelist.append(self.body) if self.else_ is not None: nodelist.append(self.else_) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.assign) nodes.append(self.list) nodes.append(self.body) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.items)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.items)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.items)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodes.append(self.dest) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodelist.append(self.dest) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodes.append(self.dest) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.expr) nodes.extend(flatten_nodes(self.subs)) return tuple(nodes)
nodelist = [] nodelist.append(self.expr) nodelist.extend(flatten_nodes(self.subs)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.expr) nodes.extend(flatten_nodes(self.subs)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.body) nodes.extend(flatten_nodes(self.handlers)) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
nodelist = [] nodelist.append(self.body) nodelist.extend(flatten_nodes(self.handlers)) if self.else_ is not None: nodelist.append(self.else_) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.body) nodes.extend(flatten_nodes(self.handlers)) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.defaults)) nodelist.append(self.code) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.test) if self.fail is not None: nodes.append(self.fail) return tuple(nodes)
nodelist = [] nodelist.append(self.test) if self.fail is not None: nodelist.append(self.fail) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.test) if self.fail is not None: nodes.append(self.fail) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.expr) if self.locals is not None: nodes.append(self.locals) if self.globals is not None: nodes.append(self.globals) return tuple(nodes)
nodelist = [] nodelist.append(self.expr) if self.locals is not None: nodelist.append(self.locals) if self.globals is not None: nodelist.append(self.globals) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.expr) if self.locals is not None: nodes.append(self.locals) if self.globals is not None: nodes.append(self.globals) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.bases)) nodes.append(self.code) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.bases)) nodelist.append(self.code) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.bases)) nodes.append(self.code) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodes.append(self.dest) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodelist.append(self.dest) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) if self.dest is not None: nodes.append(self.dest) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.test) nodes.append(self.body) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
nodelist = [] nodelist.append(self.test) nodelist.append(self.body) if self.else_ is not None: nodelist.append(self.else_) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.test) nodes.append(self.body) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) nodes.append(self.expr) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) nodelist.append(self.expr) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) nodes.append(self.expr) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.defaults)) nodelist.append(self.code) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.expr) nodes.extend(flatten_nodes(self.ops)) return tuple(nodes)
nodelist = [] nodelist.append(self.expr) nodelist.extend(flatten_nodes(self.ops)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.expr) nodes.extend(flatten_nodes(self.ops)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.node) nodes.extend(flatten_nodes(self.args)) if self.star_args is not None: nodes.append(self.star_args) if self.dstar_args is not None: nodes.append(self.dstar_args) return tuple(nodes)
nodelist = [] nodelist.append(self.node) nodelist.extend(flatten_nodes(self.args)) if self.star_args is not None: nodelist.append(self.star_args) if self.dstar_args is not None: nodelist.append(self.dstar_args) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.node) nodes.extend(flatten_nodes(self.args)) if self.star_args is not None: nodes.append(self.star_args) if self.dstar_args is not None: nodes.append(self.dstar_args) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.extend(flatten_nodes(self.tests)) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.tests)) if self.else_ is not None: nodelist.append(self.else_) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.tests)) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.expr) nodes.extend(flatten_nodes(self.quals)) return tuple(nodes)
nodelist = [] nodelist.append(self.expr) nodelist.extend(flatten_nodes(self.quals)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.expr) nodes.extend(flatten_nodes(self.quals)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
nodes = [] nodes.append(self.assign) nodes.append(self.list) nodes.extend(flatten_nodes(self.ifs)) return tuple(nodes)
nodelist = [] nodelist.append(self.assign) nodelist.append(self.list) nodelist.extend(flatten_nodes(self.ifs)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.assign) nodes.append(self.list) nodes.extend(flatten_nodes(self.ifs)) return tuple(nodes)
0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py
dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir)) L = sys.modules.values() for m in L:
dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir) for m in sys.modules.values():
def makepath(*paths): dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir))
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
m.__file__ = makepath(m.__file__) del m, L
m.__file__ = os.path.abspath(m.__file__) del m
def makepath(*paths): dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir))
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
dir = makepath(dir) if dir not in L:
dir, dircase = makepath(dir) if not dirs_in_sys_path.has_key(dircase):
def makepath(*paths): dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir))
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
sitedir = makepath(sitedir) if sitedir not in sys.path:
sitedir, sitedircase = makepath(sitedir) if not dirs_in_sys_path.has_key(sitedircase):
def addsitedir(sitedir): sitedir = makepath(sitedir) if sitedir not in sys.path: sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: return names = map(os.path.normcase, names) names.sort() for name in names: if name[-4:] == endsep + "pth": addpackage(sitedir, name)
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
names = map(os.path.normcase, names)
def addsitedir(sitedir): sitedir = makepath(sitedir) if sitedir not in sys.path: sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: return names = map(os.path.normcase, names) names.sort() for name in names: if name[-4:] == endsep + "pth": addpackage(sitedir, name)
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
dir = makepath(sitedir, dir) if dir not in sys.path and os.path.exists(dir):
dir, dircase = makepath(sitedir, dir) if not dirs_in_sys_path.has_key(dircase) and os.path.exists(dir):
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir = makepath(sitedir, dir) if dir not in sys.path and os.path.exists(dir): sys.path.append(dir)
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
sitedirs = [makepath(prefix, "lib", "python" + sys.version[:3], "site-packages"), makepath(prefix, "lib", "site-python")]
sitedirs = [os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"), os.path.join(prefix, "lib", "site-python")]
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir = makepath(sitedir, dir) if dir not in sys.path and os.path.exists(dir): sys.path.append(dir)
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
sitedirs = [makepath(prefix, "lib", "site-packages")]
sitedirs = [os.path.join(prefix, "lib", "site-packages")]
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir = makepath(sitedir, dir) if dir not in sys.path and os.path.exists(dir): sys.path.append(dir)
1fb5ce0323926406e6b3db6879152e0dcc40f5ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb5ce0323926406e6b3db6879152e0dcc40f5ec/site.py
nil = fp.read() fp.close()
def http_error_302(self, req, fp, code, msg, headers): if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return nil = fp.read() fp.close()
54e99e8b3bba4e2fb51dd25e54356c16f84b722b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54e99e8b3bba4e2fb51dd25e54356c16f84b722b/urllib2.py
self.inf_msg + msg, headers)
self.inf_msg + msg, headers, fp)
def http_error_302(self, req, fp, code, msg, headers): if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return nil = fp.read() fp.close()
54e99e8b3bba4e2fb51dd25e54356c16f84b722b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54e99e8b3bba4e2fb51dd25e54356c16f84b722b/urllib2.py
p
def do_proxy(self, p, req): p return self.parent.open(req)
54e99e8b3bba4e2fb51dd25e54356c16f84b722b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54e99e8b3bba4e2fb51dd25e54356c16f84b722b/urllib2.py
passwd = HTTPPassowrdMgr()
passwd = HTTPPasswordMgr()
def __init__(self, passwd=None): if passwd is None: passwd = HTTPPassowrdMgr() self.passwd = passwd self.add_password = self.passwd.add_password self.__current_realm = None
54e99e8b3bba4e2fb51dd25e54356c16f84b722b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54e99e8b3bba4e2fb51dd25e54356c16f84b722b/urllib2.py
opener = OpenerDirectory()
opener = OpenerDirector()
def build_opener(self): opener = OpenerDirectory() for ph in self.proxy_handlers: if type(ph) == types.ClassType: ph = ph() opener.add_handler(ph)
54e99e8b3bba4e2fb51dd25e54356c16f84b722b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54e99e8b3bba4e2fb51dd25e54356c16f84b722b/urllib2.py
macros=macros,
def build_extensions (self):
df9e6b8196dc171fb764657c87fdf7378a1f47bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df9e6b8196dc171fb764657c87fdf7378a1f47bd/build_ext.py
initial_slash = (path[0] == '/')
initial_slashes = path.startswith('/') if (initial_slashes and path.startswith('//') and not path.startswith('///')): initial_slashes = 2
def normpath(path): """Normalize path, eliminating double slashes, etc.""" if path == '': return '.' initial_slash = (path[0] == '/') comps = path.split('/') new_comps = [] for comp in comps: if comp in ('', '.'): continue if (comp != '..' or (not initial_slash and not new_comps) or (new_comps and new_comps[-1] == '..')): new_comps.append(comp) elif new_comps: new_comps.pop() comps = new_comps path = '/'.join(comps) if initial_slash: path = '/' + path return path or '.'
bf222c9f12c1078a5d41acf4f4ce77c1a976c67f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bf222c9f12c1078a5d41acf4f4ce77c1a976c67f/posixpath.py
if (comp != '..' or (not initial_slash and not new_comps) or
if (comp != '..' or (not initial_slashes and not new_comps) or
def normpath(path): """Normalize path, eliminating double slashes, etc.""" if path == '': return '.' initial_slash = (path[0] == '/') comps = path.split('/') new_comps = [] for comp in comps: if comp in ('', '.'): continue if (comp != '..' or (not initial_slash and not new_comps) or (new_comps and new_comps[-1] == '..')): new_comps.append(comp) elif new_comps: new_comps.pop() comps = new_comps path = '/'.join(comps) if initial_slash: path = '/' + path return path or '.'
bf222c9f12c1078a5d41acf4f4ce77c1a976c67f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bf222c9f12c1078a5d41acf4f4ce77c1a976c67f/posixpath.py
if initial_slash: path = '/' + path
if initial_slashes: path = '/'*initial_slashes + path
def normpath(path): """Normalize path, eliminating double slashes, etc.""" if path == '': return '.' initial_slash = (path[0] == '/') comps = path.split('/') new_comps = [] for comp in comps: if comp in ('', '.'): continue if (comp != '..' or (not initial_slash and not new_comps) or (new_comps and new_comps[-1] == '..')): new_comps.append(comp) elif new_comps: new_comps.pop() comps = new_comps path = '/'.join(comps) if initial_slash: path = '/' + path return path or '.'
bf222c9f12c1078a5d41acf4f4ce77c1a976c67f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bf222c9f12c1078a5d41acf4f4ce77c1a976c67f/posixpath.py
class TestMultipartMixed(unittest.TestCase):
class TestMultipartMixed(TestEmailBase):
def test_charset(self): eq = self.assertEqual msg = MIMEText('hello there', _charset='us-ascii') eq(msg.get_charset().input_charset, 'us-ascii') eq(msg['content-type'], 'text/plain; charset="us-ascii"')
513af770d7483e6b90700bbd191ebab70a83b6df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/513af770d7483e6b90700bbd191ebab70a83b6df/test_email.py
def test_basic_pty(): try: debug("Calling master_open()") master_fd, slave_name = pty.master_open() debug("Got master_fd '%d', slave_name '%s'"%(master_fd, slave_name)) debug("Calling slave_open(%r)"%(slave_name,)) slave_fd = pty.slave_open(slave_name) debug("Got slave_fd '%d'"%slave_fd) except OSError: # " An optional feature could not be imported " ... ? raise TestSkipped, "Pseudo-terminals (seemingly) not functional." if not os.isatty(slave_fd) and sys.platform not in fickle_isatty: raise TestFailed, "slave_fd is not a tty" # IRIX apparently turns \n into \r\n. Allow that, but avoid allowing other # differences (like extra whitespace, trailing garbage, etc.) debug("Writing to slave_fd") os.write(slave_fd, TEST_STRING_1) s1 = os.read(master_fd, 1024) sys.stdout.write(s1.replace("\r\n", "\n")) debug("Writing chunked output") os.write(slave_fd, TEST_STRING_2[:5]) os.write(slave_fd, TEST_STRING_2[5:]) s2 = os.read(master_fd, 1024) sys.stdout.write(s2.replace("\r\n", "\n")) os.close(slave_fd) os.close(master_fd)
84c95b94075f73e452539e71230537644a4932f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84c95b94075f73e452539e71230537644a4932f8/test_pty.py
sys.stdout.write(s1.replace("\r\n", "\n"))
sys.stdout.write(normalize_output(s1))
def test_basic_pty(): try: debug("Calling master_open()") master_fd, slave_name = pty.master_open() debug("Got master_fd '%d', slave_name '%s'"%(master_fd, slave_name)) debug("Calling slave_open(%r)"%(slave_name,)) slave_fd = pty.slave_open(slave_name) debug("Got slave_fd '%d'"%slave_fd) except OSError: # " An optional feature could not be imported " ... ? raise TestSkipped, "Pseudo-terminals (seemingly) not functional." if not os.isatty(slave_fd) and sys.platform not in fickle_isatty: raise TestFailed, "slave_fd is not a tty" # IRIX apparently turns \n into \r\n. Allow that, but avoid allowing other # differences (like extra whitespace, trailing garbage, etc.) debug("Writing to slave_fd") os.write(slave_fd, TEST_STRING_1) s1 = os.read(master_fd, 1024) sys.stdout.write(s1.replace("\r\n", "\n")) debug("Writing chunked output") os.write(slave_fd, TEST_STRING_2[:5]) os.write(slave_fd, TEST_STRING_2[5:]) s2 = os.read(master_fd, 1024) sys.stdout.write(s2.replace("\r\n", "\n")) os.close(slave_fd) os.close(master_fd)
84c95b94075f73e452539e71230537644a4932f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84c95b94075f73e452539e71230537644a4932f8/test_pty.py
sys.stdout.write(s2.replace("\r\n", "\n"))
sys.stdout.write(normalize_output(s2))
def test_basic_pty(): try: debug("Calling master_open()") master_fd, slave_name = pty.master_open() debug("Got master_fd '%d', slave_name '%s'"%(master_fd, slave_name)) debug("Calling slave_open(%r)"%(slave_name,)) slave_fd = pty.slave_open(slave_name) debug("Got slave_fd '%d'"%slave_fd) except OSError: # " An optional feature could not be imported " ... ? raise TestSkipped, "Pseudo-terminals (seemingly) not functional." if not os.isatty(slave_fd) and sys.platform not in fickle_isatty: raise TestFailed, "slave_fd is not a tty" # IRIX apparently turns \n into \r\n. Allow that, but avoid allowing other # differences (like extra whitespace, trailing garbage, etc.) debug("Writing to slave_fd") os.write(slave_fd, TEST_STRING_1) s1 = os.read(master_fd, 1024) sys.stdout.write(s1.replace("\r\n", "\n")) debug("Writing chunked output") os.write(slave_fd, TEST_STRING_2[:5]) os.write(slave_fd, TEST_STRING_2[5:]) s2 = os.read(master_fd, 1024) sys.stdout.write(s2.replace("\r\n", "\n")) os.close(slave_fd) os.close(master_fd)
84c95b94075f73e452539e71230537644a4932f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84c95b94075f73e452539e71230537644a4932f8/test_pty.py
typ, dat = self._simple_command('GETQUOTA', root)
typ, dat = self._simple_command('GETQUOTA', mailbox)
def getquotaroot(self, mailbox): """Get the list of quota roots for the named mailbox.
41b71b2f4f6e7c6ff9c92abfed2dd0f6c1a1c1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/41b71b2f4f6e7c6ff9c92abfed2dd0f6c1a1c1a2/imaplib.py
command = interpolate(SH_LOCK, file=file) p = os.popen(command) output = p.read()
def commit(self, entry): file = entry.file # Normalize line endings in body if '\r' in self.ui.body: self.ui.body = re.sub('\r\n?', '\n', self.ui.body) # Normalize whitespace in title self.ui.title = string.join(string.split(self.ui.title)) # Check that there were any changes if self.ui.body == entry.body and self.ui.title == entry.title: self.error("You didn't make any changes!") return # XXX Should lock here try: os.unlink(file) except os.error: pass try: f = open(file, 'w') except IOError, why: self.error(CANTWRITE, file=file, why=why) return date = time.ctime(now) emit(FILEHEADER, self.ui, os.environ, date=date, _file=f, _quote=0) f.write('\n') f.write(self.ui.body) f.write('\n') f.close()
2b6004a07f8c5eb6006e8c9fc466b0499b00c105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b6004a07f8c5eb6006e8c9fc466b0499b00c105/faqwiz.py
command = interpolate( SH_LOCK + '\n' + SH_CHECKIN, file=file, tfn=tfn)
command = interpolate(SH_CHECKIN, file=file, tfn=tfn) log("\n\n" + command)
def commit(self, entry): file = entry.file # Normalize line endings in body if '\r' in self.ui.body: self.ui.body = re.sub('\r\n?', '\n', self.ui.body) # Normalize whitespace in title self.ui.title = string.join(string.split(self.ui.title)) # Check that there were any changes if self.ui.body == entry.body and self.ui.title == entry.title: self.error("You didn't make any changes!") return # XXX Should lock here try: os.unlink(file) except os.error: pass try: f = open(file, 'w') except IOError, why: self.error(CANTWRITE, file=file, why=why) return date = time.ctime(now) emit(FILEHEADER, self.ui, os.environ, date=date, _file=f, _quote=0) f.write('\n') f.write(self.ui.body) f.write('\n') f.close()
2b6004a07f8c5eb6006e8c9fc466b0499b00c105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b6004a07f8c5eb6006e8c9fc466b0499b00c105/faqwiz.py
log("output: " + output) log("done: " + str(sts)) log("TempFile:\n" + open(tfn).read() + "end")
def commit(self, entry): file = entry.file # Normalize line endings in body if '\r' in self.ui.body: self.ui.body = re.sub('\r\n?', '\n', self.ui.body) # Normalize whitespace in title self.ui.title = string.join(string.split(self.ui.title)) # Check that there were any changes if self.ui.body == entry.body and self.ui.title == entry.title: self.error("You didn't make any changes!") return # XXX Should lock here try: os.unlink(file) except os.error: pass try: f = open(file, 'w') except IOError, why: self.error(CANTWRITE, file=file, why=why) return date = time.ctime(now) emit(FILEHEADER, self.ui, os.environ, date=date, _file=f, _quote=0) f.write('\n') f.write(self.ui.body) f.write('\n') f.close()
2b6004a07f8c5eb6006e8c9fc466b0499b00c105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b6004a07f8c5eb6006e8c9fc466b0499b00c105/faqwiz.py
except:
except ValueError:
def do_clear(self, arg): """Three possibilities, tried in this order: clear -> clear all breaks, ask for confirmation clear file:lineno -> clear all breaks at file:lineno clear bpno bpno ... -> clear breakpoints by number""" if not arg: try: reply = raw_input('Clear all breaks? ') except EOFError: reply = 'no' reply = reply.strip().lower() if reply in ('y', 'yes'): self.clear_all_breaks() return if ':' in arg: # Make sure it works for "clear C:\foo\bar.py:12" i = arg.rfind(':') filename = arg[:i] arg = arg[i+1:] try: lineno = int(arg) except: err = "Invalid line number (%s)" % arg else: err = self.clear_break(filename, lineno) if err: print '***', err return numberlist = arg.split() for i in numberlist: if not (0 <= i < len(bdb.Breakpoint.bpbynumber)): print 'No breakpoint numbered', i continue err = self.clear_bpbynumber(i) if err: print '***', err else: print 'Deleted breakpoint', i
23d9d45482fc3ed67c26418d20f31bfb201db4dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/23d9d45482fc3ed67c26418d20f31bfb201db4dd/pdb.py
__version__ = "
__version__ = "
def testMultiply(self): self.assertEquals((0 * 10), 0) self.assertEquals((5 * 8), 40)
b8d5f245b7077d869121835ed72656ac14962ef0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b8d5f245b7077d869121835ed72656ac14962ef0/unittest.py
self.errors.append((test, self._exc_info_to_string(err)))
self.errors.append((test, self._exc_info_to_string(err, test)))
def addError(self, 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)))
b8d5f245b7077d869121835ed72656ac14962ef0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b8d5f245b7077d869121835ed72656ac14962ef0/unittest.py