bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
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...
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): d[inc.getinctime()] = None...
32,500
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
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) if out_id is not None: self.name2id_dict[name] = out_id return out_id
32,501
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(...
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(...
32,502
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...
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 dst_in_effect: offset = -time.altzone/60 else: offset = -time.timezone/60 if offset > 0: prefix = "+" elif offset < 0: prefix = "-" else: retur...
32,503
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 ...
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(index) return rf elif rf.index > index: # Try to add earlier indicies. But if first i...
32,504
def add_rfs(self, index): """Given index, add the rfs in that same directory
def add_rfs(self, index): """Given index, add the rfs in that same directory
32,505
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)
def __call__(self, index): """Given rpath, change permissions up to and including index""" old_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)
32,506
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)
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)
32,507
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...
def add_new(self, 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_perms...
32,508
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...
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(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_perms...
32,509
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...
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, (rp.index, rp, ol...
32,510
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
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. """ for i in range(len(index)-1, -1, -1): if old_index[:i] == index[:i]: common_prefix_len = i break else: assert...
32,511
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
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
32,512
def set_extended_filenames(self, subdir): """Set self.extended_filenames by trying to write a path""" assert not self.read_only
def set_extended_filenames(self, subdir): """Set self.extended_filenames by trying to write a path""" assert not self.read_only
32,513
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")
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")
32,514
def post_process(self, source_rorp, dest_rorp, changed, success, inc): """Post process source_rorp and dest_rorp.
def post_process(self, source_rorp, dest_rorp, changed, success, inc): """Post process source_rorp and dest_rorp.
32,515
def post_process(self, source_rorp, dest_rorp, changed, success, inc): """Post process source_rorp and dest_rorp.
def post_process(self, source_rorp, dest_rorp, changed, success, inc): """Post process source_rorp and dest_rorp.
32,516
def testStatistics(self): """Test the writing of statistics
def testStatistics(self): """Test the writing of statistics
32,517
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...
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...
32,518
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')
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')
32,519
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...
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...
32,520
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')
defdisplay(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')
32,521
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')
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')
32,522
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')
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')
32,523
def display_error(self, text): """Called by the logger via LogHandler to display error messages in the curses window.""" self.d.error(text)
defdisplay_error(self,text):"""CalledbytheloggerviaLogHandlertodisplayerrormessagesinthecurseswindow."""self.d.error(text)
32,524
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')
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')
32,525
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')
def seedLimitReached = 0 display(self, seedLimitReached = 0 statistics): seedLimitReached = 0 fractionDone seedLimitReached = 0 = seedLimitReached = 0 statistics.get('fractionDone') seedLimitReached = 0 activity seedLimitReached = 0 = seedLimitReached = 0 statistics.get('activity') seedLimitReached = 0 timeEst...
32,526
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')
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')
32,527
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')
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')
32,528
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')
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')
32,529
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')
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')
32,530
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')
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')
32,531
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')
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')
32,532
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')
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')
32,533
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()
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()
32,534
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
def fmtsize(n): return int(n)
32,535
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...
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 = 0 self...
32,536
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')
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')
32,537
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:%...
def fmttime(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:%02d:%02d' % (d, h, m, s) else: return '%02d:%02d:%02d' % (h, m, s)
32,538
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)
def fmtsize(n): return int(n)
32,539
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
def __init__(self): self.done = False 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.seedStatus = '' self.peerStatus = '' self.errors = [] self.file = '' self.downloadTo = '' self.fileSize = '' self.num...
32,540
def finished(self): self.done = True self.downRate = '---' self.display({'activity':_("download succeeded"), 'fractionDone':1})
def finished(self): self.done = True self.downRate = '0.0 kB/s' self.display({'activity':_("download succeeded"), 'fractionDone':1})
32,541
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')
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')
32,542
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')
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')
32,543
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')
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')
32,544
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')
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')
32,545
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')
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')
32,546
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')
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')
32,547
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')
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')
32,548
def __init__(self, app, level=logging.NOTSET): logging.Handler.__init__(self,level) self.app = app
def __init__(self, app, level=logging.NOTSET): logging.Handler.__init__(self,level) self.app = app
32,549
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...
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...
32,550
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...
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...
32,551
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...
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...
32,552
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...
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...
32,553
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()
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()
32,554
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()
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()
32,555
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()
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()
32,556
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()
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()
32,557
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()
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()
32,558
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()
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()
32,559
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()
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()
32,560
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()
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()
32,561
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()
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()
32,562
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()
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()
32,563
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
def""" return int(n) fmtsize(n):""" return int(n) s""" return int(n) =""" return int(n) str(n)""" return int(n) size""" return int(n) =""" return int(n) s[-3:]""" return int(n) while""" return int(n) len(s)""" return int(n) >""" return int(n) 3:""" return int(n) s""" return int(n) =""" return int(n) s[:-3]""" return in...
32,564
def finished(self): self.done = True # self.downRate = '---' # self.downRate = '0.0 kB/s' self.downRate = '---' self.display({'activity':_("download succeeded"), 'fractionDone':1})
def finished(self): self.done = True #self.downRate = '0.0 kB/s' # self.downRate = '0.0 kB/s'self.downRate = '0.0 kB/s' self.display({'activity':_("download succeeded"), 'fractionDone':1})
32,565
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')
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')
32,566
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')
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')
32,567
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()
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()
32,568
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...
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 Numeric.arange(100)/5. - 10.: f.write('%s %s %s\n' % (x, math.cos(x), ma...
32,569
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...
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...
32,570
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...
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...
32,571
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...
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...
32,572
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...
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...
32,573
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...
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...
32,574
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(...
def main(): """Exercise the Gnuplot module.""" wait('Popping up a blank gnuplot window on your screen.') g = Gnuplot.Gnuplot(debug=1) 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...
32,575
def __del__(self): """Delete the referenced file."""
def __del__(self): """Delete the referenced file."""
32,576
def __del__(self): """Delete the referenced file."""
def __del__(self): """Delete the referenced file."""
32,577
def __init__(self, file, **keyw): """construct a file object.
def __init__(self, file, **keyw): """construct a file object.
32,578
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
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
32,579
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...
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...
32,580
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...
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...
32,581
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...
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...
32,582
def hardcopy(self, filename=None, terminal='postscript', **keyw): """Create a hardcopy of the current plot.
def hardcopy(self, filename=None, terminal='postscript', **keyw): """Create a hardcopy of the current plot.
32,583
def set_option(self, with=_unset, title=_unset, **keyw): """Set or change a plot option for this PlotItem.
def set_option(self, with=_unset, smooth=_unset, title=_unset, **keyw): """Set or change a plot option for this PlotItem.
32,584
def clear_option(self, name): """Clear (unset) a plot option. No error if option was not set."""
def clear_option(self, name): """Clear (unset) a plot option. No error if option was not set."""
32,585
def set_option(self, with=_unset, title=_unset, **keyw): """Set or change a plot option for this PlotItem.
def set_option(self, with=_unset, smooth=_unset, title=_unset, **keyw): """Set or change a plot option for this PlotItem.
32,586
def clear_option(self, name): """Clear (unset) a plot option. No error if option was not set."""
def clear_option(self, name): """Clear (unset) a plot option. No error if option was not set."""
32,587
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 ...
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 ...
32,588
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 ...
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 ...
32,589
def __init__(self, *set, **keyw): """Construct a Data object from a numeric array.
def __init__(self, *set, **keyw): """Construct a Data object from a numeric array.
32,590
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...
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 ...
32,591
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...
def grid_function(f, xvals, yvals, typecode=None, ufunc=0): """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,j...
32,592
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...
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...
32,593
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...
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...
32,594
def pipein(self, f): if self._data: f.write(self._data)
def pipein(self, f): if self._data: f.write(self._data)
32,595
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
def __init__(self, data, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
32,596
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
32,597
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
32,598
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
def __init__(self, toplot, xvals=None, yvals=None, binary=1, inline=_unset, **keyw): """GridData constructor.
32,599