rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
del c.upload del c.download
def connection_lost(self, connection): c = self.connections[connection] d = c.download del c.upload del c.download del self.connections[connection] d.disconnected() self.choker.connection_lost(c)
f559f2c6582a70f5f61b81537366971d70ea5893 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/f559f2c6582a70f5f61b81537366971d70ea5893/Connecter.py
if n == 0 and newf != f+1:
if x[f:newf] != str(n):
def decode_int(x, f): newf = x.index('e', f) n = long(x[f:newf]) if x[f] == '0' and n != 0: raise ValueError if n == 0 and newf != f+1: raise ValueError return (n, newf+1)
4e501a5f1535e170ba0c1d363aa88112a0fb67c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/4e501a5f1535e170ba0c1d363aa88112a0fb67c2/bencode.py
if x[f] == '0' and n != 0: raise ValueError if n == 0 and colon != f + 1: raise ValueError colon = colon + 1
if n < 0: raise ValueError if x[f:colon] != str(n): raise ValueError colon += 1
def decode_string(x, f): colon = x.index(':', f) n = long(x[f:colon]) if x[f] == '0' and n != 0: raise ValueError if n == 0 and colon != f + 1: raise ValueError colon = colon + 1 return (x[colon:colon+n], colon+n)
4e501a5f1535e170ba0c1d363aa88112a0fb67c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/4e501a5f1535e170ba0c1d363aa88112a0fb67c2/bencode.py
record['nat'] = 0
def connectback_result(self, result, downloadid, peerid, ip, port): record = self.downloads.get(downloadid, {}).get(peerid) if record is None or record['ip'] != ip or record['port'] != port: return if not record.has_key('nat'): record['nat'] = int(not result) if result: record['nat'] = 0 self.becache1.setdefault(downlo...
648808943e7e2648e1b386c8a3eac45606fd5987 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/648808943e7e2648e1b386c8a3eac45606fd5987/track.py
self.connecter.connection_flushed(self.connections[connection])
c = self.connections[connection] if c.complete: self.connecter.connection_flushed(c)
def connection_flushed(self, connection): self.connecter.connection_flushed(self.connections[connection])
641bafa3b09382b0222e9a0920bfd6f8985c3026 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/641bafa3b09382b0222e9a0920bfd6f8985c3026/Encrypter.py
def choose(self, default, size, saveas, dir, file = file):
def choose(self, default, size, saveas, dir):
def choose(self, default, size, saveas, dir, file = file): return self.file[:-len(ext)]
4e1074ccf2376fb117ffce7c5ab7a862c65d4323 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/4e1074ccf2376fb117ffce7c5ab7a862c65d4323/btlaunchmany.py
activity = None, save = save()):
activity = None):
def status(self, fractionDone = None, timeEst = None, downRate = None, upRate = None, activity = None, save = save()): if fractionDone is not None: newpercent = int(fractionDone*100) if newpercent != self.percentDone: self.percentDone = newpercent print self.file + (': %d%%' % newpercent) if activity is not None: print...
4e1074ccf2376fb117ffce7c5ab7a862c65d4323 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/4e1074ccf2376fb117ffce7c5ab7a862c65d4323/btlaunchmany.py
else: self.downloader.picker.bump(index)
for d in self.downloader.downloads: d.fix_download_endgame() return false self.downloader.picker.bump(index)
def got_piece(self, index, begin, piece): try: self.active_requests.remove((index, begin, len(piece))) except ValueError: return false if self.downloader.storage.is_endgame(): self.downloader.all_requests.remove((index, begin, len(piece))) for d in self.downloader.downloads: try: if d is not self: d.active_requests.rem...
fc189ce06d4a1f928dda5c83595a27d08fcd9fb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/fc189ce06d4a1f928dda5c83595a27d08fcd9fb0/Downloader.py
for i in range(l, length, interval)[1:] + [length-1]:
for i in lrange(l, length, interval)[1:] + [length-1]:
def __init__(self, files, open, exists, getsize, statusfunc, alloc_pause = 3): # can raise IOError and ValueError self.ranges = [] total = 0l so_far = 0l for file, length in files: if length != 0: self.ranges.append((total, total + length, file)) total += length if exists(file): l = getsize(file) if l > length: raise V...
b3cbe6b410c7f468c8a83f023a20862ebc8607fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/b3cbe6b410c7f468c8a83f023a20862ebc8607fa/Storage.py
make_meta_file(i, url, flag = flag, progress = callback)
try: make_meta_file(i, url, flag = flag, progress = callback) except ValueError: print_exc()
def callback(x, subtotal = subtotal, total = total, vc = vc): subtotal[0] += x vc(float(subtotal[0]) / total)
35a9a0760f65f60c51992087d86cfb1dc25a5d79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/35a9a0760f65f60c51992087d86cfb1dc25a5d79/btcompletedir.py
if self.id is None:
if not self.id:
def read_peer_id(self, s): if self.id is None: for v in self.encoder.connections.values(): if v.id == s: return None self.id = s if self.locally_initiated: connection.write(self.encoder.my_id) else: self.encoder.everinc = True else: if s != self.id: return None self.complete = True self.encoder.connecter.connection_mad...
0aeb87d851e1bcfa978fdd52c50d9d7bf66bc2e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0aeb87d851e1bcfa978fdd52c50d9d7bf66bc2e9/Encrypter.py
connection.write(self.encoder.my_id)
self.connection.write(self.encoder.my_id)
def read_peer_id(self, s): if self.id is None: for v in self.encoder.connections.values(): if v.id == s: return None self.id = s if self.locally_initiated: connection.write(self.encoder.my_id) else: self.encoder.everinc = True else: if s != self.id: return None self.complete = True self.encoder.connecter.connection_mad...
0aeb87d851e1bcfa978fdd52c50d9d7bf66bc2e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0aeb87d851e1bcfa978fdd52c50d9d7bf66bc2e9/Encrypter.py
if id and id == self.my_id: return for v in self.connections.values(): if v.id == id:
if id: if id == self.my_id:
def start_connection(self, dns, id): if len(self.connections) >= self.max_initiate: return if id and id == self.my_id: return for v in self.connections.values(): if v.id == id: return try: c = self.raw_server.start_connection(dns) self.connections[c] = Connection(self, c, id) except socketerror: pass
0aeb87d851e1bcfa978fdd52c50d9d7bf66bc2e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0aeb87d851e1bcfa978fdd52c50d9d7bf66bc2e9/Encrypter.py
myid = sha(repr(time()) + ' ' + str(getpid())).digest()
myid = (chr(0) * 12) + sha(repr(time()) + ' ' + str(getpid())).digest()[-8:]
def make(f, forcedir = false): if not forcedir: f = path.split(f)[0] if f != '' and not path.exists(f): makedirs(f)
ffa67a072b170f7478ee0bf3381d2e718e5842ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/ffa67a072b170f7478ee0bf3381d2e718e5842ca/download.py
infohash = (chr(0) * 12) + sha(bencode(info)).digest()[-8:]
infohash = sha(bencode(info)).digest()
def make_upload(connection, choker = choker, storagewrapper = storagewrapper, max_slice_length = config['max_slice_length'], max_rate_period = config['max_rate_period'], fudge = config['upload_rate_fudge']): return Upload(connection, choker, storagewrapper, max_slice_length, max_rate_period, fudge)
ffa67a072b170f7478ee0bf3381d2e718e5842ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/ffa67a072b170f7478ee0bf3381d2e718e5842ca/download.py
n = int(n)
n = long(n)
def hours(n): if n == -1: return '<unknown>' if n == 0: return 'complete!' n = int(n) h, r = divmod(n, 60 * 60) m, sec = divmod(r, 60) if h > 1000000: return '<unknown>' if h > 0: return '%d hour %02d min %02d sec' % (h, m, sec) else: return '%d min %02d sec' % (m, sec)
0ef016fa7778a2cf30f1f3f0483257ccc8522a96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0ef016fa7778a2cf30f1f3f0483257ccc8522a96/btdownloadheadless.py
if 'uprate' in info: totalup += info['uprate'] if 'downrate' in info: totaldown += info['downrate']
totalup += info.get('uprate', 0) totaldown += info.get('downrate', 0)
def runmany(d, params): threads = [] deadfiles = [] try: while 1: files = listdir(d) # new files for file in files: if file[-len(ext):] == ext: if file not in [x.getName() for x in threads] + deadfiles: wininfo[file] = {'basex': 2 * len(threads), 'killflag': Event()} statuswin.erase() statuswin.addnstr(0, 0,'new torren...
daf465ecd7745462c774698fe5cac00304c96f0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/daf465ecd7745462c774698fe5cac00304c96f0b/btlaunchmanycurses.py
if not self.only_local_override_ip or ip[:3] == '10.' or ip[:4] in ('192.', '169.', '127.'):
if not self.only_local_override_ip or is_local_ip(ip):
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) if self.uq_broken == 1: path = path.replace('+',' ') query = query.replace('+',' ') path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(...
86218c3a765c49faf94c4463c9f808fe2c1aebb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/86218c3a765c49faf94c4463c9f808fe2c1aebb2/track.py
if params.has_key('num want'): rsize = int(params['num want'])
if params.has_key('numwant'): rsize = int(params['numwant'])
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) if self.uq_broken == 1: path = path.replace('+',' ') query = query.replace('+',' ') path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(...
86218c3a765c49faf94c4463c9f808fe2c1aebb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/86218c3a765c49faf94c4463c9f808fe2c1aebb2/track.py
def is_local_ip(ip): try: v = [long(x) for x in '.'.split(ip)] if v[0] == 10 or v[:1] in ([192, 168], [169, 254]): return 1 if v[0] == 172 and v[1] >= 16 and v[1] <= 31: return 1 except ValueError: return 0
def expire_downloaders(self): for x in self.times.keys(): for myid, t in self.times[x].items(): if t < self.prevtime: del self.times[x][myid] del self.downloads[x][myid] self.prevtime = time() if (self.keep_dead != 1): for key, value in self.downloads.items(): if len(value) == 0: del self.times[key] del self.downloads[...
86218c3a765c49faf94c4463c9f808fe2c1aebb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/86218c3a765c49faf94c4463c9f808fe2c1aebb2/track.py
for configName, longDescription, shortDescription, defaultValue, usageText in optionDefintions: argDescript = "" if longDescription: if takesArgument(longDescription): sys.stdout.write(longLineForm(longDescription) + " <value>\n") else: sys.stdout.write(longLineForm(longDescription) + "\n")
outArray = [] maxOptLength = 0 for i in optionDefintions: garbage, longDescription, shortDescription, garbage, doc = i
def usage(usageHeading, optionDefintions, msg, exitCode=1): if msg: sys.stderr.write('error: %s\n' % msg) sys.stdout.write('%s\n' % usageHeading) for configName, longDescription, shortDescription, defaultValue, usageText in optionDefintions: argDescript = "" if longDescription: if takesArgument(longDescription): sys.st...
cbf0551d43676a1f0d23075efd2b25549fb87f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/cbf0551d43676a1f0d23075efd2b25549fb87f30/parseargs.py
if shortDescription: if takesArgument(shortDescription): sys.stdout.write(shortLineForm(shortDescription) + '<value>\n') else: sys.stdout.write(shortLineForm(shortDescription) + '\n')
lineForm = combinedLineForm(longDescription, shortDescription) if maxOptLength < len(lineForm): maxOptLength = len(lineForm) outArray.append( (lineForm, doc) )
def usage(usageHeading, optionDefintions, msg, exitCode=1): if msg: sys.stderr.write('error: %s\n' % msg) sys.stdout.write('%s\n' % usageHeading) for configName, longDescription, shortDescription, defaultValue, usageText in optionDefintions: argDescript = "" if longDescription: if takesArgument(longDescription): sys.st...
cbf0551d43676a1f0d23075efd2b25549fb87f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/cbf0551d43676a1f0d23075efd2b25549fb87f30/parseargs.py
if defaultValue: sys.stdout.write("\tdefault value: %s" % defaultValue) sys.stdout.write("\t%s\n\n" % usageText)
try: import curses curses.initscr() COLS = curses.COLS except: COLS = 80 firstLineString = "%%-%ds : " % maxOptLength bodyLineString = " " * len(firstLineString % "") targetBodyWidth = COLS - len(bodyLineString) - 2 if targetBodyWidth < 10: targetBodyWidth = COLS - 1 firstLineString = firstLineString[:-3] + "\n " bod...
def usage(usageHeading, optionDefintions, msg, exitCode=1): if msg: sys.stderr.write('error: %s\n' % msg) sys.stdout.write('%s\n' % usageHeading) for configName, longDescription, shortDescription, defaultValue, usageText in optionDefintions: argDescript = "" if longDescription: if takesArgument(longDescription): sys.st...
cbf0551d43676a1f0d23075efd2b25549fb87f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/cbf0551d43676a1f0d23075efd2b25549fb87f30/parseargs.py
if code == WSAENOBUFS:
if haveWSAENOBUFS and (code == WSAENOBUFS):
def listen_forever(self, handler): self.handler = handler try: while not self.doneflag.isSet(): try: self.pop_external() if len(self.funcs) == 0: period = 2 ** 30 else: period = self.funcs[0][0] - time() if period < 0: period = 0 events = self.poll.poll(period * timemult) if self.doneflag.isSet(): return while len(self...
c5283f8d4b4b99b4ba84867a465b1357e4e0174e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/c5283f8d4b4b99b4ba84867a465b1357e4e0174e/RawServer.py
completedir(argv[1], argv[2], dc)
completedir(argv[1], argv[2], fc = dc)
def dc(v): print v
42e70905a579c2a8c087675d6a955515ff2da1c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/42e70905a579c2a8c087675d6a955515ff2da1c6/btcompletedir.py
sellf.url += '&ip=' + quote(ip)
self.url += '&ip=' + quote(ip)
def __init__(self, url, interval, sched, howmany, minpeers, connect, externalsched, amount_left, up, down, port, ip, myid, infohash, timeout, errorfunc): self.url = ('%s?info_hash=%s&peer_id=%s&port=%s' % (url, quote(infohash), quote(myid), str(port))) if ip != '': sellf.url += '&ip=' + quote(ip) self.interval = interv...
9d2feec11bd40ee87f4a5df3f9188c150bca8505 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/9d2feec11bd40ee87f4a5df3f9188c150bca8505/Rerequester.py
storage = Storage(files, open, path.exists, path.getsize, statusfunc)
try: storage = Storage(files, open, path.exists, path.getsize, statusfunc) except IOError, e: errorfunc('trouble accessing files - ' + str(e)) return
def failed(reason, errorfunc = errorfunc, doneflag = doneflag): doneflag.set() if reason is not None: errorfunc(reason)
33671e265009362df43f6c9e9d27f8210dc00c9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/33671e265009362df43f6c9e9d27f8210dc00c9b/download.py
errorfunc('trouble setting readonly at end -' + str(e))
errorfunc('trouble setting readonly at end - ' + str(e))
def finished(finfunc = finfunc, finflag = finflag, ann = ann, storage = storage, errorfunc = errorfunc): finflag.set() try: storage.set_readonly() except (IOError, OSError), e: errorfunc('trouble setting readonly at end -' + str(e)) if ann[0] is not None: ann[0](1) finfunc()
33671e265009362df43f6c9e9d27f8210dc00c9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/33671e265009362df43f6c9e9d27f8210dc00c9b/download.py
if v[0] == 10 or v[0] == 127 or v[:1] in ([192, 168], [169, 254]):
if v[0] == 10 or v[0] == 127 or v[:2] in ([192, 168], [169, 254]):
def is_local_ip(ip): try: v = [long(x) for x in ip.split('.')] if v[0] == 10 or v[0] == 127 or v[:1] in ([192, 168], [169, 254]): return 1 if v[0] == 172 and v[1] >= 16 and v[1] <= 31: return 1 except ValueError: return 0
f705afbfe46da6c58dbcec3ded1058165e945ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/f705afbfe46da6c58dbcec3ded1058165e945ce9/track.py
h = HTTP(host)
def readput(url, data): protocol, host, path, g1, g2, g3 = urlparse(url) if protocol == 'http': h = HTTPConnection(host) elif protocol == 'https': h = HTTPSConnection(host) else: raise ValueError, "can't handle protocol '" + protocol + "'" h = HTTP(host) h.putrequest('PUT', path) h.putheader('content-length', str(len(d...
1e34b40f8e14e236e23ca0243ce62b64629137af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/1e34b40f8e14e236e23ca0243ce62b64629137af/readput.py
if (self.allowed is not None) and self.allowed.has_key(name):
if (self.allowed is not None) and self.allowed.has_key(name) and self.show_names:
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) if self.uq_broken == 1: path = path.replace('+',' ') query = query.replace('+',' ') path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(...
0822919e97f3032c477a8ba7685e2239c49ddd56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/0822919e97f3032c477a8ba7685e2239c49ddd56/track.py
self.close_socket(s) self.poll.unregister(sef.socket)
self.server.close() self.poll.unregister(self.server)
def handle_events(self, events): for sock, event in events: if sock == self.server.fileno(): if event & (POLLHUP | POLLERR) != 0: self.close_socket(s) self.poll.unregister(sef.socket) print "lost server socket" else: newsock, addr = self.server.accept() newsock.setblocking(0) nss = SingleSocket(self, newsock) self.sing...
9240147060111dfbe79c5d5a746bced0fb5af8c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/9240147060111dfbe79c5d5a746bced0fb5af8c7/RawServer.py
activity = dict.get('activity', None);
def onUpdateStatus(self, dict): fractionDone = dict.get('fractionDone', None); timeEst = dict.get('timeEst', None); downRate = dict.get('downRate', None); upRate = dict.get('upRate', None); activity = dict.get('activity', None); downTotal = dict.get('downTotal', None); upTotal = dict.get('upTotal', None); if fractionDo...
2d868aeec4c0310f00c36989ee66c1416373df86 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/2d868aeec4c0310f00c36989ee66c1416373df86/btdownloadgui.py
if activity is not None and not self.fin: self.timeEstText.SetLabel(activity)
def onUpdateStatus(self, dict): fractionDone = dict.get('fractionDone', None); timeEst = dict.get('timeEst', None); downRate = dict.get('downRate', None); upRate = dict.get('upRate', None); activity = dict.get('activity', None); downTotal = dict.get('downTotal', None); upTotal = dict.get('upTotal', None); if fractionDo...
2d868aeec4c0310f00c36989ee66c1416373df86 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/2d868aeec4c0310f00c36989ee66c1416373df86/btdownloadgui.py
frame = wxFrame(None, -1, 'BitTorrent download', size = wxSize(400, 250))
frame = wxFrame(None, -1, 'BitTorrent ' + version + ' download', size = wxSize(400, 250))
def __init__(self, flag): frame = wxFrame(None, -1, 'BitTorrent download', size = wxSize(400, 250)) self.frame = frame self.flag = flag self.fin = false self.shown = false
1837d5770325d3550eb3de5c39a6b107db1bd1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/1837d5770325d3550eb3de5c39a6b107db1bd1ac/btdownloadgui.py
self.frame.SetTitle('%d%% %s - BitTorrent' % (int(fractionDone*100), self.filename))
self.frame.SetTitle('%d%% %s - BitTorrent %s' % (int(fractionDone*100), self.filename, version))
def onUpdateStatus(self, fractionDone, timeEst, downRate, upRate, activity): if fractionDone is not None and not self.fin: self.gauge.SetValue(int(fractionDone * 1000)) self.frame.SetTitle('%d%% %s - BitTorrent' % (int(fractionDone*100), self.filename)) if timeEst is not None: self.timeEstText.SetLabel(hours(timeEst)) ...
1837d5770325d3550eb3de5c39a6b107db1bd1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/1837d5770325d3550eb3de5c39a6b107db1bd1ac/btdownloadgui.py
self.frame.SetTitle('%s - Upload - BitTorrent' % (self.filename))
self.frame.SetTitle('%s - Upload - BitTorrent %s' % (self.filename, version))
def onFinishEvent(self): self.timeEstText.SetLabel('Download Succeeded!') self.cancelButton.SetLabel('Finish') self.gauge.SetValue(1000) self.frame.SetTitle('%s - Upload - BitTorrent' % (self.filename)) self.downRateText.SetLabel('')
1837d5770325d3550eb3de5c39a6b107db1bd1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/1837d5770325d3550eb3de5c39a6b107db1bd1ac/btdownloadgui.py
self.frame.SetTitle(default + '- BitTorrent')
self.frame.SetTitle(default + '- BitTorrent ' + version)
def onChooseFile(self, default, bucket, f, size, dir): if dir: dl = wxDirDialog(self.frame, 'Choose a directory to save to, pick a partial download to resume', join(getcwd(), default), style = wxDD_DEFAULT_STYLE | wxDD_NEW_DIR_BUTTON) else: dl = wxFileDialog(self.frame, 'Choose file to save as, pick a partial download ...
1837d5770325d3550eb3de5c39a6b107db1bd1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/1837d5770325d3550eb3de5c39a6b107db1bd1ac/btdownloadgui.py
fileDestText.SetLabel(path)
self.fileDestText.SetLabel(path)
def newpath(self, path): fileDestText.SetLabel(path)
1837d5770325d3550eb3de5c39a6b107db1bd1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/1837d5770325d3550eb3de5c39a6b107db1bd1ac/btdownloadgui.py
if fractionDone is not None:
if fractionDone is not None and not self.fin:
def onUpdateStatus(self, fractionDone, timeEst, downRate, upRate, activity): if fractionDone is not None: self.gauge.SetValue(int(fractionDone * 1000)) newpercent = int(fractionDone*100) if newpercent == 100: self.frame.SetTitle('%s - Upload - BitTorrent' % (self.filename)) else: self.frame.SetTitle('%d%% %s - BitTorre...
b188d7e2a3a73acea16a7953a62cb3bbeb6672e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/b188d7e2a3a73acea16a7953a62cb3bbeb6672e7/btdownloadgui.py
newpercent = int(fractionDone*100) if newpercent == 100: self.frame.SetTitle('%s - Upload - BitTorrent' % (self.filename)) else: self.frame.SetTitle('%d%% %s - BitTorrent' % (newpercent, self.filename))
self.frame.SetTitle('%d%% %s - BitTorrent' % (int(fractionDone*100), self.filename))
def onUpdateStatus(self, fractionDone, timeEst, downRate, upRate, activity): if fractionDone is not None: self.gauge.SetValue(int(fractionDone * 1000)) newpercent = int(fractionDone*100) if newpercent == 100: self.frame.SetTitle('%s - Upload - BitTorrent' % (self.filename)) else: self.frame.SetTitle('%d%% %s - BitTorre...
b188d7e2a3a73acea16a7953a62cb3bbeb6672e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/b188d7e2a3a73acea16a7953a62cb3bbeb6672e7/btdownloadgui.py
def __init__(self, aemApplicationClass, path, pid, url, terms): """ aemApplicationClass : class -- aem.Application or equivalent path : str pid : int url : str terms : bool | module | tuple """ # initialise codecs aem.Codecs.__init__(self) self.encoders.update(_appscriptEncoders) self.decoders.update(_appscriptDecoders...
a5ccf51844814277bb32be555d595a5db88f17d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10961/a5ccf51844814277bb32be555d595a5db88f17d3/reference.py
except Exception, e:
except:
def _getAppData(self): if self._realAppData is None: # initialise AppData the first time it's actually needed try: self._realAppData = AppData(self._Application, self._path, self._pid, self._url, self._terms) except Exception, e: import sys, traceback print >> sys.stderr, '(A problem occured in AS_appdata; see first tr...
a5ccf51844814277bb32be555d595a5db88f17d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10961/a5ccf51844814277bb32be555d595a5db88f17d3/reference.py
print >> sys.stderr, '(A problem occured in AS_appdata; see first traceback for actual error.)'
print >> sys.stderr, 'Traceback for AS_appdata error:'
def _getAppData(self): if self._realAppData is None: # initialise AppData the first time it's actually needed try: self._realAppData = AppData(self._Application, self._path, self._pid, self._url, self._terms) except Exception, e: import sys, traceback print >> sys.stderr, '(A problem occured in AS_appdata; see first tr...
a5ccf51844814277bb32be555d595a5db88f17d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10961/a5ccf51844814277bb32be555d595a5db88f17d3/reference.py
print >> sys.stderr, '\n\n\n' return 0
print >> sys.stderr raise RuntimeError, 'An error occured in AS_appdata.'
def _getAppData(self): if self._realAppData is None: # initialise AppData the first time it's actually needed try: self._realAppData = AppData(self._Application, self._path, self._pid, self._url, self._terms) except Exception, e: import sys, traceback print >> sys.stderr, '(A problem occured in AS_appdata; see first tr...
a5ccf51844814277bb32be555d595a5db88f17d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10961/a5ccf51844814277bb32be555d595a5db88f17d3/reference.py
myns._import_ns(value)
myns.import_namespace(value)
def import_namespace(self, ns): for name in ns: value = ns[name] if isinstance(value, namespace): try: myns = self[name] if not isinstance(myns, namespace): raise TypeError('value-namespace conflict') except KeyError: myns = self.new_namespace(name) myns._import_ns(value) else: self[name] = value
cf83920d927ff2e273e7ed57dc9115f75a931bbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4370/cf83920d927ff2e273e7ed57dc9115f75a931bbc/config.py
...and accessed the same way:
...and accessed the same way, or with [...]:
def __setattr__(self, name, value): obj = self.namespace.new_namespace(self.name) obj[name] = value
cf83920d927ff2e273e7ed57dc9115f75a931bbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4370/cf83920d927ff2e273e7ed57dc9115f75a931bbc/config.py
self.gngeorc_buffer = None
self.gngeorc_buffer = []
def __init__(self,datarootpath,xgngeoUserDir,gngeoUserDir): #Initial attributes. self.datarootpath = datarootpath self.gngeorc_buffer = None self.paths = { "xgngeoUserDir" : xgngeoUserDir, #XGngeo local configuration directory. "xgngeoConf" : os.path.join(xgngeoUserDir,"xgngeo.conf"), #Path to XGngeo config file. "gnge...
f5ff957bcd16a16927b2c1cd5ca16e10c071d615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/f5ff957bcd16a16927b2c1cd5ca16e10c071d615/configfile.py
"effect": None,
"effect": "none",
def getDefaultParams(self): """Returns default options for the `gngeorc'/Rom-specific and XGngeo configuration files.""" return { #Gngeo default. #Important path section. "rompath": os.path.expanduser("~/..."), "romrc":os.path.join(prefix,"share","gngeo","romrc"), #Display section. "fullscreen":"false", "interpolation"...
f5ff957bcd16a16927b2c1cd5ca16e10c071d615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/f5ff957bcd16a16927b2c1cd5ca16e10c071d615/configfile.py
scan_dir_for_roms()
if self.widgets["fileselect_dialog"].get_current_folder(): scan_dir_for_roms()
def update_preview(*args): selection = self.widgets["fileselect_dialog"].get_preview_filename()
5247dcd46a1cf2aa9f85476fcb08e9bf4debbe85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/5247dcd46a1cf2aa9f85476fcb08e9bf4debbe85/__init__.py
"""Indicating whether any BIOS is present on a given directory,
"""Indicating whether any BIOS files are present on a given directory,
def get_bios_presence(self, path,give_type=0): """Indicating whether any BIOS is present on a given directory, with optional information regarding its/their type.""" if give_type: pass else: pass return True
5247dcd46a1cf2aa9f85476fcb08e9bf4debbe85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/5247dcd46a1cf2aa9f85476fcb08e9bf4debbe85/__init__.py
scanDirForRoms()
scanDirForRoms()
def updatePreview(*args): selection = self.widgets["fileselect_dialog"].get_preview_filename()
7662120244c385b9ee335d333db4a24f7cd60755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/7662120244c385b9ee335d333db4a24f7cd60755/__init__.py
self.updateFile()
self.update_file()
def add_rom(self, name, path, size): "Adding a new Rom to the list, with duplicate entries prevention."
d43b5b2e509ed9a18b2a8adf3fe64123281e3c50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/d43b5b2e509ed9a18b2a8adf3fe64123281e3c50/history.py
for dir in self.romdir_list: content += dir
for dir in self.romdir_list[1:]: content += "%s\n" % dir
def callback(widget,response): if response==gtk.RESPONSE_APPLY: self.romdir_list = temp_romdir_list #Validating the ROM list.
fc5ee12f88bbc08f5245341e4b7af571c7b8be64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/fc5ee12f88bbc08f5245341e4b7af571c7b8be64/__init__.py
for line in file.readlines(): self.romdir_list.append(line)
for line in file.readlines(): if line.strip(): self.romdir_list.append(line[:-1])
def callback(widget,response): if response==gtk.RESPONSE_APPLY: self.romdir_list = temp_romdir_list #Validating the ROM list.
fc5ee12f88bbc08f5245341e4b7af571c7b8be64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/fc5ee12f88bbc08f5245341e4b7af571c7b8be64/__init__.py
self.xgngeoconf_dir = os.path.expanduser("~/.xgngeo") self.xgngeoconf_file = os.path.join(self.xgngeoconf_dir,"xgngeo.conf") self.gngeoDir = os.path.expanduser("~/.gngeo") self.gngeorcPath = os.path.join(self.gngeoDir,"gngeorc")
self.xgngeoUserDir = os.path.expanduser("~/.xgngeo") self.xgngeoConfFile = os.path.join(self.xgngeoUserDir,"xgngeo.conf") self.gngeoUserDir = os.path.expanduser("~/.gngeo") self.gngeorcPath = os.path.join(self.gngeoUserDir,"gngeorc") for dir in (self.xgngeoUserDir,self.gngeoUserDir): if not os.path.isdir(dir): os.mkdi...
def __init__(self,datarootpath): self.datarootpath = datarootpath self.xgngeoconf_dir = os.path.expanduser("~/.xgngeo") #XGngeo local configuration directory. self.xgngeoconf_file = os.path.join(self.xgngeoconf_dir,"xgngeo.conf") #Path to XGngeo config file. self.gngeoDir = os.path.expanduser("~/.gngeo") #Gngeo local c...
96404073f3dc31bbf169897bbfa7d978ead642b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/96404073f3dc31bbf169897bbfa7d978ead642b4/configfile.py
return os.path.isfile(self.gngeorcPath),os.path.isfile(self.xgngeoconf_file)
return os.path.isfile(self.gngeorcPath),os.path.isfile(self.xgngeoConfFile)
def exists(self): return os.path.isfile(self.gngeorcPath),os.path.isfile(self.xgngeoconf_file)
96404073f3dc31bbf169897bbfa7d978ead642b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/96404073f3dc31bbf169897bbfa7d978ead642b4/configfile.py
for path in self.gngeorcPath,self.xgngeoconf_file:
for path in self.gngeorcPath,self.xgngeoConfFile:
def getParams(self,mamename=None): """Try to get the params of the global or a Rom-specific configuration file. If the file doesn't exist, there is no error but the param dict stays empty.""" if not mamename: #Parsing default main configuration files. dict = [{},{}] i=0 for path in self.gngeorcPath,self.xgngeoconf_file...
96404073f3dc31bbf169897bbfa7d978ead642b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/96404073f3dc31bbf169897bbfa7d978ead642b4/configfile.py
path = os.path.join(self.gngeoDir,"%s.cf" % mamename)
path = os.path.join(self.gngeoUserDir,"%s.cf" % mamename)
def getParams(self,mamename=None): """Try to get the params of the global or a Rom-specific configuration file. If the file doesn't exist, there is no error but the param dict stays empty.""" if not mamename: #Parsing default main configuration files. dict = [{},{}] i=0 for path in self.gngeorcPath,self.xgngeoconf_file...
96404073f3dc31bbf169897bbfa7d978ead642b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/96404073f3dc31bbf169897bbfa7d978ead642b4/configfile.py
if not os.path.isdir(self.xgngeoconf_dir): os.mkdir(self.xgngeoconf_dir) file = open(self.xgngeoconf_file,"w")
file = open(self.xgngeoConfFile,"w")
def writeGlobalConfig(self,gngeoDict,xgngeoDict,version): #Top comments. :p gngeoContent = "# Gngeo global configuration file.\n\
96404073f3dc31bbf169897bbfa7d978ead642b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/96404073f3dc31bbf169897bbfa7d978ead642b4/configfile.py
path = os.path.join(self.gngeoDir,"%s.cf" % mamename)
path = os.path.join(self.gngeoUserDir,"%s.cf" % mamename)
def writeRomConfig(self,dict,mamename,version): path = os.path.join(self.gngeoDir,"%s.cf" % mamename)
96404073f3dc31bbf169897bbfa7d978ead642b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/96404073f3dc31bbf169897bbfa7d978ead642b4/configfile.py
def get_bios_presence(self):
def get_bios_presence(self, path):
def get_bios_presence(self): return True
8626177bf6c79e5f7d4767e9775ca0790ab7bd2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/8626177bf6c79e5f7d4767e9775ca0790ab7bd2e/__init__.py
label = gtk.Label(_("The configuration file of Gngeo was not found!\nWe have to create one. Press OK to continue...") % self.configfile.get_path()[0])
label = gtk.Label(_("The configuration file of Gngeo was not found!\nWe have to create one. Press OK to continue..."))
def welcome(self): #Check for Gngeo's home directory if not os.path.isdir(gngeoPath): os.mkdir(gngeoPath)
ba7a403592ccff25cac1710c1061cafbb1386675 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3056/ba7a403592ccff25cac1710c1061cafbb1386675/xgngeo.py
registerer = _factory_registerer.register
registerer = getFactoryRegistry().register
def _installFactory(self, name, factory, methods, mimetypes, priority): """ calls the register factory utility, that actually links the factory. """ registerer = _factory_registerer.register
bf3c8fb0c256c5feec8b8645a4adec6518e04a4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/bf3c8fb0c256c5feec8b8645a4adec6518e04a4f/metaconfigure.py
self._f()
if self._f is not None: logging.getLogger('SiteError').error( "Cleanup without request close") self._f()
def __del__(self): self._f()
ef33ff4e1390cb13348e5a6b0adc728fc5b15b01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/ef33ff4e1390cb13348e5a6b0adc728fc5b15b01/zopepublication.py
s return None
return None
def getFactoriesFor(self, method, mimetype): try: return self._d[method][mimetype] except:
1b9238992081ea2b6c7c547bf8d00ea369aaaba6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/1b9238992081ea2b6c7c547bf8d00ea369aaaba6/requestpublicationregistry.py
def traversePath(self, request, ob, path):
9054a10ac78587776724fffabe076306fa272016 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/9054a10ac78587776724fffabe076306fa272016/publicationtraverse.py
'Error while reporting an error to the Error Reporting utility')
'Error while reporting an error to the Error Reporting utility' )
def _logErrorWithErrorReportingUtility(self, object, request, exc_info): # Record the error with the ErrorReportingUtility self.beginErrorHandlingTransaction(request, object, 'error reporting utility') try: errUtility = zapi.getUtility(IErrorReportingUtility)
db90164b497addc4b1559fc7c13d7697392f860f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/db90164b497addc4b1559fc7c13d7697392f860f/zopepublication.py
errService = queryService(object, ErrorReports)
errService = queryService(object, ErrorLogging)
def _logErrorWithErrorReportingService(self, object, request, exc_info): # Record the error with the ErrorReportingService beginErrorHandlingTransaction(request, 'error reporting service') try: errService = queryService(object, ErrorReports) if errService is not None: errService.raising(exc_info, request) # It is impor...
5b375f2a693c3b504d67dbd858edc957c9c73ad6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/5b375f2a693c3b504d67dbd858edc957c9c73ad6/zopepublication.py
ErrorReports)
ErrorLogging)
def _logErrorWithErrorReportingService(self, object, request, exc_info): # Record the error with the ErrorReportingService beginErrorHandlingTransaction(request, 'error reporting service') try: errService = queryService(object, ErrorReports) if errService is not None: errService.raising(exc_info, request) # It is impor...
5b375f2a693c3b504d67dbd858edc957c9c73ad6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/5b375f2a693c3b504d67dbd858edc957c9c73ad6/zopepublication.py
if (method == 'POST' and is_xml and env.get('SOAPAction', None)
if (method == 'POST' and is_xml and env.get('HTTP_SOAPACTION', None)
def __call__(self, input_stream, output_steam, env): """See `zope.app.publication.interfaces.IPublicationRequestFactory`""" method = env.get('REQUEST_METHOD', 'GET').upper()
bcd548aaa478235cc962230a64a16059857f79e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/bcd548aaa478235cc962230a64a16059857f79e3/httpfactory.py
raise Retry
raise Retry(exc_info)
def handleException(self, object, request, exc_info, retry_allowed=True): # This transaction had an exception that reached the publisher. # It must definitely be aborted. transaction.abort()
cf7d48064acddb6c21c325fc7532b1b9d5543b09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/cf7d48064acddb6c21c325fc7532b1b9d5543b09/zopepublication.py
name = zapi.getDefaultViewName(exception, request)
name = zapi.queryDefaultViewName(exception, request)
def handleException(self, object, request, exc_info, retry_allowed=True): # This transaction had an exception that reached the publisher. # It must definitely be aborted. get_transaction().abort()
70c4e4ea18e05ff25a6b12a5cdd7189a132b924d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/70c4e4ea18e05ff25a6b12a5cdd7189a132b924d/zopepublication.py
if hasattr(ob, '__implements__'):
if providedBy(ob):
def browserDefault(self, request): ob = self.context
adbbc9c31f090aa954bf07237b4b3e56e83b1ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/adbbc9c31f090aa954bf07237b4b3e56e83b1ecb/traversers.py
self._http = HTTPPublication(db) self._brower = BrowserPublication(db) self._xmlrpc = XMLRPCPublication(db) self._soappub = SOAPPublication(db) self._soapreq = component.queryUtility(interfaces.ISOAPRequestFactory) self._httpreq = component.queryUtility( interfaces.IHTTPRequestFactory, default=HTTPRequest) self._xmlrpc...
self._db = db
def __init__(self, db): """See `zope.app.publication.interfaces.IPublicationRequestFactory`""" self._http = HTTPPublication(db) self._brower = BrowserPublication(db) self._xmlrpc = XMLRPCPublication(db) self._soappub = SOAPPublication(db) self._soapreq = component.queryUtility(interfaces.ISOAPRequestFactory) self._http...
8a7ea414c020b97bcee4f1a534da4f373735752f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/8a7ea414c020b97bcee4f1a534da4f373735752f/httpfactory.py
if method in _browser_methods: content_type = env.get('CONTENT_TYPE', '') is_xml = content_type.startswith('text/xml') if (method == 'POST' and is_xml and env.get('HTTP_SOAPACTION', None) and self._soapreq is not None): request = self._soapreq(input_stream, output_steam, env) request.setPublication(self._soappub) eli...
request_class, publication_class = chooseClasses(method, env) request = request_class(input_stream, output_steam, env) request.setPublication(publication_class(self._db)) if IBrowserRequest.providedBy(request): setDefaultSkin(request)
def __call__(self, input_stream, output_steam, env): """See `zope.app.publication.interfaces.IPublicationRequestFactory`""" method = env.get('REQUEST_METHOD', 'GET').upper()
8a7ea414c020b97bcee4f1a534da4f373735752f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/8a7ea414c020b97bcee4f1a534da4f373735752f/httpfactory.py
def handleException(self, object, request, exc_info, retry_allowed=True): get_transaction().abort() if retry_allowed and isinstance(exc_info[1], ConflictError): tryToLogWarning('ZopePublication', 'Competing writes/reads at %s' % request.get('PATH_INFO', '???'), exc_info=True) raise Retry
def _logErrorWithErrorReportingService(self, object, request, exc_info):
def handleException(self, object, request, exc_info, retry_allowed=True): # This transaction had an exception that reached the publisher. # It must definitely be aborted. get_transaction().abort()
cd5c1e9f0a910d15636108cc1c151ce1a9444b93 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/cd5c1e9f0a910d15636108cc1c151ce1a9444b93/zopepublication.py
raise Unauthorized("Name %s begins with an underscore" % `name`)
raise Unauthorized, name
def publishTraverse(self, request, name): ob = self.context if name.startswith('@@'): return getView(ob, name[6:], request)
3ada46ab1d5ca5f4d86fa2d80fa89b6890881ac4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/3ada46ab1d5ca5f4d86fa2d80fa89b6890881ac4/traversers.py
def traverseName(self, request, ob, name):
1a7b73dcf7b14a1c71b85059a09ea235efe95906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/1a7b73dcf7b14a1c71b85059a09ea235efe95906/xmlrpc.py
factory_registerer = zapi.getUtility(IRequestPublicationRegistry)
factory_registerer = getUtility(IRequestPublicationRegistry)
def _installFactory(self, name, factory, methods, mimetypes, priority): """ calls the register factory utility, that actually links the factory. """ factory_registerer = zapi.getUtility(IRequestPublicationRegistry) registerer = factory_registerer.register
0f78c20fd8acebb0ce07720cb308507870d05e76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/0f78c20fd8acebb0ce07720cb308507870d05e76/metaconfigure.py
'Content-Type: text/plain;charset=iso-8859-1\r\n'
'Content-Type: text/plain;charset=utf-8\r\n'
def testHEADFuxup(self): pub = self.klass(None)
170d03b3270ce7b4de3232f1e5c0ddc2ca6a939c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/170d03b3270ce7b4de3232f1e5c0ddc2ca6a939c/test_browserpublication.py
'Content-Type: text/plain;charset=iso-8859-1\r\n'
'Content-Type: text/plain;charset=utf-8\r\n'
def testHEADFuxup(self): pub = self.klass(None)
170d03b3270ce7b4de3232f1e5c0ddc2ca6a939c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/170d03b3270ce7b4de3232f1e5c0ddc2ca6a939c/test_browserpublication.py
self.assertEqual(' '.join(value[9:]),
self.assertEqual(' '.join(value[-8:]),
def testRetryNotAllowed(self): from ZODB.POSException import ConflictError try: raise ConflictError except: pass self.publication.handleException( self.object, self.request, sys.exc_info(), retry_allowed=False) self.request.response.outputBody() value = self.out.getvalue().split() self.assertEqual(' '.join(value[:6]), ...
05492e1901865c1cfd6d77891348eaf25fe67762 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/05492e1901865c1cfd6d77891348eaf25fe67762/test_zopepublication.py
if len(sets.Set(priorities)) != len(l)
if len(sets.Set(priorities)) != len(l):
def register(self, method, mimetype, name, priority, factory): """ registers a factory for method+mimetype """
e7dfb34e86bf4c83bb82b81719b3011d58821d69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/e7dfb34e86bf4c83bb82b81719b3011d58821d69/requestpublicationregistry.py
from zope.app.location import LocationPhysicallyLocatable
from zope.app.location.traversing import LocationPhysicallyLocatable
def testTransactionAnnotation(self): from zope.interface import directlyProvides from zope.app.location import LocationPhysicallyLocatable from zope.app.location.interfaces import ILocation from zope.app.traversing.interfaces import IPhysicallyLocatable from zope.app.traversing.interfaces import IContainmentRoot ztapi....
f878309e957741411b2abae75271597aaf38e96d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/f878309e957741411b2abae75271597aaf38e96d/test_zopepublication.py
call (cli);
def call(cli): f = ex1.foo_t () f.x = 'this is a test string' f.xx = 1010 cli.call (ex1.FOO_FUNC, f, cb)
07e1c8ee0d38668c1bcc51fa5d5cc92adfd1be57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11834/07e1c8ee0d38668c1bcc51fa5d5cc92adfd1be57/ex1.py
bar.y.append ([1,2,3,4]); cli.call (ex1.BAR_FUNC, bar, cb2)
bar.y = [1,2,3,4,5] cli.call (ex1.FOO_BAR, bar, cb2)
def call2(cli): bar = ex1.bar_t () bar.y.append ([1,2,3,4]); cli.call (ex1.BAR_FUNC, bar, cb2)
546a8b994a27da14ec797e06890442884d679c36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11834/546a8b994a27da14ec797e06890442884d679c36/ex1.py
call2 (cli);
def call2(cli): bar = ex1.bar_t () bar.y.append ([1,2,3,4]); cli.call (ex1.BAR_FUNC, bar, cb2)
546a8b994a27da14ec797e06890442884d679c36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11834/546a8b994a27da14ec797e06890442884d679c36/ex1.py
z.dump ()
z.warnx ()
def call3(cli): z = ex1.bb_t () z.aa = ex1.A2; z.b.foos = [ex1.foo_t () for i in range(0,2) ] z.b.foos[0].x = "foos[0] = 4" z.b.foos[0].xx = 4 z.b.foos[1].x = "foos[1] = 5" z.b.foos[1].xx = 5 z.b.bar.y = [ 100, 200, 300, 400 ]; z.dump () cli.call (ex1.FOO_BB, z, cb)
94627dc2ddbe6efbf6d38bad083109d0fdcc24a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11834/94627dc2ddbe6efbf6d38bad083109d0fdcc24a8/ex1.py
def call3(cli): z = ex1.bb_t () z.aa = ex1.A2; z.b.foos = [ex1.foo_t () for i in range(0,2) ] z.b.foos[0].x = "foos[0] = 4" z.b.foos[0].xx = 4 z.b.foos[1].x = "foos[1] = 5" z.b.foos[1].xx = 5 z.b.bar.y = [ 100, 200, 300, 400 ]; z.dump () cli.call (ex1.FOO_BB, z, cb)
94627dc2ddbe6efbf6d38bad083109d0fdcc24a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11834/94627dc2ddbe6efbf6d38bad083109d0fdcc24a8/ex1.py
sock.connect (('127.0.0.1', 3000))
sock.connect (('127.0.0.1', port))
def call3(cli): z = ex1.bb_t () z.aa = ex1.A2; z.b.foos = [ex1.foo_t () for i in range(0,2) ] z.b.foos[0].x = "foos[0] = 4" z.b.foos[0].xx = 4 z.b.foos[1].x = "foos[1] = 5" z.b.foos[1].xx = 5 z.b.bar.y = [ 100, 200, 300, 400 ]; z.dump () cli.call (ex1.FOO_BB, z, cb)
94627dc2ddbe6efbf6d38bad083109d0fdcc24a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11834/94627dc2ddbe6efbf6d38bad083109d0fdcc24a8/ex1.py
z.baz = ex1.baz_t () z.baz.get().foos = [ex1.foo_t () for i in range (0,2) ] z.baz.get().foos[0].x = "foos[0] = 4" z.baz.get().foos[0].xx = 4 z.baz.get().foos[1].x = "foos[1] = 5" z.baz.get().foos[1].xx = 5 z.baz.get().bar.y = [ 100, 200, 300, 400 ];
z.baz.alloc () z.baz.p = ex1.baz_t () z.baz.p.foos = [ex1.foo_t () for i in range (0,2) ] z.baz.p.foos[0].x = "foos[0] = 4" z.baz.p.foos[0].xx = 4 z.baz.p.foos[1].x = "foos[1] = 5" z.baz.p.foos[1].xx = 5 z.baz.p.bar.y = [ 100, 200, 300, 400 ];
def call4(cli): z = ex1.fooz_t () z.baz = ex1.baz_t () z.baz.get().foos = [ex1.foo_t () for i in range (0,2) ] z.baz.get().foos[0].x = "foos[0] = 4" z.baz.get().foos[0].xx = 4 z.baz.get().foos[1].x = "foos[1] = 5" z.baz.get().foos[1].xx = 5 z.baz.get().bar.y = [ 100, 200, 300, 400 ]; z.warnx () cli.call (ex1.FOO_FOOZ, ...
cabfe6b1c032915cdab2fe4501450b5661365145 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11834/cabfe6b1c032915cdab2fe4501450b5661365145/ex1.py
image_path, capitalize, cellspacing):
image_path, cellspacing, animate, skip_caps): if animate: count = 0 drw = [] for i in xrange (len (image.layers) -1, -1, -1): if image.layers[i].visible: drw.append(image.layers[i]) count += 1 if count == 3: break
def pyslice(image, drawable, save_path, html_filename, image_basename, image_extension, separate, image_path, capitalize, cellspacing): vert, horz = get_guides(image) if len(vert) == 0 and len(horz) == 0: return gimp.progress_init("Py-Slice") progress_increment = 1 / ((len(horz) + 1) * (len(vert) + 1)) progress = 0....
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py
def check_path(path): path = os.path.abspath(path)
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py
cellspacing=cellspacing, capitalize=capitalize)
cellspacing=cellspacing, animate=animate)
def check_path(path): path = os.path.abspath(path)
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py
src = slice(image, image_path, image_basename, image_extension, left, right, top, bottom, i, j) if image_relative_path: if image_relative_path.endswith('/'): src_path = image_relative_path + src else: src_path = image_relative_path + '/' + src
if (skip_caps and ( (len(horz) >= 2 and (i == 0 or i == len(horz) )) or (len(vert) >= 2 and (j == 0 or j == len(vert) )) ) ): skip_stub = True
def check_path(path): path = os.path.abspath(path)
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py
src_path = src tw.cell(src_path, right - left, bottom - top)
skip_stub = False if (not animate or skip_stub): src = (image_relative_path + slice (image, None, image_path, image_basename, image_extension, left, right, top, bottom, i, j, "")) else: src = [] for layer, postfix in zip (drw, ("", "hover", "clicked")): src.append (image_relative_path + slice(image, layer, image_path,...
def check_path(path): path = os.path.abspath(path)
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py
def slice(image, image_path, image_basename, image_extension, left, right, top, bottom, i, j): src = "%s-%d-%d.%s" % (image_basename, i, j, image_extension)
def slice(image, drawable, image_path, image_basename, image_extension, left, right, top, bottom, i, j, postfix): if postfix: postfix = "_" + postfix src = "%s_%d_%d%s.%s" % (image_basename, i, j, postfix, image_extension)
def slice(image, image_path, image_basename, image_extension, left, right, top, bottom, i, j): src = "%s-%d-%d.%s" % (image_basename, i, j, image_extension) filename = os.path.join(image_path, src) temp_image = image.duplicate() temp_image.disable_undo() temp_image.crop(right - left, bottom - top, left, top) pdb.gim...
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py
temp_image = image.duplicate()
if not drawable: temp_image = image.duplicate() temp_drawable = temp_image.active_layer else: if image.base_type == INDEXED: original_active = image.active_layer image.active_layer = drawable temp_image = image.duplicate() temp_drawable = temp_image.active_layer image.active_layer = original_active temp_image.disable...
def slice(image, image_path, image_basename, image_extension, left, right, top, bottom, i, j): src = "%s-%d-%d.%s" % (image_basename, i, j, image_extension) filename = os.path.join(image_path, src) temp_image = image.duplicate() temp_image.disable_undo() temp_image.crop(right - left, bottom - top, left, top) pdb.gim...
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py
def slice(image, image_path, image_basename, image_extension, left, right, top, bottom, i, j): src = "%s-%d-%d.%s" % (image_basename, i, j, image_extension) filename = os.path.join(image_path, src) temp_image = image.duplicate() temp_image.disable_undo() temp_image.crop(right - left, bottom - top, left, top) pdb.gim...
98a11508ee7ce705e2061e739b1a77ec9b6008b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/98a11508ee7ce705e2061e739b1a77ec9b6008b1/py-slice.py