rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
for inc in get_inclist(rp): return_list.append(inc.getinctime()) | for inc in get_inclist(rp): d[inc.getinctime()] = None for inc in get_inclist(Globals.rbdir.append("mirror_metadata")): d[inc.getinctime()] = None return_list = d.keys() return_list.sort() | def get_increment_times(cls, rp = None): """Return list of times of backups, including current mirror""" if not _mirror_time: return_list = [cls.get_mirror_time()] else: return_list = [_mirror_time] if not rp or not rp.index: rp = Globals.rbdir.append("increments") for inc in get_inclist(rp): return_list.append(inc.get... | 81065bd1ac2a806c81fb61202de24f8cd88d6c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/81065bd1ac2a806c81fb61202de24f8cd88d6c28/restore.py |
self.name2id_dict[name] = out_id | if out_id is not None: self.name2id_dict[name] = out_id | def get_id_from_name(self, name): """Return mapped id from name only, or None if cannot""" try: return self.name2id_dict[name] except KeyError: out_id = self.find_id_from_name(name) self.name2id_dict[name] = out_id return out_id | a65d203a4164dc353cd72f52e3de466ffe3fdc75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/a65d203a4164dc353cd72f52e3de466ffe3fdc75/user_group.py |
if time.daylight: utc_in_secs = time.mktime(timetuple) - time.altzone | if dst_in_effect: utc_in_secs = time.mktime(timetuple) - time.altzone | def stringtotime(timestring): """Return time in seconds from w3 timestring If there is an error parsing the string, or it doesn't look like a w3 datetime string, return None. """ try: date, daytime = timestring[:19].split("T") year, month, day = map(int, date.split("-")) hour, minute, second = map(int, daytime.split(... | 8b39890779e75a3bd728c2feb98022450b8adc44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/8b39890779e75a3bd728c2feb98022450b8adc44/Time.py |
if time.daylight: offset = -1 * time.altzone/60 else: offset = -1 * time.timezone/60 | if dst_in_effect: offset = -time.altzone/60 else: offset = -time.timezone/60 | def gettzd(): """Return w3's timezone identification string. Expresed as [+/-]hh:mm. For instance, PST is -08:00. Zone is coincides with what localtime(), etc., use. """ if time.daylight: offset = -1 * time.altzone/60 else: offset = -1 * time.timezone/60 if offset > 0: prefix = "+" elif offset < 0: prefix = "-" els... | 8b39890779e75a3bd728c2feb98022450b8adc44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/8b39890779e75a3bd728c2feb98022450b8adc44/Time.py |
if Globals.process_uid != 0: self.perm_changer(rf.mirror_rp) | if Globals.process_uid != 0: self.perm_changer(index) | def get_rf(self, index): """Return RestoreFile of given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list[0] if rf.index == index: if Globals.process_uid != 0: self.perm_changer(rf.mirror_rp) return rf elif rf.index > index: # Try to add earlier indicies. But if ... | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
if Globals.process_uid != 0: self.perm_changer(temp_rf.mirror_rp) | def add_rfs(self, index): """Given index, add the rfs in that same directory | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py | |
def __call__(self, rp): """Given rpath, change permissions up and including rp""" index, old_index = rp.index, self.current_index | def __call__(self, index): """Given rpath, change permissions up to and including index""" old_index = self.current_index | def __call__(self, rp): """Given rpath, change permissions up and including rp""" index, old_index = rp.index, self.current_index self.current_index = index if not index or index == old_index: return assert index > old_index, (index, old_index) self.restore_old(rp, index) self.add_new(rp, old_index, index) | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
if not index or index == old_index: return assert index > old_index, (index, old_index) self.restore_old(rp, index) self.add_new(rp, old_index, index) def restore_old(self, rp, index): | if not index or index <= old_index: return self.restore_old(index) self.add_new(old_index, index) def restore_old(self, index): | def __call__(self, rp): """Given rpath, change permissions up and including rp""" index, old_index = rp.index, self.current_index self.current_index = index if not index or index == old_index: return assert index > old_index, (index, old_index) self.restore_old(rp, index) self.add_new(rp, old_index, index) | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
def add_new(self, rp, old_index, index): | def add_new(self, old_index, index): | def add_new(self, rp, old_index, index): """Change permissions of directories between old_index and index""" for rp in self.get_new_rp_list(rp, old_index, index): if ((rp.isreg() and not rp.readable()) or (rp.isdir() and not rp.hasfullperms())): old_perms = rp.getperms() self.open_index_list.insert(0, (index, rp, old_p... | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
for rp in self.get_new_rp_list(rp, old_index, index): | for rp in self.get_new_rp_list(old_index, index): | def add_new(self, rp, old_index, index): """Change permissions of directories between old_index and index""" for rp in self.get_new_rp_list(rp, old_index, index): if ((rp.isreg() and not rp.readable()) or (rp.isdir() and not rp.hasfullperms())): old_perms = rp.getperms() self.open_index_list.insert(0, (index, rp, old_p... | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
self.open_index_list.insert(0, (index, rp, old_perms)) | self.open_index_list.insert(0, (rp.index, rp, old_perms)) | def add_new(self, rp, old_index, index): """Change permissions of directories between old_index and index""" for rp in self.get_new_rp_list(rp, old_index, index): if ((rp.isreg() and not rp.readable()) or (rp.isdir() and not rp.hasfullperms())): old_perms = rp.getperms() self.open_index_list.insert(0, (index, rp, old_p... | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
def get_new_rp_list(self, rp, old_index, index): """Return list of new rp's between old_index and index""" | def get_new_rp_list(self, old_index, index): """Return list of new rp's between old_index and index Do this lazily so that the permissions on the outer directories are fixed before we need the inner dirs. """ | def get_new_rp_list(self, rp, old_index, index): """Return list of new rp's between old_index and index""" for i in range(len(index)-1, -1, -1): if old_index[:i] == index[:i]: common_prefix_len = i break else: assert 0 | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
new_rps = [] for total_len in range(common_prefix_len+1, len(index)): new_rps.append(self.root_rp.new_index(index[:total_len])) new_rps.append(rp) return new_rps | for total_len in range(common_prefix_len+1, len(index)+1): yield self.root_rp.new_index(index[:total_len]) | def get_new_rp_list(self, rp, old_index, index): """Return list of new rp's between old_index and index""" for i in range(len(index)-1, -1, -1): if old_index[:i] == index[:i]: common_prefix_len = i break else: assert 0 | df3aca5b1781434ded9f0e6cebbecef42b5db01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/df3aca5b1781434ded9f0e6cebbecef42b5db01f/restore.py |
extended_filename = ':\\' + chr(175) | extended_filename = ':\\ ' + chr(225) + chr(132) + chr(137) | def set_extended_filenames(self, subdir): """Set self.extended_filenames by trying to write a path""" assert not self.read_only | 4cb9b29fa5ad97bbe3d1585c56de2ce64e82e0e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/4cb9b29fa5ad97bbe3d1585c56de2ce64e82e0e8/fs_abilities.py |
Log.FatalError("--never-drop-acls specified, but ACL support\n" "missing from destination filesystem") | log.Log.FatalError("--never-drop-acls specified, but ACL support\n" "missing from destination filesystem") | def set_acls(self): self.update_triple(self.src_fsa.acls, self.dest_fsa.acls, ('acls_active', 'acls_write', 'acls_conn')) if Globals.never_drop_acls and not Globals.acls_active: Log.FatalError("--never-drop-acls specified, but ACL support\n" "missing from destination filesystem") | 4cb9b29fa5ad97bbe3d1585c56de2ce64e82e0e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/4cb9b29fa5ad97bbe3d1585c56de2ce64e82e0e8/fs_abilities.py |
elif success == 1 or success == 2: | elif success == 1: metadata_rorp = source_rorp else: metadata_rorp = None if success == 1 or success == 2: | def post_process(self, source_rorp, dest_rorp, changed, success, inc): """Post process source_rorp and dest_rorp. | 6f1ce80c6b79c23a235492869c83c7e947bf6722 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/6f1ce80c6b79c23a235492869c83c7e947bf6722/backup.py |
metadata_rorp = source_rorp else: metadata_rorp = None | def post_process(self, source_rorp, dest_rorp, changed, success, inc): """Post process source_rorp and dest_rorp. | 6f1ce80c6b79c23a235492869c83c7e947bf6722 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/6f1ce80c6b79c23a235492869c83c7e947bf6722/backup.py | |
assert 700000 <= s2.SourceFileSize < 750000 | assert 700000 <= s2.SourceFileSize < 750000, s2.SourceFileSize | def testStatistics(self): """Test the writing of statistics | 58b4ddb0a27cab2f2c8c5d958497d73d95705c04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/58b4ddb0a27cab2f2c8c5d958497d73d95705c04/statisticstest.py |
while 1: | for i in range(5): | def run(qDirectory,maxSvrThreads,maxUsrThreads,sleepInterval,execPath): displayParams(qDirectory,maxSvrThreads,maxUsrThreads,sleepInterval,execPath) #Check to see if already running. lastPID = "0" try: f=open(qDirectory+"tfQManager.pid",'r') lastPID = f.readline().strip() f.close() if __debug__: traceMsg("Last QManag... | a3a6d421b065b9a5e8cb1e110e3204b7214d81a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/a3a6d421b065b9a5e8cb1e110e3204b7214d81a7/tfQManager.py |
self.upTotal = statistics['upTotal'] | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 97ec8e5d0cf8d92f443d2b1bdc085dac5cab3984 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/97ec8e5d0cf8d92f443d2b1bdc085dac5cab3984/bittorrent-console.py | |
self.d.display({'activity':_("Starting ..."), | self.d.display({'activity':_("initializing"), | def start_torrent(self,metainfo,save_incomplete_as,save_as): """Tells the MultiTorrent to begin downloading.""" try: self.d.display({'activity':_("Starting ..."), 'fractionDone':0}) multitorrent = self.multitorrent df = multitorrent.create_torrent(metainfo, save_incomplete_as, save_as) df.addErrback( wrap_log('Failed t... | 97ec8e5d0cf8d92f443d2b1bdc085dac5cab3984 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/97ec8e5d0cf8d92f443d2b1bdc085dac5cab3984/bittorrent-console.py |
def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 31020eb8d7e1d45fdaa307a60896051bb78e06da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/31020eb8d7e1d45fdaa307a60896051bb78e06da/bittorrent-console.py | ||
""" FILE = open(self.statFile,"r") self.state = int(FILE.readline(1)) if not self.state: rawserver = RawServer(Preferences().initWithDict(config)) rawserver.stop() """ | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 31020eb8d7e1d45fdaa307a60896051bb78e06da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/31020eb8d7e1d45fdaa307a60896051bb78e06da/bittorrent-console.py | |
FILE = open(self.statFile,"w") FILE.write(repr(self.state)+"\n") FILE.write(self.percentDone+"\n") FILE.write(self.timeEst+"\n") FILE.write(self.downRate+"\n") FILE.write(self.upRate+"\n") FILE.write(self.tfOwner+"\n") FILE.write(self.seeds+"\n") FILE.write(self.peers+"\n") FILE.write(self.shareRating+"\n") FILE.write(... | try: FILE = open(self.statFile,"w") FILE.write(repr(self.state)+"\n") FILE.write(self.percentDone+"\n") FILE.write(self.timeEst+"\n") FILE.write(self.downRate+"\n") FILE.write(self.upRate+"\n") FILE.write(self.tfOwner+"\n") FILE.write(self.seeds+"\n") FILE.write(self.peers+"\n") FILE.write(self.shareRating+"\n") FILE.... | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 31020eb8d7e1d45fdaa307a60896051bb78e06da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/31020eb8d7e1d45fdaa307a60896051bb78e06da/bittorrent-console.py |
def display_error(self, text): """Called by the logger via LogHandler to display error messages in the curses window.""" self.d.error(text) | 31020eb8d7e1d45fdaa307a60896051bb78e06da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/31020eb8d7e1d45fdaa307a60896051bb78e06da/bittorrent-console.py | ||
def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py | ||
seedLimitReached = 0 | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py | |
upTotal = statistics['upTotal'] | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py | |
if upTotal is not None: if upTotal > 0: self.shareRating = _("%.3f") % (upTotal / downTotal) else: self.shareRating = "0" | if upTotal > 0: self.shareRating = _("%.3f") % (upTotal / downTotal) if self.done and self.seedLimit > 0: currentShareRating = (int) (upTotal / downTotal) if currentShareRating >= self.seedLimit: seedLimitReached = 1 app.logger.error("seed-Limit Reached, setting shutdown-flag...") | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py |
if not self.done: self.seedStatus = _("%d") % statistics['numSeeds'] else: self.seedStatus = "" self.peerStatus = _("%d") % statistics['numPeers'] | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py | |
upTotal = 0 | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py | |
self.seedStatus = "0" | seeds = None seeds = statistics.get('numSeeds') if seeds is None: seeds = 0 numCopies = statistics.get('numCopies') if numCopies is not None: seeds += numCopies self.seedStatus = _("%d") % seeds peers = None peers = statistics.get('numPeers') if peers is not None: self.peerStatus = _("%d") % peers else: | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py |
app.percentDone = self.percentDone app.shareRating = self.shareRating app.upTotal = upTotal app.downTotal = downTotal | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py | |
running = 0 try: FILE = open(self.statFile, 'r') running = FILE.read(1) FILE.close() except: running = 0 | if seedLimitReached == 0: running = '0' try: FILE = open(self.statFile, 'r') running = FILE.read(1) FILE.close() except: running = '0' else: running = '0' | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | f61984e994b779f023d0b71bbeccf485c95c9a29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/f61984e994b779f023d0b71bbeccf485c95c9a29/tfmainline.py |
FILE.write(self.d.percentDone+"\n") | pcts = "-"+self.d.percentDone pctf = float(pcts) pctf -= 100 FILE.write(str(pctf)) FILE.write("\n") | def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | 3b524aa65a54875c7288d81627a6158567cb1b43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/3b524aa65a54875c7288d81627a6158567cb1b43/bittorrent-console.py |
s = str(n) size = s[-3:] while len(s) > 3: s = s[:-3] size = '%s,%s' % (s[-3:], size) size = '%s (%s)' % (size, str(Size(n))) return size | return int(n) | def fmtsize(n): s = str(n) size = s[-3:] while len(s) > 3: s = s[:-3] size = '%s,%s' % (s[-3:], size) size = '%s (%s)' % (size, str(Size(n))) return size | cc1aa8380546ae779c06e948895b8ef69a8372cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/cc1aa8380546ae779c06e948895b8ef69a8372cf/bittorrent-console.py |
self.fileSize = '' | self.fileSize = 0 | def __init__(self): self.done = '0' self.state = 1 self.percentDone = '' self.timeEst = 'Starting ...' self.downRate = '0.0 KB/s' self.upRate = '0.0 KB/s' self.tfOwner = config['tf_owner'] self.shareRating = '' self.seeds = "0" self.peers = "0" self.errors = [] self.file = '' self.downloadTo = '' self.fileSize = '' sel... | cc1aa8380546ae779c06e948895b8ef69a8372cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/cc1aa8380546ae779c06e948895b8ef69a8372cf/bittorrent-console.py |
FILE.write(repr(self.fileSize)) | FILE.write(repr(self.fileSize)[:-1]) | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | cc1aa8380546ae779c06e948895b8ef69a8372cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/cc1aa8380546ae779c06e948895b8ef69a8372cf/bittorrent-console.py |
""" if n == 0: return _("download complete!") return _("finishing in %s") % (str(Duration(n))) """ | def fmttime(n): """ if n == 0: return _("download complete!") return _("finishing in %s") % (str(Duration(n))) """ if n == 0: return 'complete!' try: n = int(n) assert n >= 0 and n < 5184000 # 60 days except: return '<unknown>' m, s = divmod(n, 60) h, m = divmod(m, 60) d, h = divmod(h, 24) if d > 0: return '%dd %02d:%... | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py | |
""" s = str(n) size = s[-3:] while len(s) > 3: s = s[:-3] size = '%s,%s' % (s[-3:], size) size = '%s (%s)' % (size, str(Size(n))) return size """ | def fmtsize(n): """ s = str(n) size = s[-3:] while len(s) > 3: s = s[:-3] size = '%s,%s' % (s[-3:], size) size = '%s (%s)' % (size, str(Size(n))) return size """ return int(n) | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py | |
self.timeEst = '' self.downRate = '---' self.upRate = '---' | self.timeEst = 'Starting ...' self.downRate = '0.0 kB/s' self.upRate = '0.0 kB/s' self.tfOwner = config['tf_owner'] | def __init__(self): self.done = False self.percentDone = '' self.timeEst = '' self.downRate = '---' self.upRate = '---' self.shareRating = '' self.seedStatus = '' self.peerStatus = '' self.errors = [] self.file = '' self.downloadTo = '' self.fileSize = '' self.numpieces = 0 | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py |
self.downRate = '---' | self.downRate = '0.0 kB/s' | def finished(self): self.done = True self.downRate = '---' self.display({'activity':_("download succeeded"), 'fractionDone':1}) | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py |
print '\n\n\n\n' | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py | |
self.downRate = '%.1f KB/s' % (downRate / (1 << 10)) | self.downRate = '%.1f kB/s' % (downRate / (1 << 10)) | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py |
self.upRate = '%.1f KB/s' % (upRate / (1 << 10)) | self.upRate = '%.1f kB/s' % (upRate / (1 << 10)) upTotal = None downTotal = None | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py |
self.seedStatus = _("%d seen now") % statistics['numSeeds'] | self.seedStatus = _("%d") % statistics['numSeeds'] | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py |
self.peerStatus = _("%d seen now") % statistics['numPeers'] if not self.errors: print _("Log: none") | self.peerStatus = _("%d") % statistics['numPeers'] | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py |
print _("Log:") for err in self.errors[-4:]: print err print print _("saving: "), self.file print _("file size: "), self.fileSize print _("percent done: "), self.percentDone print _("time left: "), self.timeEst print _("download to: "), self.downloadTo print _("download rate: "), self.downRate print _... | upTotal = 0 downTotal = 0 self.shareRating = "oo" self.seedStatus = "0" self.peerStatus = "0" app.percentDone = self.percentDone app.shareRating = self.shareRating app.upTotal = upTotal app.downTotal = downTotal running = 0 try: FILE = open(self.statFile, 'r') running = FILE.read(1) FILE.close() e... | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | 20742370d1a08cc5f982b88b4e2dc8a71de7ebf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/20742370d1a08cc5f982b88b4e2dc8a71de7ebf0/tfmainline.py |
print err print | print err print | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py |
def __init__(self, app, level=logging.NOTSET): logging.Handler.__init__(self,level) self.app = app | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py | ||
self.app.display_error(record.getMessage() ) | self.app.display_error(record.getMessage() ) | def emit(self, record): self.app.display_error(record.getMessage() ) if record.exc_info is not None: self.app.display_error( " %s: %s" % ( str(record.exc_info[0]), str(record.exc_info[1]))) tb = record.exc_info[2] stack = traceback.extract_tb(tb) l = traceback.format_list(stack) for s in l: self.app.display_error( " %s... | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py |
self.app.display_error( " %s: %s" % | self.app.display_error( " %s: %s" % | def emit(self, record): self.app.display_error(record.getMessage() ) if record.exc_info is not None: self.app.display_error( " %s: %s" % ( str(record.exc_info[0]), str(record.exc_info[1]))) tb = record.exc_info[2] stack = traceback.extract_tb(tb) l = traceback.format_list(stack) for s in l: self.app.display_error( " %s... | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py |
self.d.display({'activity':_("initializing"), | self.d.display({'activity':_("initializing"), | def start_torrent(self,metainfo,save_incomplete_as,save_as): """Tells the MultiTorrent to begin downloading.""" try: self.d.display({'activity':_("initializing"), 'fractionDone':0}) multitorrent = self.multitorrent df = multitorrent.create_torrent(metainfo, save_incomplete_as, save_as) df.addErrback( wrap_log('Failed t... | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py |
def create_finished(torrent): self.torrent = torrent if self.torrent.is_initialized(): multitorrent.start_torrent(self.torrent.infohash) else: # HEREDAVE: why should this set the doneflag? self.core_doneflag.set() # e.g., if already downloading... | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py | ||
self.d.display({'activity':_("shutting down"), | self.d.display({'activity':_("shutting down"), | def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py |
def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py | ||
def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py | ||
try: | try: | def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py |
def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py | ||
def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py | ||
def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/bb66e6262bf5c6cd28f3194605f7d37fdbdaf5a0/tfmainline.py | ||
pcts = "-"+self.d.percentDone | pcts = "-"+self.percentDone | def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | 45bcad9dc48ec18226c0748c74cc6deaa55fe98b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/45bcad9dc48ec18226c0748c74cc6deaa55fe98b/bittorrent-console.py |
FILE.write(self.d.shareRating+"\n") | FILE.write(self.shareRating+"\n") | def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | 45bcad9dc48ec18226c0748c74cc6deaa55fe98b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/45bcad9dc48ec18226c0748c74cc6deaa55fe98b/bittorrent-console.py |
FILE.write(repr(self.d.upTotal)+"\n") FILE.write(repr(self.d.downTotal)+"\n") | FILE.write(repr(self.upTotal)+"\n") FILE.write(repr(self.downTotal)+"\n") | def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | 45bcad9dc48ec18226c0748c74cc6deaa55fe98b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/45bcad9dc48ec18226c0748c74cc6deaa55fe98b/bittorrent-console.py |
""" return int(n) | def fmtsize(n): s = str(n) size = s[-3:] while len(s) > 3: s = s[:-3] size = '%s,%s' % (s[-3:], size) size = '%s (%s)' % (size, str(Size(n))) return size | a5236d489eb08df50ddb4d98dee5ecf5a8d386c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/a5236d489eb08df50ddb4d98dee5ecf5a8d386c7/tfmainline.py | |
self.downRate = '---' | self.downRate = '0.0 kB/s' | def finished(self): self.done = True # self.downRate = '---' # self.downRate = '0.0 kB/s' self.downRate = '---' self.display({'activity':_("download succeeded"), 'fractionDone':1}) | d1027de0349cd5f61de7af246ba122587ab84846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/d1027de0349cd5f61de7af246ba122587ab84846/tfmainline.py |
if not self.errors: print _("Log: none") else: print _("Log:") for err in self.errors[-4:]: print err print print _("saving: "), self.file print _("file size: "), self.fileSize print _("percent done: "), self.percentDone print _("time left: "), self.timeEst print _("download to: "), self.downloadTo pr... | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | d1027de0349cd5f61de7af246ba122587ab84846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/d1027de0349cd5f61de7af246ba122587ab84846/tfmainline.py | |
FILE.write(repr(self.fileSize)) | FILE.write(repr(self.fileSize_stat)) | def display(self, statistics): fractionDone = statistics.get('fractionDone') activity = statistics.get('activity') timeEst = statistics.get('timeEst') downRate = statistics.get('downRate') upRate = statistics.get('upRate') spew = statistics.get('spew') | d1027de0349cd5f61de7af246ba122587ab84846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/d1027de0349cd5f61de7af246ba122587ab84846/tfmainline.py |
FILE.write(repr(self.d.fileSize)) | FILE.write(repr(self.d.fileSize_stat)) | def shutdown(): print "shutdown." self.d.display({'activity':_("shutting down"), 'fractionDone':0}) if self.multitorrent: df = self.multitorrent.shutdown() stop_rawserver = lambda *a : rawserver.stop() df.addCallbacks(stop_rawserver, stop_rawserver) else: rawserver.stop() | d1027de0349cd5f61de7af246ba122587ab84846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2550/d1027de0349cd5f61de7af246ba122587ab84846/tfmainline.py |
for x in arange(100)/5. - 10.: | for x in Numeric.arange(100)/5. - 10.: | def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x... | fbf65ea98a5b51bf2ced400d716dc83287925603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/fbf65ea98a5b51bf2ced400d716dc83287925603/test.py |
x = arange(100)/5. - 10. | x = Numeric.arange(100)/5. - 10. | def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x... | fbf65ea98a5b51bf2ced400d716dc83287925603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/fbf65ea98a5b51bf2ced400d716dc83287925603/test.py |
x = arange(35)/2.0 y = arange(30)/10.0 - 1.5 | x = Numeric.arange(35)/2.0 y = Numeric.arange(30)/10.0 - 1.5 | def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x... | fbf65ea98a5b51bf2ced400d716dc83287925603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/fbf65ea98a5b51bf2ced400d716dc83287925603/test.py |
m = (sin(xm) + 0.1*xm) - ym**2 | m = (Numeric.sin(xm) + 0.1*xm) - ym**2 | def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x... | fbf65ea98a5b51bf2ced400d716dc83287925603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/fbf65ea98a5b51bf2ced400d716dc83287925603/test.py |
g.splot(gp.GridFunc(lambda x,y: sin(x) + 0.1*x - y**2, x,y)) | g.splot(gp.GridFunc(lambda x,y: math.sin(x) + 0.1*x - y**2, x,y)) | def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x... | fbf65ea98a5b51bf2ced400d716dc83287925603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/fbf65ea98a5b51bf2ced400d716dc83287925603/test.py |
g.splot(gp.GridFunc(lambda x,y: sin(x) + 0.1*x - y**2, x,y, | g.splot(gp.GridFunc(lambda x,y: Numeric.sin(x) + 0.1*x - y**2, x,y, | def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = gp.Gnuplot() g.clear() # Make a temporary file: file1 = gp.TempFile() # will be deleted upon exit f = open(file1.filename, 'w') for x in arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x... | fbf65ea98a5b51bf2ced400d716dc83287925603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/fbf65ea98a5b51bf2ced400d716dc83287925603/test.py |
g = Gnuplot.Gnuplot() | g = Gnuplot.Gnuplot(debug=1) | def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = Gnuplot.Gnuplot() g.clear() # Make a temporary file: filename1 = tempfile.mktemp() f = open(filename1, 'w') for x in Numeric.arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x))) f.close(... | f0f9232a09847042aade02dd2a557bbe20a3b10d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/f0f9232a09847042aade02dd2a557bbe20a3b10d/test.py |
class file(plotitem): """a plotitem representing a file that contains gnuplot data.""" _option_list = plotitem._option_list.copy() | class File(PlotItem): """A PlotItem representing a file that contains gnuplot data.""" _option_list = PlotItem._option_list.copy() | def __del__(self): """Delete the referenced file.""" | 542c174c984675a440bf0633f01fb4b6df43da2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/542c174c984675a440bf0633f01fb4b6df43da2b/PlotItems.py |
'smooth', smooth, none, 'smooth %s'), | 'smooth', smooth, None, 'smooth %s'), | def __del__(self): """Delete the referenced file.""" | 542c174c984675a440bf0633f01fb4b6df43da2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/542c174c984675a440bf0633f01fb4b6df43da2b/PlotItems.py |
"""construct a file object. | """Construct a File object. | def __init__(self, file, **keyw): """construct a file object. | 542c174c984675a440bf0633f01fb4b6df43da2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/542c174c984675a440bf0633f01fb4b6df43da2b/PlotItems.py |
class OptionException(Exception): pass | class OptionException(Exception): pass class DataException(Exception): pass | def test_persist(): global _recognizes_persist if _recognizes_persist is None: g = os.popen('echo | gnuplot -persist 2>&1', 'r') response = g.readlines() g.close() _recognizes_persist = ((not response) or (string.find(response[0], '-persist') == -1)) return _recognizes_persist | 9eafec99a80900ab19e4d7d48efe76f5cca1671f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/9eafec99a80900ab19e4d7d48efe76f5cca1671f/__init__.py |
if item.shape[1] == 1: newitems.append(Data(item, with='lines')) | dim = len(item.shape) if dim == 1: newitems.append(Data(item[:, Numeric.NewAxis], with='lines')) elif dim == 2: if item.shape[1] == 1: newitems.append(Data(item, with='lines')) else: tempf = TempArrayFile(item) for col in range(1, item.shape[1]): newitems.append(File(tempf, using=(1,col+1), with='lines')) | def plot(*items, **kw): """plot data using gnuplot. This command is roughly compatible with old Gnuplot plot command. It is provided for backwards compatibility only. It is recommended that you use the new object-oriented Gnuplot interface, which is much more flexible. It can only plot Numeric array data. In this r... | 9eafec99a80900ab19e4d7d48efe76f5cca1671f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/9eafec99a80900ab19e4d7d48efe76f5cca1671f/__init__.py |
tempf = TempArrayFile(item) for col in range(1, item.shape[1]): newitems.append(File(tempf, using=(1,col+1), with='lines')) | raise DataException("Data array must be 1 or 2 dimensional") | def plot(*items, **kw): """plot data using gnuplot. This command is roughly compatible with old Gnuplot plot command. It is provided for backwards compatibility only. It is recommended that you use the new object-oriented Gnuplot interface, which is much more flexible. It can only plot Numeric array data. In this r... | 9eafec99a80900ab19e4d7d48efe76f5cca1671f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/9eafec99a80900ab19e4d7d48efe76f5cca1671f/__init__.py |
print "\n Generating postscript file 'junk.ps'\n" g2.hardcopy('junk.ps', color=1) | print "\n Generating postscript file 'gnuplot_test1.ps'\n" g2.hardcopy('gnuplot_test1.ps', color=1) | def plot(*items, **kw): """plot data using gnuplot. This command is roughly compatible with old Gnuplot plot command. It is provided for backwards compatibility only. It is recommended that you use the new object-oriented Gnuplot interface, which is much more flexible. It can only plot Numeric array data. In this r... | 9eafec99a80900ab19e4d7d48efe76f5cca1671f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/9eafec99a80900ab19e4d7d48efe76f5cca1671f/__init__.py |
print setterm | def hardcopy(self, filename=None, terminal='postscript', **keyw): """Create a hardcopy of the current plot. | 44c62a49654a1665726a9cd839879dd730b34509 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/44c62a49654a1665726a9cd839879dd730b34509/_Gnuplot.py | |
def set_option(self, with=_unset, title=_unset, **keyw): | def set_option(self, with=_unset, smooth=_unset, title=_unset, **keyw): | def set_option(self, with=_unset, title=_unset, **keyw): """Set or change a plot option for this PlotItem. | 0b1a5c995d2bb3012a8f2c6ccf5a844b1647c2d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/0b1a5c995d2bb3012a8f2c6ccf5a844b1647c2d3/__init__.py |
_option_sequence = ['binary', 'using', 'title', 'with'] | _option_sequence = ['binary', 'using', 'smooth', 'title', 'with'] | def clear_option(self, name): """Clear (unset) a plot option. No error if option was not set.""" | 0b1a5c995d2bb3012a8f2c6ccf5a844b1647c2d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/0b1a5c995d2bb3012a8f2c6ccf5a844b1647c2d3/__init__.py |
def set_option(self, with=_unset, title=_unset, **keyw): | def set_option(self, with=_unset, smooth=_unset, title=_unset, **keyw): | def set_option(self, with=_unset, title=_unset, **keyw): """Set or change a plot option for this PlotItem. | 6ffda581a22217a234b56f0873e599437984b788 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/6ffda581a22217a234b56f0873e599437984b788/__init__.py |
_option_sequence = ['binary', 'using', 'title', 'with'] | _option_sequence = ['binary', 'using', 'smooth', 'title', 'with'] | def clear_option(self, name): """Clear (unset) a plot option. No error if option was not set.""" | 6ffda581a22217a234b56f0873e599437984b788 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/6ffda581a22217a234b56f0873e599437984b788/__init__.py |
write_array(f, set[0], item_sep, nest_prefix, nest_suffix, nest_sep) | write_array(f, set[0], item_sep, nest_prefix, nest_suffix, nest_sep) | def write_array(f, set, item_sep=' ', nest_prefix='', nest_suffix='\n', nest_sep=''): """Write an array of arbitrary dimension to a file. A general recursive array writer. The last four parameters allow a great deal of freedom in choosing the output format of the array. The defaults for those parameters give output ... | 4cbf7c8f12d365d5ef41c4354c4610e9a0c64960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/4cbf7c8f12d365d5ef41c4354c4610e9a0c64960/__init__.py |
write_array(f, subset, item_sep, nest_prefix, nest_suffix, nest_sep) | write_array(f, subset, item_sep, nest_prefix, nest_suffix, nest_sep) | def write_array(f, set, item_sep=' ', nest_prefix='', nest_suffix='\n', nest_sep=''): """Write an array of arbitrary dimension to a file. A general recursive array writer. The last four parameters allow a great deal of freedom in choosing the output format of the array. The defaults for those parameters give output ... | 4cbf7c8f12d365d5ef41c4354c4610e9a0c64960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/4cbf7c8f12d365d5ef41c4354c4610e9a0c64960/__init__.py |
set = Numeric.asarray(set, Numeric.Float) | set = Numeric.asarray(set[0], Numeric.Float) | def __init__(self, *set, **keyw): """Construct a Data object from a numeric array. | 4cbf7c8f12d365d5ef41c4354c4610e9a0c64960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/4cbf7c8f12d365d5ef41c4354c4610e9a0c64960/__init__.py |
def float_array(m): """Return the argument as a Numeric array of type at least 'Float32'. Leave 'Float64' unchanged, but upcast all other types to 'Float32'. Allow also for the possibility that the argument is a python native type that can be converted to a Numeric array using 'Numeric.asarray()', but in that case do... | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py | ||
def grid_function(f, xvals, yvals, typecode=Numeric.Float32): | def grid_function(f, xvals, yvals, typecode=None, ufunc=0): | def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i... | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py |
Note that 'f' is evaluated at each pair of points using a Python loop, which can be slow if the number of points is large. If speed is an issue, you should if possible compute functions matrix-wise using Numeric's built-in ufuncs. | If 'ufunc=0', then 'f' is evaluated at each pair of points using a Python loop. This can be slow if the number of points is large. If speed is an issue, you should write 'f' in terms of Numeric ufuncs and use the 'ufunc=1' feature described next. If called with 'ufunc=1', then 'f' should be a function that is compose... | def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i... | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py |
m = Numeric.zeros((len(xvals), len(yvals)), typecode) for xi in range(len(xvals)): x = xvals[xi] for yi in range(len(yvals)): y = yvals[yi] m[xi,yi] = f(x,y) return m | xvals = Numeric.asarray(xvals, typecode) yvals = Numeric.asarray(yvals, typecode) if ufunc: return f(xvals[:,Numeric.NewAxis], yvals[Numeric.NewAxis,:]) else: m = Numeric.zeros((len(xvals), len(yvals)), xvals.typecode()) for xi in range(len(xvals)): x = xvals[xi] for yi in range(len(yvals)): y = yvals[yi] m[xi,yi] = ... | def grid_function(f, xvals, yvals, typecode=Numeric.Float32): """Evaluate and tabulate a function on a grid. 'xvals' and 'yvals' should be 1-D arrays listing the values of x and y at which 'f' should be tabulated. 'f' should be a function taking two floating point arguments. The return value is a matrix M where 'M[i... | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py |
If 'binary=1' is passed to the constructor, the data will be passed to gnuplot in binary format and the 'binary' option added to the splot command line. Binary format is faster and usually saves disk space but is not human-readable. If your version of gnuplot doesn't support binary format (it is a recently-added feat... | def pipein(self, f): if self._data: f.write(self._data) | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py | |
def __init__(self, toplot, xvals=None, yvals=None, | def __init__(self, data, xvals=None, yvals=None, | def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor. | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py |
'toplot' -- the thing to plot: a 2-d array with dimensions (numx,numy), OR a callable object for which toplot(x,y) returns a number. | 'data' -- the data to plot: a 2-d array with dimensions (numx,numy). | def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor. | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py |
'toplot' can be a data array, in which case it should hold the values of a function f(x,y) tabulated on a grid of points, such that 'toplot[i,j] == f(xvals[i], yvals[j])'. If 'xvals' and/or 'yvals' are omitted, integers (starting with 0) are used for that coordinate. The data are written to a temporary file; no copy ... | 'data' must be a data array holding the values of a function f(x,y) tabulated on a grid of points, such that 'data[i,j] == f(xvals[i], yvals[j])'. If 'xvals' and/or 'yvals' are omitted, integers (starting with 0) are used for that coordinate. The data are written to a temporary file; no copy of the data is kept in me... | def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor. | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py |
f(x,y)' triplets that can be used by gnuplot's 'splot' command. If 'binary=1' then the data are written to a file in a binary format that 'splot' can understand. | f(x,y)' triplets (y changes most rapidly) that can be used by gnuplot's 'splot' command. Blank lines are included each time the value of x changes so that gnuplot knows to plot a surface through the data. If 'binary=1' then the data are written to a file in a binary format that 'splot' can understand. Binary format ... | def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor. | a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/a28e91f7dbfb7e62d59f6ace13b33f3dd9d798d4/__init__.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.