rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for ext, cmd in ARCHIVE_FORMATS:
for ext, unpackerClass, arg in ARCHIVE_FORMATS:
def unpackPackageOnly(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename self.basename = filename[:-len(ext)] cmd = cmd %...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
cmd = cmd % self.archiveFilename if self._cmd(output, self._db.preferences.buildDir, cmd): return "unpack command failed"
unpacker = unpackerClass(arg, dir=self._db.preferences.buildDir) rv = unpacker.unpack(self.archiveFilename, output=output) if rv: return rv
def unpackPackageOnly(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename self.basename = filename[:-len(ext)] cmd = cmd %...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
print 'PimpPackage_binary installPackageOnly'
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
msgs = []
if self._dict.has_key('Install-command'): return "%s: Binary package cannot have Install-command" % self.fullname()
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
msg.append("%s: Pre-install-command ignored" % self.fullname()) if self._dict.has_key('Install-command'): msgs.append("%s: Install-command ignored" % self.fullname()) if self._dict.has_key('Post-install-command'): msgs.append("%s: Post-install-command ignored" % self.fullname())
if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command'])
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
for ext, cmd in ARCHIVE_FORMATS:
for ext, unpackerClass, arg in ARCHIVE_FORMATS:
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
return "unknown extension for archive file: %s" % filename cmd = cmd % self.archiveFilename if self._cmd(output, "/", cmd): return "unpack command failed"
return "%s: unknown extension for archive file: %s" % (self.fullname(), filename) self.basename = filename[:-len(ext)] install_renames = [] for k, newloc in self._db.preferences.installLocations: if not newloc: continue if k == "--install-lib": oldloc = DEFAULT_INSTALLDIR else: return "%s: Don't know installLocation %...
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
if self._cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \
if _cmd(output, self._buildDirname, self._dict['Post-install-command']): return "%s: post-install: running \"%s\" failed" % \
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']):
if _cmd(output, self._buildDirname, self._dict['Pre-install-command']):
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-instal...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
installcmd = '"%s" setup.py install' % sys.executable if self._cmd(output, self._buildDirname, installcmd):
extra_args = "" for k, v in self._db.preferences.installLocations: if not v: if not unwanted_install_dir: unwanted_install_dir = tempfile.mkdtemp() v = unwanted_install_dir extra_args = extra_args + " %s \"%s\"" % (k, v) installcmd = '"%s" setup.py install %s' % (sys.executable, extra_args) if _cmd(output, self._buil...
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-instal...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
if self._cmd(output, self._buildDirname, self._dict['Post-install-command']):
if _cmd(output, self._buildDirname, self._dict['Post-install-command']):
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-instal...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
def _run(mode, verbose, force, args):
def _run(mode, verbose, force, args, prefargs):
def _run(mode, verbose, force, args): """Engine for the main program""" prefs = PimpPreferences() prefs.check() db = PimpDatabase(prefs) db.appendURL(prefs.pimpDatabase) if mode == 'dump': db.dump(sys.stdout) elif mode =='list': if not args: args = db.listnames() print "%-20.20s\t%s" % ("Package", "Description") prin...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
prefs = PimpPreferences() prefs.check()
prefs = PimpPreferences(**prefargs) rv = prefs.check() if rv: sys.stdout.write(rv)
def _run(mode, verbose, force, args): """Engine for the main program""" prefs = PimpPreferences() prefs.check() db = PimpDatabase(prefs) db.appendURL(prefs.pimpDatabase) if mode == 'dump': db.dump(sys.stdout) elif mode =='list': if not args: args = db.listnames() print "%-20.20s\t%s" % ("Package", "Description") prin...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
print "\tDownload URL:\t", pkg.downloadURL()
try: print "\tDownload URL:\t", pkg.downloadURL() except KeyError: pass
def _run(mode, verbose, force, args): """Engine for the main program""" prefs = PimpPreferences() prefs.check() db = PimpDatabase(prefs) db.appendURL(prefs.pimpDatabase) if mode == 'dump': db.dump(sys.stdout) elif mode =='list': if not args: args = db.listnames() print "%-20.20s\t%s" % ("Package", "Description") prin...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout"
print "Usage: pimp [options] -s [package ...] List installed status" print " pimp [options] -l [package ...] Show package information" print " pimp [options] -i package ... Install packages" print " pimp -d Dump database to stdout"
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
print " -v Verbose" print " -f Force installation"
print " -v Verbose" print " -f Force installation" print " -D dir Set destination directory (default: site-packages)"
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
opts, args = getopt.getopt(sys.argv[1:], "slifvd")
opts, args = getopt.getopt(sys.argv[1:], "slifvdD:")
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
_run(mode, verbose, force, args)
_run(mode, verbose, force, args, prefargs)
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
'<<run-module>>': ['<F5>'], '<<debug-module>>': ['<Control-F5>'],
'<<import-module>>': ['<F5>'], '<<run-script>>': ['<Control-F5>'],
def flush(self): pass
0f7bf9aa832457c0b2fb08989aef76eee9031e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0f7bf9aa832457c0b2fb08989aef76eee9031e6e/ScriptBinding.py
('Run module', '<<run-module>>'), ('Debug module', '<<debug-module>>'),
('Import module', '<<import-module>>'), ('Run script', '<<run-script>>'),
def flush(self): pass
0f7bf9aa832457c0b2fb08989aef76eee9031e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0f7bf9aa832457c0b2fb08989aef76eee9031e6e/ScriptBinding.py
def run_module_event(self, event, debugger=None):
def import_module_event(self, event): filename = self.getfilename() if not filename: return modname, ext = os.path.splitext(os.path.basename(filename)) if sys.modules.has_key(modname): mod = sys.modules[modname] else: mod = imp.new_module(modname) sys.modules[modname] = mod mod.__file__ = filename setattr(sys.modules[...
def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file...
0f7bf9aa832457c0b2fb08989aef76eee9031e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0f7bf9aa832457c0b2fb08989aef76eee9031e6e/ScriptBinding.py
modname, ext = os.path.splitext(os.path.basename(filename)) if sys.modules.has_key(modname): mod = sys.modules[modname] else: mod = imp.new_module(modname) sys.modules[modname] = mod mod.__file__ = filename saveout = sys.stdout saveerr = sys.stderr owin = OnDemandOutputWindow(self.editwin.flist) try: sys.stderr = Pseud...
return filename
def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file...
0f7bf9aa832457c0b2fb08989aef76eee9031e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0f7bf9aa832457c0b2fb08989aef76eee9031e6e/ScriptBinding.py
if type(iterable) not in (list, tuple, dict, file, xrange, str): iterable = tuple(iterable) it = iter(iterable)
def _update(self, iterable): # The main loop for update() and the subclass __init__() methods. data = self._data
5b36223adb1bbf2da0373f99057d5a345a620682 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b36223adb1bbf2da0373f99057d5a345a620682/sets.py
while True: try: for element in it:
if type(iterable) in (list, tuple, xrange): it = iter(iterable) while True: try: for element in it: data[element] = value return except TypeError: transform = getattr(element, "_as_immutable", None) if transform is None: raise data[transform()] = value else: for element in iterable: try:
def _update(self, iterable): # The main loop for update() and the subclass __init__() methods. data = self._data
5b36223adb1bbf2da0373f99057d5a345a620682 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b36223adb1bbf2da0373f99057d5a345a620682/sets.py
return except TypeError: transform = getattr(element, "_as_immutable", None) if transform is None: raise data[transform()] = value
except TypeError: transform = getattr(element, "_as_immutable", None) if transform is None: raise data[transform()] = value
def _update(self, iterable): # The main loop for update() and the subclass __init__() methods. data = self._data
5b36223adb1bbf2da0373f99057d5a345a620682 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b36223adb1bbf2da0373f99057d5a345a620682/sets.py
return getint(
return self.tk.getint(
def winfo_id(self): return getint( self.tk.call('winfo', 'id', self._w))
b8418545a524c3f76ba129917cc25446b0df482a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8418545a524c3f76ba129917cc25446b0df482a/Tkinter.py
str = '%s %s%s' % (cmd, args, CRLF)
if args == "": str = '%s%s' % (cmd, CRLF) else: str = '%s %s%s' % (cmd, args, CRLF)
def putcmd(self, cmd, args=""): """Send a command to the server.""" str = '%s %s%s' % (cmd, args, CRLF) self.send(str)
ebc5d5bdf725625f1f68dadc52eb337609488318 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebc5d5bdf725625f1f68dadc52eb337609488318/smtplib.py
optionlist = string.join(options, ' ') self.putcmd("mail", "FROM:%s %s" % (quoteaddr(sender) ,optionlist))
optionlist = ' ' + string.join(options, ' ') self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender) ,optionlist))
def mail(self,sender,options=[]): """SMTP 'mail' command -- begins mail xfer session.""" optionlist = '' if options and self.does_esmtp: optionlist = string.join(options, ' ') self.putcmd("mail", "FROM:%s %s" % (quoteaddr(sender) ,optionlist)) return self.getreply()
ebc5d5bdf725625f1f68dadc52eb337609488318 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebc5d5bdf725625f1f68dadc52eb337609488318/smtplib.py
list.append(errordict[e], errorfirst[e], errorlast[e], e)
list.append((errordict[e], errorfirst[e], errorlast[e], e))
def parsedir(dir, modify): os.chdir(dir) pat = re.compile('^[0-9]*$') errordict = {} errorfirst = {} errorlast = {} nok = nwarn = nbad = 0 # find all numeric file names and sort them files = filter(lambda fn, pat=pat: pat.match(fn) is not None, os.listdir('.')) files.sort(sort_numeric) for fn in files: # Lets try to ...
cbc73eb41f96477ecff2404449fd7028f25f3dc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cbc73eb41f96477ecff2404449fd7028f25f3dc5/mailerdaemon.py
Execution: --help Display this help then exit. --version Output version information then exit. -t,--trace Print the line to be executed to sys.stdout. -c,--count Count the number of times a line is executed. Results are written in the results file, if given. -r,--report Genera...
Meta-options: --help Display this help then exit. --version Output version information then exit. Otherwise, exactly one of the following three options must be given: -t, --trace Print each line to sys.stdout before it is executed. -c, --count Count the number of times ea...
def usage(outfile): outfile.write("""Usage: %s [OPTIONS] <file> [ARGS]
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
def usage(outfile): outfile.write("""Usage: %s [OPTIONS] <file> [ARGS]
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
def __init__(self, modules = None, dirs = None): self._mods = modules or [] self._dirs = dirs or []
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
def run(trace, cmd): import __main__ dict = __main__.__dict__ sys.settrace(trace) try: exec cmd in dict, dict finally: sys.settrace(None) def runctx(trace, cmd, globals=None, locals=None): if globals is None: globals = {} if locals is None: locals = {} sys.settrace(trace) try: exec cmd in dict, dict finally: sys.settr...
def run(trace, cmd): import __main__ dict = __main__.__dict__ sys.settrace(trace) try: exec cmd in dict, dict finally: sys.settrace(None)
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
def __init__(self, counts = {}, modules = {}): self.counts = counts.copy() self.modules = modules.copy()
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() self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.calledfuncs.copy() self.infile = infile ...
def __init__(self, counts = {}, modules = {}): self.counts = counts.copy() # map (filename, lineno) to count self.modules = modules.copy() # map filenames to modules
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
modules = self.modules other_modules = other.modules
other_calledfuncs = other.calledfuncs
def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts other_counts = other.counts modules = self.modules other_modules = other.modules
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
counts[key] = counts.get(key, 0) + other_counts[key] for key in other_modules.keys(): if modules.has_key(key): assert modules[key] == other_modules[key], \ "Strange! filename %s has two different module " \ "names: %s and %s" % \ (key, modules[key], other_modules[key])
if key != 'calledfuncs': counts[key] = counts.get(key, 0) + other_counts[key] for key in other_calledfuncs.keys(): calledfuncs[key] = 1 def write_results(self, show_missing = 1, summary = 0, coverdir = None): """ @param coverdir """ for (filename, modulename, funcname,) in self.calledfuncs.keys(): print "filename: %s...
def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts other_counts = other.counts modules = self.modules other_modules = other.modules
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
modules[key] = other_modules[key]
thiscoverdir = os.path.dirname(os.path.abspath(filename)) tx = None try: os.makedirs(thiscoverdir) except OSError, x: tx = x if not os.path.isdir(thiscoverdir): if tx: raise tx raise exceptions.IOError, "unknown error prevented creation of directory: %s" % thiscoverdir if "." in modulename: finalname = modulen...
def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts other_counts = other.counts modules = self.modules other_modules = other.modules
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = per_file.get(filename, {}) lines_hit[lineno] = results.counts[(filename, lineno)] try: counts = mar...
class Trace: def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just ou...
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
fndir = os.path.dirname(filename) if os.path.isabs(filename): coverpath = fndir
self.donothing = 1 def run(self, cmd): import __main__ dict = __main__.__dict__ if not self.donothing: sys.settrace(self.globaltrace) try: exec cmd in dict, dict finally: if not self.donothing: sys.settrace(None) def runctx(self, cmd, globals=None, locals=None): if globals is None: globals = {} if locals is None: lo...
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
coverpath = os.path.join(dirname, fndir) if "." in modulename: finalname = modulename.split(".")[-1] listfilename = os.path.join(coverpath, finalname + ".cover")
modulename = None self._calledfuncs[(filename, modulename, funcname,)] = 1 def globaltrace_lt(self, frame, why, arg): """ Handles `call' events (why == 'call') and if the code block being entered is to be ignored then it returns `None', else it returns `self.localtrace'. """ if why == 'call': (filename, lineno, funcna...
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
listfilename = os.path.join(coverpath, modulename + ".cover") try: lines = open(filename, 'r').readlines() except IOError, err: print >> sys.stderr, "trace: Could not open %s for reading " \ "because: %s - skipping" % (`filename`, err) continue try: outfile = open(listfilename, 'w') except IOError, err: sys.stderr.w...
return None def localtrace_trace_and_count(self, frame, why, arg): if why == 'line': (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame, 1) key = (filename, lineno,) self.counts[key] = self.counts.get(key, 0) + 1 bname = self.pathtobasename.get(filename) if bname is None: bname = self....
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
marshal.dump(results.counts, open(os.path.join(dirname, "counts"), "w")) marshal.dump(results.modules, open(os.path.join(dirname, "modules"), "w")) except IOError, err: sys.stderr.write("cannot save counts/modules " \ "files because %s" % err) if summary and sums: mods = sums.keys() mods.sort() print "lines cov% m...
print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass return self.localtrace def localtrace_trace(self, frame, why, arg):
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0, summary = 0, coverdir = None): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = p...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename
(filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame) bname = self.pathtobasename.get(filename) if bname is None: bname = self.pathtobasename.setdefault(filename, os.path.basename(filename))
def trace(self, frame, why, arg): if why == 'line': # something is fishy about getting the file name filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename try: modulename = frame.f_globals["__name__"] except KeyError: # PyRun_String() for example # XXX what to do? mod...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
modulename = frame.f_globals["__name__"] except KeyError: modulename = None ignore_it = self.ignore_names.get(modulename, -1) if ignore_it == -1: sys.settrace(None) ignore_it = self.ignore.names(filename, modulename) sys.settrace(self.trace) self.modules[filename] = modulename if not ignore_it: lineno = frame.f...
print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass return self.localtrace def localtrace_count(self, frame, why, arg): if why == 'line': (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame) key = (filename, lineno,) self.counts[key] = self.counts.get(key, ...
def trace(self, frame, why, arg): if why == 'line': # something is fishy about getting the file name filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename try: modulename = frame.f_globals["__name__"] except KeyError: # PyRun_String() for example # XXX what to do? mod...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
return CoverageResults(self.counts, self.modules) class Trace: def __init__(self, ignore = Ignore()): self.ignore = ignore self.ignore_names = ignore._ignore self.files = {'<string>': None} def trace(self, frame, why, arg): if why == 'line': filename = frame.f_code.co_filename try: modulename = frame.f_globals["__n...
return CoverageResults(self.counts, infile=self.infile, outfile=self.outfile, calledfuncs=self._calledfuncs)
def results(self): return CoverageResults(self.counts, self.modules)
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
print >> sys.stderr, "%s: %s" % (sys.argv[0], msg)
sys.stderr.write("%s: %s\n" % (sys.argv[0], msg))
def _err_exit(msg): print >> sys.stderr, "%s: %s" % (sys.argv[0], msg) sys.exit(1)
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
def main(argv = None):
def main(argv=None):
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:",
opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:l",
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
"file=", "logdir=", "missing",
"file=", "missing",
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
"coverdir="])
"coverdir=", "listfuncs",])
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
print >> sys.stderr, "%s: %s" % (sys.argv[0], msg) print >> sys.stderr, "Try `%s --help' for more information" \ % sys.argv[0]
sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.stderr.write("Try `%s --help' for more information\n" % sys.argv[0])
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
logdir = "."
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
continue if opt == "-d" or opt == "--logdir": logdir = val
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
if len(prog_argv) == 0: _err_exit("missing name of file to run") if count + trace + report > 1: _err_exit("can only specify one of --trace, --count or --report") if count + trace + report == 0: _err_exit("must specify one of --trace, --count or --report") if report and counts_file is None: _err_exit("--report requir...
if listfuncs and (count or trace): _err_exit("cannot specify both --listfuncs and (--trace or --count)") if not count and not trace and not report and not listfuncs: _err_exit("must specify one of --trace, --count, --report or --listfuncs")
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
if logdir is not None: if not os.path.isdir(logdir): sys.stderr.write( "trace: WARNING, --logdir directory %s is not available\n" % `logdir`) sys.argv = prog_argv progname = prog_argv[0] if eval(sys.version[:3])>1.3: sys.path[0] = os.path.split(progname)[0]
if report and not counts_file: _err_exit("--report requires a --file") if no_report and len(prog_argv) == 0: _err_exit("missing name of file to run")
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
ignore = Ignore(ignore_modules, ignore_dirs) if trace: t = Trace(ignore)
if report: results = CoverageResults(infile=counts_file, outfile=counts_file) results.write_results(missing, summary=summary, coverdir=coverdir) else: sys.argv = prog_argv progname = prog_argv[0] if eval(sys.version[:3])>1.3: sys.path[0] = os.path.split(progname)[0] t = Trace(count, trace, countfuncs=listfuncs, ignore...
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
run(t.trace, 'execfile(' + `progname` + ')')
t.run('execfile(' + `progname` + ')')
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
_err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err)) elif count: t = Coverage(ignore) try: run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err))
_err_exit("Cannot run file %s because: %s" % (`sys.argv[0]`, err))
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
results.modules[progname] = os.path.splitext(progname)[0] if counts_file: try: old_counts, old_modules = marshal.load(open(counts_file, 'rb')) except IOError: pass else: results.update(CoverageResults(old_counts, old_modules))
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
create_results_log(results, logdir, missing, summary=summary, coverdir=coverdir) if counts_file: try: marshal.dump( (results.counts, results.modules), open(counts_file, 'wb')) except IOError, err: _err_exit("Cannot save counts file %s because: %s" % \ (`counts_file`, err)) elif report: old_counts, old_modules = marsh...
results.write_results(missing, summary=summary, coverdir=coverdir)
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir=", "coverdir="]) except getopt.error, msg: print >> sys.stderr,...
8fb89f9fd74a61e165437eec10be9ace4c3738cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fb89f9fd74a61e165437eec10be9ace4c3738cb/trace.py
fp.write("%s = %s\n" % (key, value))
fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
def write(self, fp): """Write an .ini-format representation of the configuration state.""" if self.__defaults: fp.write("[DEFAULT]\n") for (key, value) in self.__defaults.items(): fp.write("%s = %s\n" % (key, value)) fp.write("\n") for section in self.sections(): fp.write("[" + section + "]\n") sectdict = self.__sectio...
63a6f820451f75d73870412cafb71a9d4ad3f8b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63a6f820451f75d73870412cafb71a9d4ad3f8b2/ConfigParser.py
fp.write("%s = %s\n" % (key, value))
fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
def write(self, fp): """Write an .ini-format representation of the configuration state.""" if self.__defaults: fp.write("[DEFAULT]\n") for (key, value) in self.__defaults.items(): fp.write("%s = %s\n" % (key, value)) fp.write("\n") for section in self.sections(): fp.write("[" + section + "]\n") sectdict = self.__sectio...
63a6f820451f75d73870412cafb71a9d4ad3f8b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63a6f820451f75d73870412cafb71a9d4ad3f8b2/ConfigParser.py
def group(i):
def group(self, i):
def group(i):
a20887644445cc7d064bf0f95ef220871a563326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a20887644445cc7d064bf0f95ef220871a563326/re.py
def assemble_set(self, position, labels):
def assemble(self, position, labels):
def assemble_set(self, position, labels):
a20887644445cc7d064bf0f95ef220871a563326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a20887644445cc7d064bf0f95ef220871a563326/re.py
if c in self.set[2]:
if c in self.set:
def assemble_set(self, position, labels):
a20887644445cc7d064bf0f95ef220871a563326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a20887644445cc7d064bf0f95ef220871a563326/re.py
result = result + `char`
result = result + char
def __repr__(self):
a20887644445cc7d064bf0f95ef220871a563326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a20887644445cc7d064bf0f95ef220871a563326/re.py
if stack[-1][0][1] > 0:
if stack[-1][0].register > 0:
def compile(pattern, flags=0): stack = [] index = 0 label = 0 register = 1 groupindex = {} callouts = [] while (index < len(pattern)): char = pattern[index] index = index + 1 if char == '\\': if index < len(pattern): next = pattern[index] index = index + 1 if next == 't': stack.append([Exact(chr(9))]) elif next == 'n'...
a20887644445cc7d064bf0f95ef220871a563326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a20887644445cc7d064bf0f95ef220871a563326/re.py
def compile(pattern, flags=0): stack = [] index = 0 label = 0 register = 1 groupindex = {} callouts = [] while (index < len(pattern)): char = pattern[index] index = index + 1 if char == '\\': if index < len(pattern): next = pattern[index] index = index + 1 if next == 't': stack.append([Exact(chr(9))]) elif next == 'n'...
a20887644445cc7d064bf0f95ef220871a563326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a20887644445cc7d064bf0f95ef220871a563326/re.py
def gauss(mu, sigma): # When x and y are two variables from [0, 1), uniformly # distributed, then # # cos(2*pi*x)*log(1-y) # sin(2*pi*x)*log(1-y) # # are two *independent* variables with normal distribution # (mu = 0, sigma = 1). # (Lambert Meertens) global gauss_next if gauss_next != None: z = gauss_next gaus...
84c89489403c04b2fde0d5d8141599b598e20250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/84c89489403c04b2fde0d5d8141599b598e20250/random.py
log1_y = log(1.0 - random()) z = cos(x2pi) * log1_y gauss_next = sin(x2pi) * log1_y
g2rad = sqrt(-2.0 * log(1.0 - random())) z = cos(x2pi) * g2rad gauss_next = sin(x2pi) * g2rad
def gauss(mu, sigma): # When x and y are two variables from [0, 1), uniformly # distributed, then # # cos(2*pi*x)*log(1-y) # sin(2*pi*x)*log(1-y) # # are two *independent* variables with normal distribution # (mu = 0, sigma = 1). # (Lambert Meertens) global gauss_next if gauss_next != None: z = gauss_next gaus...
84c89489403c04b2fde0d5d8141599b598e20250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/84c89489403c04b2fde0d5d8141599b598e20250/random.py
pkg = PimpPackage(self, dict(p))
p = dict(p) flavor = p.get('Flavor') if flavor == 'source': pkg = PimpPackage_source(self, p) elif flavor == 'binary': pkg = PimpPackage_binary(self, p) else: pkg = PimpPackage(self, dict(p))
def _appendPackages(self, packages): """Given a list of dictionaries containing package descriptions create the PimpPackage objects and append them to our internal storage.""" for p in packages: pkg = PimpPackage(self, dict(p)) self._packages.append(pkg)
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
def homepage(self): return self._dict['Home-page']
def homepage(self): return self._dict.get('Home-page')
def homepage(self): return self._dict['Home-page']
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
if not self._dict['Prerequisites']:
if not self._dict.get('Prerequisites'):
def prerequisites(self): """Return a list of prerequisites for this package. The list contains 2-tuples, of which the first item is either a PimpPackage object or None, and the second is a descriptive string. The first item can be None if this package depends on something that isn't pimp-installable, in which case the...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
def downloadSinglePackage(self, output=None):
def downloadPackageOnly(self, output=None):
def downloadSinglePackage(self, output=None): """Download a single package, if needed. An MD5 signature is used to determine whether download is needed, and to test that we actually downloaded what we expected. If output is given it is a file-like object that will receive a log of what happens. If anything unforeseen...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
def unpackSinglePackage(self, output=None):
def unpackPackageOnly(self, output=None):
def unpackSinglePackage(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename basename = filename[:-len(ext)] cmd = cmd % se...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
self._buildDirname = os.path.join(self._db.preferences.buildDir, basename)
def unpackSinglePackage(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename basename = filename[:-len(ext)] cmd = cmd % se...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
setupname = os.path.join(self._buildDirname, "setup.py") if not os.path.exists(setupname) and not NO_EXECUTE: return "no setup.py found after unpack of archive"
def installPackageOnly(self, output=None): """Default install method, to be overridden by subclasses""" return "Cannot automatically install package %s" % self.fullname()
def unpackSinglePackage(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename basename = filename[:-len(ext)] cmd = cmd % se...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
msg = self.downloadSinglePackage(output)
msg = self.downloadPackageOnly(output)
def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
msg = self.unpackSinglePackage(output)
msg = self.unpackPackageOnly(output)
def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) old_contents = os.listdir(self._db.preferences.installDir) installcmd = self._dict.get('Inst...
return self.installPackageOnly(output) def beforeInstall(self): """Bookkeeping before installation: remember what we have in site-packages""" self._old_contents = os.listdir(self._db.preferences.installDir) def afterInstall(self): """Bookkeeping after installation: interpret any new .pth files that have appeared"""
def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
self._interpretPthFiles(old_contents, new_contents) if self._dict.has_key('Post-install-command'): if self._cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) return None def _interpretPthFiles(...
def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually" % _fmtpackagename(self) msg = sel...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
if fn in old_contents:
if fn in self._old_contents:
def _interpretPthFiles(self, old_contents, new_contents): """Evaluate any new .pth files that have appeared after installing""" for fn in new_contents: if fn in old_contents: continue if fn[-4:] != '.pth': continue fullname = os.path.join(self._db.preferences.installDir, fn) f = open(fullname) for line in f.readlines()...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
sys.path.append(line)
sys.path.append(line) class PimpPackage_binary(PimpPackage): def unpackPackageOnly(self, output=None): """We don't unpack binary packages until installing""" pass def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a l...
def _interpretPthFiles(self, old_contents, new_contents): """Evaluate any new .pth files that have appeared after installing""" for fn in new_contents: if fn in old_contents: continue if fn[-4:] != '.pth': continue fullname = os.path.join(self._db.preferences.installDir, fn) f = open(fullname) for line in f.readlines()...
1d3730ef47bcca7b678759a7198c470c83ac4761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d3730ef47bcca7b678759a7198c470c83ac4761/pimp.py
output = struct.pack("iiiiiii", 0x950412de,
output = struct.pack("Iiiiiii", 0x950412deL,
def generate(): "Return the generated output." global MESSAGES keys = MESSAGES.keys() # the keys are sorted in the .mo file keys.sort() offsets = [] ids = strs = '' for id in keys: # For each string, we need size and file offset. Each string is NUL # terminated; the NUL does not count into the size. offsets.append((le...
30f69d60a52c2b07efbf334260cea08d299a2b75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30f69d60a52c2b07efbf334260cea08d299a2b75/msgfmt.py
f2 = self.tar.extractfile("/S-SPARSE-WITH-NULLS")
f2 = self.tar.extractfile("S-SPARSE-WITH-NULLS")
def test_sparse(self): """Test sparse member extraction. """ if self.sep != "|": f1 = self.tar.extractfile("S-SPARSE") f2 = self.tar.extractfile("/S-SPARSE-WITH-NULLS") self.assert_(f1.read() == f2.read(), "_FileObject failed on sparse file member")
31a97c95bc4eb520dd91bad6c1a67229852334b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/31a97c95bc4eb520dd91bad6c1a67229852334b5/test_tarfile.py
filename = "/0-REGTYPE-TEXT"
filename = "0-REGTYPE-TEXT"
def test_readlines(self): """Test readlines() method of _FileObject. """ if self.sep != "|": filename = "/0-REGTYPE-TEXT" self.tar.extract(filename, dirname()) lines1 = file(os.path.join(dirname(), filename), "rU").readlines() lines2 = self.tar.extractfile(filename).readlines() self.assert_(lines1 == lines2, "_FileObje...
31a97c95bc4eb520dd91bad6c1a67229852334b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/31a97c95bc4eb520dd91bad6c1a67229852334b5/test_tarfile.py
filename = "/0-REGTYPE"
filename = "0-REGTYPE"
def test_seek(self): """Test seek() method of _FileObject, incl. random reading. """ if self.sep != "|": filename = "/0-REGTYPE" self.tar.extract(filename, dirname()) data = file(os.path.join(dirname(), filename), "rb").read()
31a97c95bc4eb520dd91bad6c1a67229852334b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/31a97c95bc4eb520dd91bad6c1a67229852334b5/test_tarfile.py
ssl = socket.ssl(sock, self.key_file, self.cert_file)
realsock = sock if hasattr(sock, "_sock"): realsock = sock._sock ssl = socket.ssl(realsock, self.key_file, self.cert_file)
def connect(self): "Connect to a host on a given (SSL) port."
cf6dac61977013e816df1390ade52ce4f73e82ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf6dac61977013e816df1390ade52ce4f73e82ef/httplib.py
if sys.platform[:4] != 'java': value = u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"} else: value = u"%(x)s, %()s" % {'x':u"abc", u'':"def"}
value = u"%(x)s, %()s" % {'x':u"abc", u'':"def"}
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
43c50ebad143367680b896b369900516fdc20409 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43c50ebad143367680b896b369900516fdc20409/test_unicode.py
print 'd=', d
def message(str = "Hello, world!", id = MESSAGE_ID): """Show a simple alert with a text message""" d = GetNewDialog(id, -1) d.SetDialogDefaultItem(1) print 'd=', d tp, h, rect = d.GetDialogItem(2) SetDialogItemText(h, str) while 1: n = ModalDialog(None) if n == 1: break
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
return [0]*7, None return map(lambda x: ord(x), opr.data), opr
return [0]*9, None options = map(lambda x: ord(x), opr.data) while len(options) < 9: options = options + [0] return options, opr
def getoptions(id): try: opr = GetResource('Popt', id) except (MacOS.Error, Res.Error): return [0]*7, None return map(lambda x: ord(x), opr.data), opr
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
print 'Created new GUSI option' ngusi_opr = Resource(gusi_opr.data)
ngusi_opr = Resource(newdata)
def edit_preferences(): preff_handle = openpreffile(WRITE) l, sr = getprefpath(PATH_STRINGS_ID) if l == None: message('Cannot find any sys.path resource! (Old python?)') sys.exit(0) fss, dr, fss_changed = getprefdir(DIRECTORY_ID) if fss == None: fss = macfs.FSSpec(os.getcwd()) fss_changed = 1 options, opr = getoptio...
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
if not opr:
if not gusi_opr:
def edit_applet(name): pref_handle = openpreffile(READ) app_handle = openapplet(name) notfound = '' l, sr = getprefpath(OVERRIDE_PATH_STRINGS_ID) if l == None: notfound = 'path' l, dummy = getprefpath(PATH_STRINGS_ID) if l == None: message('Cannot find any sys.path resource! (Old python?)') sys.exit(0) fss, dr, fss_...
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
creator, type, delaycons, dummy = getgusioptions(GUSI_ID)
creator, type, delaycons, gusi_opr = getgusioptions(GUSI_ID)
def edit_applet(name): pref_handle = openpreffile(READ) app_handle = openapplet(name) notfound = '' l, sr = getprefpath(OVERRIDE_PATH_STRINGS_ID) if l == None: notfound = 'path' l, dummy = getprefpath(PATH_STRINGS_ID) if l == None: message('Cannot find any sys.path resource! (Old python?)') sys.exit(0) fss, dr, fss_...
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
pathlist, nfss, options = result
pathlist, nfss, (options, creator, type, delaycons) = result
def edit_applet(name): pref_handle = openpreffile(READ) app_handle = openapplet(name) notfound = '' l, sr = getprefpath(OVERRIDE_PATH_STRINGS_ID) if l == None: notfound = 'path' l, dummy = getprefpath(PATH_STRINGS_ID) if l == None: message('Cannot find any sys.path resource! (Old python?)') sys.exit(0) fss, dr, fss_...
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
if gusi_opr.HomeResFile == app_handle:
id, type, name = gusi_opr.GetResInfo() if gusi_opr.HomeResFile() == app_handle and id == OVERRIDE_GUSI_ID:
def edit_applet(name): pref_handle = openpreffile(READ) app_handle = openapplet(name) notfound = '' l, sr = getprefpath(OVERRIDE_PATH_STRINGS_ID) if l == None: notfound = 'path' l, dummy = getprefpath(PATH_STRINGS_ID) if l == None: message('Cannot find any sys.path resource! (Old python?)') sys.exit(0) fss, dr, fss_...
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
gusi_opr = Resource(gusi_opr.data) gusi_opr.AddResource('GU\267I', OVERRIDE_GUSI_ID, '')
ngusi_opr = Resource(newdata) ngusi_opr.AddResource('GU\267I', OVERRIDE_GUSI_ID, '')
def edit_applet(name): pref_handle = openpreffile(READ) app_handle = openapplet(name) notfound = '' l, sr = getprefpath(OVERRIDE_PATH_STRINGS_ID) if l == None: notfound = 'path' l, dummy = getprefpath(PATH_STRINGS_ID) if l == None: message('Cannot find any sys.path resource! (Old python?)') sys.exit(0) fss, dr, fss_...
a332b7fe15a2360fd3e6adb90cdd941e2110cd0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a332b7fe15a2360fd3e6adb90cdd941e2110cd0e/EditPythonPrefs.py
self.build_scripts = os.path.join(self.build_base, 'scripts')
self.build_scripts = os.path.join(self.build_base, 'scripts-' + sys.version[0:3])
def finalize_options (self):
9432523c983092187b3e3d657e078956eaaf58c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9432523c983092187b3e3d657e078956eaaf58c5/build.py
if not self.have_fork: for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE'): env.setdefault(k, "")
for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE'): env.setdefault(k, "")
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip...
ced83d7d242efe1df4da6c22498fbd65ace6b9dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ced83d7d242efe1df4da6c22498fbd65ace6b9dc/CGIHTTPServer.py
underline=0,indicatoron=FALSE,highlightthickness=0,
indicatoron=FALSE,highlightthickness=0,
def __init__(self,parent): Frame.__init__(self, parent,borderwidth=2,relief=RIDGE) self.button=Radiobutton(self,padx=5,pady=5,takefocus=FALSE, underline=0,indicatoron=FALSE,highlightthickness=0, borderwidth=0,selectcolor=self.cget('bg')) self.button.pack()
fd0c7693beb8def1f7e8ebe5f457ae8557da7e12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fd0c7693beb8def1f7e8ebe5f457ae8557da7e12/tabpage.py