rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
response = xmlrpclib.dumps(response, methodresponse=1) | response = xmlrpclib.dumps(response, methodresponse=1, allow_none = self.allow_none) | def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data. | 44fa98d1ff28f6996bb6ec8ada530657e180b1c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44fa98d1ff28f6996bb6ec8ada530657e180b1c0/SimpleXMLRPCServer.py |
logRequests=1): | logRequests=1, allow_none=False): | def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.logRequests = logRequests | 44fa98d1ff28f6996bb6ec8ada530657e180b1c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44fa98d1ff28f6996bb6ec8ada530657e180b1c0/SimpleXMLRPCServer.py |
SimpleXMLRPCDispatcher.__init__(self) | SimpleXMLRPCDispatcher.__init__(self, allow_none) | def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.logRequests = logRequests | 44fa98d1ff28f6996bb6ec8ada530657e180b1c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44fa98d1ff28f6996bb6ec8ada530657e180b1c0/SimpleXMLRPCServer.py |
def __init__(self): SimpleXMLRPCDispatcher.__init__(self) | def __init__(self, allow_none=False): SimpleXMLRPCDispatcher.__init__(self, allow_none) | def __init__(self): SimpleXMLRPCDispatcher.__init__(self) | 44fa98d1ff28f6996bb6ec8ada530657e180b1c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44fa98d1ff28f6996bb6ec8ada530657e180b1c0/SimpleXMLRPCServer.py |
if value is not None and value != 'C': | if value not in (None, '', 'C'): | def setlocale(category, value=None): """ setlocale(integer,string=None) -> string. Activates/queries locale processing. """ if value is not None and value != 'C': raise Error, '_locale emulation only supports "C" locale' return 'C' | f13251864876b44e9037b52868b90eb2df13afbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f13251864876b44e9037b52868b90eb2df13afbe/locale.py |
parts = resp[left+1].split(resp[left + 1:right]) | parts = resp[left + 1:right].split(resp[left+1]) | def parse229(resp, peer): '''Parse the '229' response for a EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] <> '229': raise error_reply, resp left = resp.find('(') if left < 0: raise error_proto, resp right = resp.find(')', left + 1) if ... | 13468b1ef945b0570eec3d1d630ac3e8a78c0f32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/13468b1ef945b0570eec3d1d630ac3e8a78c0f32/ftplib.py |
def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. self.fileobj.seek(-8, 1) crc32 = read32(self.fileobj) isize = U32(read... | d6ad56784fff03262669945b5e9b0ecb41948b2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6ad56784fff03262669945b5e9b0ecb41948b2c/gzip.py | ||
elif isize != self.size: | elif isize != LOWU32(self.size): | def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. self.fileobj.seek(-8, 1) crc32 = read32(self.fileobj) isize = U32(read... | d6ad56784fff03262669945b5e9b0ecb41948b2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6ad56784fff03262669945b5e9b0ecb41948b2c/gzip.py |
write32u(self.fileobj, self.size) | write32u(self.fileobj, LOWU32(self.size)) | def close(self): if self.mode == WRITE: self.fileobj.write(self.compress.flush()) write32(self.fileobj, self.crc) # self.size may exceed 2GB write32u(self.fileobj, self.size) self.fileobj = None elif self.mode == READ: self.fileobj = None if self.myfileobj: self.myfileobj.close() self.myfileobj = None | d6ad56784fff03262669945b5e9b0ecb41948b2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6ad56784fff03262669945b5e9b0ecb41948b2c/gzip.py |
while args and args[0][:1] == '-' and args[0] != '-': | while args and args[0].startswith('-') and args[0] != '-': | def getopt(args, shortopts, longopts = []): """getopt(args, options[, long_options]) -> opts, args Parses command line options and parameter list. args is the argument list to be parsed, without the leading reference to the running program. Typically, this means "sys.argv[1:]". shortopts is the string of option let... | 0cfea82f908f5cc2d63275c121751444abc5fc2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0cfea82f908f5cc2d63275c121751444abc5fc2a/getopt.py |
opt, optarg = opt[:i], opt[i+1:] | def do_longs(opts, opt, longopts, args): try: i = opt.index('=') opt, optarg = opt[:i], opt[i+1:] except ValueError: optarg = None has_arg, opt = long_has_args(opt, longopts) if has_arg: if optarg is None: if not args: raise GetoptError('option --%s requires argument' % opt, opt) optarg, args = args[0], args[1:] elif ... | 0cfea82f908f5cc2d63275c121751444abc5fc2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0cfea82f908f5cc2d63275c121751444abc5fc2a/getopt.py | |
optlen = len(opt) | def long_has_args(opt, longopts): optlen = len(opt) for i in range(len(longopts)): x, y = longopts[i][:optlen], longopts[i][optlen:] if opt != x: continue if y != '' and y != '=' and i+1 < len(longopts): if opt == longopts[i+1][:optlen]: raise GetoptError('option --%s not a unique prefix' % opt, opt) if longopts[i][-1:... | 0cfea82f908f5cc2d63275c121751444abc5fc2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0cfea82f908f5cc2d63275c121751444abc5fc2a/getopt.py | |
x, y = longopts[i][:optlen], longopts[i][optlen:] if opt != x: continue if y != '' and y != '=' and i+1 < len(longopts): if opt == longopts[i+1][:optlen]: raise GetoptError('option --%s not a unique prefix' % opt, opt) if longopts[i][-1:] in ('=', ): return 1, longopts[i][:-1] return 0, longopts[i] raise GetoptError('o... | if longopts[i].startswith(opt): break else: raise GetoptError('option --%s not recognized' % opt, opt) j = i+1 while j < len(longopts) and longopts[j].startswith(opt): j += 1 possibilities = longopts[i:j] if opt in possibilities: return 0, opt elif opt + '=' in possibilities: return 1, opt if len(possibilities) > 1... | def long_has_args(opt, longopts): optlen = len(opt) for i in range(len(longopts)): x, y = longopts[i][:optlen], longopts[i][optlen:] if opt != x: continue if y != '' and y != '=' and i+1 < len(longopts): if opt == longopts[i+1][:optlen]: raise GetoptError('option --%s not a unique prefix' % opt, opt) if longopts[i][-1:... | 0cfea82f908f5cc2d63275c121751444abc5fc2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0cfea82f908f5cc2d63275c121751444abc5fc2a/getopt.py |
def readline(self, size=None, keepends=True): | f14668eaa9789aa3009285595bef9d01cf8f2cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f14668eaa9789aa3009285595bef9d01cf8f2cb3/codecs.py | ||
def readline(self, size=None, keepends=True): | f14668eaa9789aa3009285595bef9d01cf8f2cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f14668eaa9789aa3009285595bef9d01cf8f2cb3/codecs.py | ||
while True: | while 1: | def normalvariate(self, mu, sigma): """Normal distribution. | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py |
while True: | while 1: | def vonmisesvariate(self, mu, kappa): """Circular data distribution. | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py |
if not (u2 >= c * (2.0 - c) and u2 > c * _exp(1.0 - c)): | if u2 < c * (2.0 - c) or u2 <= c * _exp(1.0 - c): | def vonmisesvariate(self, mu, kappa): """Circular data distribution. | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py |
while True: | while 1: | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py |
while True: | while 1: | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py |
x = pow(p, 1.0/alpha) | x = p ** (1.0/alpha) | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py |
def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py | ||
if not (((p <= 1.0) and (u1 > _exp(-x))) or ((p > 1) and (u1 > pow(x, alpha - 1.0)))): | if p > 1.0: if u1 <= x ** (alpha - 1.0): break elif u1 <= _exp(-x): | def gammavariate(self, alpha, beta): """Gamma distribution. Not the gamma function! | 4aa9408036856a9acf52e0804055e17317b4e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4aa9408036856a9acf52e0804055e17317b4e3e6/random.py |
data += self.sslobj.read(len(data)-size) | data += self.sslobj.read(size-len(data)) | def read(self, size): """Read 'size' bytes from remote.""" # sslobj.read() sometimes returns < size bytes data = self.sslobj.read(size) while len(data) < size: data += self.sslobj.read(len(data)-size) | 347e75c3bc74fc55bc616ac9124e38fbeeddc326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/347e75c3bc74fc55bc616ac9124e38fbeeddc326/imaplib.py |
expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT) self.assertEquals( compile_command(str, "<input>", symbol), expected) | if is_jython: code = compile_command(str, "<input>", symbol) self.assert_(code) if symbol == "single": d,r = {},{} sys.stdout = cStringIO.StringIO() try: exec code in d exec compile(str,"<input>","single") in r finally: sys.stdout = sys.__stdout__ elif symbol == 'eval': ctx = {'a': 2} d = { 'value': eval(code,ctx) } r ... | def assertValid(self, str, symbol='single'): '''succeed iff str is a valid piece of code''' expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT) self.assertEquals( compile_command(str, "<input>", symbol), expected) | a64d01b7cb50715cfc5a4c672963f1f948661451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a64d01b7cb50715cfc5a4c672963f1f948661451/test_codeop.py |
self.assertEquals(compile_command(""), compile("pass", "<input>", 'single', PyCF_DONT_IMPLY_DEDENT)) | av("a = 9+ \\\n3") | av("def x():\n pass\n") | a64d01b7cb50715cfc5a4c672963f1f948661451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a64d01b7cb50715cfc5a4c672963f1f948661451/test_codeop.py |
ai("def x():\n") | ai("def x():\n") | a64d01b7cb50715cfc5a4c672963f1f948661451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a64d01b7cb50715cfc5a4c672963f1f948661451/test_codeop.py | |
ai("a = (") | ai("if 1:") ai("if 1:\n") ai("if 1:\n pass\n if 1:\n pass\n else:") ai("if 1:\n pass\n if 1:\n pass\n else:\n") ai("if 1:\n pass\n if 1:\n pass\n else:\n pass") ai("def x():") ai("def x():\n") ai("def x():\n\n") ai("def x():\n pass") ai("def x():\n pass\n ") ai("def x():\n pass\n ") ai("\n\ndef x():\n pass")... | ai("def x():\n") | a64d01b7cb50715cfc5a4c672963f1f948661451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a64d01b7cb50715cfc5a4c672963f1f948661451/test_codeop.py |
elif ord(c) < 32 or c in ' "*+,:;<=>?[]|': | elif ord(c) < 32 or c in ' ",:;<=>': | def normcase(s): res, s = splitdrive(s) for c in s: if c in '/\\': res = res + os.sep elif c == '.' and res[-1:] == os.sep: res = res + mapchar + c elif ord(c) < 32 or c in ' "*+,:;<=>?[]|': if res[-1:] != mapchar: res = res + mapchar else: res = res + c return string.lower(res) | 33afa5d0754f796a4cac06b3c02489dccc16c4d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33afa5d0754f796a4cac06b3c02489dccc16c4d5/dospath.py |
def redirect_request(self, req, fp, code, msg, headers): | def redirect_request(self, req, fp, code, msg, headers, newurl): | def redirect_request(self, req, fp, code, msg, headers): """Return a Request or None in response to a redirect. | d361e79ac280ef780e990c7694a0fefc3907b0aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d361e79ac280ef780e990c7694a0fefc3907b0aa/urllib2.py |
if "location" in headers: newurl = headers["location"] elif "uri" in headers: newurl = headers["uri"] else: return newurl = urlparse.urljoin(req.get_full_url(), newurl) | def redirect_request(self, req, fp, code, msg, headers): """Return a Request or None in response to a redirect. | d361e79ac280ef780e990c7694a0fefc3907b0aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d361e79ac280ef780e990c7694a0fefc3907b0aa/urllib2.py | |
new = self.redirect_request(req, fp, code, msg, headers) | new = self.redirect_request(req, fp, code, msg, headers, newurl) | def http_error_302(self, req, fp, code, msg, headers): if 'location' in headers: newurl = headers['location'] elif 'uri' in headers: newurl = headers['uri'] else: return newurl = urlparse.urljoin(req.get_full_url(), newurl) | d361e79ac280ef780e990c7694a0fefc3907b0aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d361e79ac280ef780e990c7694a0fefc3907b0aa/urllib2.py |
map(lambda t: apply(priDB.put, t), ProductIndex) | map(lambda t, priDB=priDB: apply(priDB.put, t), ProductIndex) | def test01_join(self): if verbose: print '\n', '-=' * 30 print "Running %s.test01_join..." % \ self.__class__.__name__ | 09268e2dda09c8a04a5a0e3e38fca3bc70b2b5fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09268e2dda09c8a04a5a0e3e38fca3bc70b2b5fd/test_join.py |
map(lambda t: apply(secDB.put, t), ColorIndex) | map(lambda t, secDB=secDB: apply(secDB.put, t), ColorIndex) | def test01_join(self): if verbose: print '\n', '-=' * 30 print "Running %s.test01_join..." % \ self.__class__.__name__ | 09268e2dda09c8a04a5a0e3e38fca3bc70b2b5fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09268e2dda09c8a04a5a0e3e38fca3bc70b2b5fd/test_join.py |
finalized. This gives provides the opportunity to sneak option | finalized. This provides the opportunity to sneak option | def reinitialize_command (self, command): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This gives provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the confi... | 5a828ec7e353934b794d47b2912af37a023cb717 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5a828ec7e353934b794d47b2912af37a023cb717/dist.py |
self.text = text = Text(text_frame, name='text', padx=5, wrap=None, | self.text = text = Text(text_frame, name='text', padx=5, wrap='none', | def __init__(self, flist=None, filename=None, key=None, root=None): currentTheme=idleConf.CurrentTheme() self.flist = flist root = root or flist.root self.root = root self.menubar = Menu(root) self.top = top = self.Toplevel(root, menu=self.menubar) if flist: self.vars = flist.vars #self.top.instanceDict makes flist.inv... | 824a01c2e7258ff5cc4a1cb903d6132c835304dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/824a01c2e7258ff5cc4a1cb903d6132c835304dd/EditorWindow.py |
return self.data.has_key(ref(key)) | try: wr = ref(key) except TypeError: return 0 return self.data.has_key(wr) | def has_key(self, key): return self.data.has_key(ref(key)) | b411aaaf0c12add5faa2a232130a7a0b74baae0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b411aaaf0c12add5faa2a232130a7a0b74baae0b/weakref.py |
MIN_SQLITE_VERSION = 3002002 | MIN_SQLITE_VERSION_NUMBER = 3000008 MIN_SQLITE_VERSION = "3.0.8" | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | e74050d3f53766077e1042cd40c6a54dca9cec42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e74050d3f53766077e1042cd40c6a54dca9cec42/setup.py |
if db_setup_debug: print "found %s"%f | if sqlite_setup_debug: print "sqlite: found %s"%f | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | e74050d3f53766077e1042cd40c6a54dca9cec42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e74050d3f53766077e1042cd40c6a54dca9cec42/setup.py |
if sqlite_version >= MIN_SQLITE_VERSION: | if sqlite_version >= MIN_SQLITE_VERSION_NUMBER: | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | e74050d3f53766077e1042cd40c6a54dca9cec42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e74050d3f53766077e1042cd40c6a54dca9cec42/setup.py |
if db_setup_debug: | if sqlite_setup_debug: | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | e74050d3f53766077e1042cd40c6a54dca9cec42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e74050d3f53766077e1042cd40c6a54dca9cec42/setup.py |
def grid_location(self, x, y): """Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.""" return self._getints( self.tk.call( 'grid', 'location', self._w, x, y)) or None location = grid_location | location = grid_location = Misc.grid_location | def grid_location(self, x, y): """Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.""" return self._getints( self.tk.call( 'grid', 'location', self._w, x, y)) or None | d9445eda28dd2b7dffaa35eb6abc6c10eaa02457 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9445eda28dd2b7dffaa35eb6abc6c10eaa02457/Tkinter.py |
gl.RGBmode() gl.gconfig() | self.set_rgbmode() | def initcolormap(self): self.colormapinited = 1 self.color0 = None self.fixcolor0 = 0 if self.format in ('rgb', 'jpeg', 'compress'): self.set_rgbmode() gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return # This only works on an Entry-level Indigo from IRIX 4.0.5 if self.format == 'rgb8' and is_entry_in... | 18437736c8bbcbb52f49fec00fd4e2e6090ca3a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18437736c8bbcbb52f49fec00fd4e2e6090ca3a5/VFile.py |
gl.mapcolor(index, r, g, b) | map.append(index, r, g, b) | def _initcmap(self): if self.format in ('mono', 'grey4') and self.mustunpack: convcolor = conv_grey else: convcolor = choose_conversion(self.format) maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE) if maxbits > 11: maxbits = 11 c0bits = self.c0bits c1bits = self.c1bits c2bits = self.c2bits if c0bits+c1bits+c2bits > max... | 18437736c8bbcbb52f49fec00fd4e2e6090ca3a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18437736c8bbcbb52f49fec00fd4e2e6090ca3a5/VFile.py |
lookup = getattr(self, "handle_"+condition) elif condition in ["response", "request"]: | lookup = self.handle_open elif condition == "response": | def add_handler(self, handler): added = False for meth in dir(handler): i = meth.find("_") protocol = meth[:i] condition = meth[i+1:] | 06aac9cdbe1a7667f6186a6f21e135f7be772421 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/06aac9cdbe1a7667f6186a6f21e135f7be772421/urllib2.py |
lookup = getattr(self, "process_"+condition) | lookup = self.process_response elif condition == "request": kind = protocol lookup = self.process_request | def add_handler(self, handler): added = False for meth in dir(handler): i = meth.find("_") protocol = meth[:i] condition = meth[i+1:] | 06aac9cdbe1a7667f6186a6f21e135f7be772421 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/06aac9cdbe1a7667f6186a6f21e135f7be772421/urllib2.py |
print sys.exc_value | def test(name, input, output): f = getattr(strop, name) try: value = f(input) except: value = sys.exc_type print sys.exc_value if value != output: print f, `input`, `output`, `value` | 6afe6e88b58e54687291253e42c039c81ad14347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6afe6e88b58e54687291253e42c039c81ad14347/test_strop.py | |
def getresponse(self): "Get the response from the server." | bbc63bac054b072bdb5d737ab7608c3ffb4ee395 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbc63bac054b072bdb5d737ab7608c3ffb4ee395/httplib.py | ||
def __init__(self): self.data = {} def __repr__(self): return repr(self.data) def __cmp__(self, dict): if type(dict) == type(self.data): return cmp(self.data, dict) else: return cmp(self.data, dict.data) def __len__(self): return len(self.data) def __getitem__(self, key): return self.data[key] def __setitem__(self, key... | def __init__(self): self.data = {} def __repr__(self): return repr(self.data) def __cmp__(self, dict): if type(dict) == type(self.data): return cmp(self.data, dict) else: return cmp(self.data, dict.data) def __len__(self): return len(self.data) def __getitem__(self, key): return self.data[key] def __setitem__(self, key... | def __init__(self): self.data = {} | 7c5ed6c136f805b7d459cf38cf2ef8180dd68871 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c5ed6c136f805b7d459cf38cf2ef8180dd68871/UserDict.py |
def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | 21342bf57506ae69bd7f85b12ff62a00a1bf8b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/21342bf57506ae69bd7f85b12ff62a00a1bf8b24/setup.py | ||
debian_tcl_include = [ '/usr/include/tcl' + version ] debian_tk_include = [ '/usr/include/tk' + version ] + \ debian_tcl_include tcl_includes = find_file('tcl.h', inc_dirs, debian_tcl_include) tk_includes = find_file('tk.h', inc_dirs, debian_tk_include) | dotversion = version if '.' not in dotversion and "bsd" in sys.platform.lower(): dotversion = dotversion[:-1] + '.' + dotversion[-1] tcl_include_sub = [] tk_include_sub = [] for dir in inc_dirs: tcl_include_sub += [dir + os.sep + "tcl" + dotversion] tk_include_sub += [dir + os.sep + "tk" + dotversion] tk_include_sub ... | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | 21342bf57506ae69bd7f85b12ff62a00a1bf8b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/21342bf57506ae69bd7f85b12ff62a00a1bf8b24/setup.py |
self.announce("INFO: Can't locate Tcl/Tk libs and/or headers", 2) | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | 21342bf57506ae69bd7f85b12ff62a00a1bf8b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/21342bf57506ae69bd7f85b12ff62a00a1bf8b24/setup.py | |
self.formatter.end_paragraph(0) | self.formatter.end_paragraph(1) | def end_blockquote(self): self.formatter.end_paragraph(0) self.formatter.pop_margin() | 20b35690ee3c685b26abc9a7ddc1fe028abe1f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20b35690ee3c685b26abc9a7ddc1fe028abe1f31/htmllib.py |
self.formatter.end_paragraph(0) | self.formatter.end_paragraph(1) | def start_dl(self, attrs): self.formatter.end_paragraph(0) self.list_stack.append(['dl', '', 0]) | 20b35690ee3c685b26abc9a7ddc1fe028abe1f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20b35690ee3c685b26abc9a7ddc1fe028abe1f31/htmllib.py |
self.ddpop() | self.ddpop(1) | def end_dl(self): self.ddpop() if self.list_stack: del self.list_stack[-1] | 20b35690ee3c685b26abc9a7ddc1fe028abe1f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20b35690ee3c685b26abc9a7ddc1fe028abe1f31/htmllib.py |
def ddpop(self): self.formatter.end_paragraph(0) | def ddpop(self, bl=0): self.formatter.end_paragraph(bl) | def ddpop(self): self.formatter.end_paragraph(0) if self.list_stack: if self.list_stack[-1][0] == 'dd': | 20b35690ee3c685b26abc9a7ddc1fe028abe1f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20b35690ee3c685b26abc9a7ddc1fe028abe1f31/htmllib.py |
def start_string(self, attrs): self.start_b(attrs) def end_b(self): self.end_b() | def start_strong(self, attrs): self.start_b(attrs) def end_strong(self): self.end_b() | def start_string(self, attrs): self.start_b(attrs) | 20b35690ee3c685b26abc9a7ddc1fe028abe1f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20b35690ee3c685b26abc9a7ddc1fe028abe1f31/htmllib.py |
def end_var(self): self.end_var() | def end_var(self): self.end_i() | def end_var(self): self.end_var() | 20b35690ee3c685b26abc9a7ddc1fe028abe1f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20b35690ee3c685b26abc9a7ddc1fe028abe1f31/htmllib.py |
if ModalDialog(self._filterfunc) == 1: | if ModalDialog(_ProgressBar_filterfunc) == 1: | def _update(self, value): tp, h, bar_rect = self.d.GetDialogItem(3) Qd.SetPort(self.d) Qd.FrameRect(bar_rect) # Draw outline inner_rect = Qd.InsetRect(bar_rect, 1, 1) Qd.ForeColor(QuickDraw.whiteColor) Qd.BackColor(QuickDraw.whiteColor) Qd.PaintRect(inner_rect) # Clear internal l, t, r, b = inner_rect r = int(l + (r... | 1cea19f2f4835a255cb9a64f47d8a55baaf5798d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cea19f2f4835a255cb9a64f47d8a55baaf5798d/EasyDialogs.py |
def _filterfunc(self, d, e, *more): return 2 | def _filterfunc(self, d, e, *more): return 2 # XXXX For now, this disables the cancel button | 1cea19f2f4835a255cb9a64f47d8a55baaf5798d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cea19f2f4835a255cb9a64f47d8a55baaf5798d/EasyDialogs.py | |
def _ProgressBar_filterfunc(*args): return 2 | def set(self, value): if value < 0: value = 0 if value > self.maxval: value = self.maxval self._update(value) | 1cea19f2f4835a255cb9a64f47d8a55baaf5798d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cea19f2f4835a255cb9a64f47d8a55baaf5798d/EasyDialogs.py | |
u = u''.join(map(unichr, xrange(1024))) for encoding in ('utf-7', 'utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'raw_unicode_escape', 'unicode_escape', 'unicode_internal'): self.assertEqual(unicode(u.encode(encoding),encoding), u) | for c in xrange(1024): u = unichr(c) for encoding in ('utf-7', 'utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'raw_unicode_escape', 'unicode_escape', 'unicode_internal'): self.assertEqual(unicode(u.encode(encoding),encoding), u) | def test_codecs(self): # Encoding self.assertEqual(u'hello'.encode('ascii'), 'hello') self.assertEqual(u'hello'.encode('utf-7'), 'hello') self.assertEqual(u'hello'.encode('utf-8'), 'hello') self.assertEqual(u'hello'.encode('utf8'), 'hello') self.assertEqual(u'hello'.encode('utf-16-le'), 'h\000e\000l\000l\000o\000') sel... | 38c70e601d470b2de8cf9228de15540fbee65313 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/38c70e601d470b2de8cf9228de15540fbee65313/test_unicode.py |
u = u''.join(map(unichr, xrange(256))) for encoding in ('latin-1',): self.assertEqual(unicode(u.encode(encoding),encoding), u) | for c in xrange(256): u = unichr(c) for encoding in ('latin-1',): self.assertEqual(unicode(u.encode(encoding),encoding), u) | def test_codecs(self): # Encoding self.assertEqual(u'hello'.encode('ascii'), 'hello') self.assertEqual(u'hello'.encode('utf-7'), 'hello') self.assertEqual(u'hello'.encode('utf-8'), 'hello') self.assertEqual(u'hello'.encode('utf8'), 'hello') self.assertEqual(u'hello'.encode('utf-16-le'), 'h\000e\000l\000l\000o\000') sel... | 38c70e601d470b2de8cf9228de15540fbee65313 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/38c70e601d470b2de8cf9228de15540fbee65313/test_unicode.py |
u = u''.join(map(unichr, xrange(128))) for encoding in ('ascii',): self.assertEqual(unicode(u.encode(encoding),encoding), u) | for c in xrange(128): u = unichr(c) for encoding in ('ascii',): self.assertEqual(unicode(u.encode(encoding),encoding), u) | def test_codecs(self): # Encoding self.assertEqual(u'hello'.encode('ascii'), 'hello') self.assertEqual(u'hello'.encode('utf-7'), 'hello') self.assertEqual(u'hello'.encode('utf-8'), 'hello') self.assertEqual(u'hello'.encode('utf8'), 'hello') self.assertEqual(u'hello'.encode('utf-16-le'), 'h\000e\000l\000l\000o\000') sel... | 38c70e601d470b2de8cf9228de15540fbee65313 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/38c70e601d470b2de8cf9228de15540fbee65313/test_unicode.py |
return strftime(self.format, (item,)*8+(0,)).capitalize() | t = (2001, 1, item+1, 12, 0, 0, item, item+1, 0) return strftime(self.format, t).capitalize() | def __getitem__(self, item): if isinstance(item, int): if item < 0: item += self.len if not 0 <= item < self.len: raise IndexError, "out of range" return strftime(self.format, (item,)*8+(0,)).capitalize() elif isinstance(item, type(slice(0))): return [self[e] for e in range(self.len)].__getslice__(item.start, item.stop... | ebb5916ac26ae91ab8a65b1090a83fef87b31a54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebb5916ac26ae91ab8a65b1090a83fef87b31a54/calendar.py |
[frozenmain_c, frozen_c], target) | [frozenmain_c, os.path.basename(frozen_c)], os.path.basename(target)) | def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path[:] modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # modules that are imported by the Python runtime implicits = ... | 3add016f81cbdab356106e9a292e8ff242a324c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3add016f81cbdab356106e9a292e8ff242a324c3/freeze.py |
The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~') | The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs and spaces are always encoded, as per RFC 1521. """ if c in ' \t': return quotetabs return c == ESCAPE or not (' ' <= c <= '~') | def needsquoting(c, quotetabs): """Decide whether a particular character needs to be quoted. The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~') | 425bbbb21443c34ba719bc271466c6e3c7cd680c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/425bbbb21443c34ba719bc271466c6e3c7cd680c/quopri.py |
The 'quotetabs' flag indicates whether tabs should be quoted. """ | The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs and spaces are always encoded, as per RFC 1521. """ def write(s, output=output, lineEnd='\n'): if s and s[-1:] in ' \t': output.write(s[:-1] + quote(s[-1]) + lineEnd) else: output.write(s + lineEnd) prevline... | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 425bbbb21443c34ba719bc271466c6e3c7cd680c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/425bbbb21443c34ba719bc271466c6e3c7cd680c/quopri.py |
new = '' last = line[-1:] if last == '\n': | outline = [] stripped = '' if line[-1:] == '\n': | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 425bbbb21443c34ba719bc271466c6e3c7cd680c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/425bbbb21443c34ba719bc271466c6e3c7cd680c/quopri.py |
else: last = '' prev = '' | stripped = '\n' | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 425bbbb21443c34ba719bc271466c6e3c7cd680c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/425bbbb21443c34ba719bc271466c6e3c7cd680c/quopri.py |
if len(new) + len(c) >= MAXLINESIZE: output.write(new + ESCAPE + '\n') new = '' new = new + c prev = c if prev in (' ', '\t'): output.write(new + ESCAPE + '\n\n') else: output.write(new + '\n') | if linelen + len(c) >= MAXLINESIZE: if prevline is not None: write(prevline) prevline = EMPTYSTRING.join(outline) linelen = 0 outline = [] outline.append(c) linelen += len(c) if prevline is not None: write(prevline) prevline = EMPTYSTRING.join(outline) linelen = 0 outline = [] if prevline is not None: write(prevlin... | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 425bbbb21443c34ba719bc271466c6e3c7cd680c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/425bbbb21443c34ba719bc271466c6e3c7cd680c/quopri.py |
def test(): | def main(): | def test(): import sys import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'td') except getopt.error, msg: sys.stdout = sys.stderr print msg print "usage: quopri [-t | -d] [file] ..." print "-t: quote tabs" print "-d: decode; default encode" sys.exit(2) deco = 0 tabs = 0 for o, a in opts: if o == '-t': tabs = 1... | 425bbbb21443c34ba719bc271466c6e3c7cd680c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/425bbbb21443c34ba719bc271466c6e3c7cd680c/quopri.py |
test() | main() | def test(): import sys import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'td') except getopt.error, msg: sys.stdout = sys.stderr print msg print "usage: quopri [-t | -d] [file] ..." print "-t: quote tabs" print "-d: decode; default encode" sys.exit(2) deco = 0 tabs = 0 for o, a in opts: if o == '-t': tabs = 1... | 425bbbb21443c34ba719bc271466c6e3c7cd680c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/425bbbb21443c34ba719bc271466c6e3c7cd680c/quopri.py |
_tryorder = ["galeon", "mozilla", "netscape", "kfm", "grail", "links", "lynx", "w3m",] | _tryorder = ["links", "lynx", "w3m"] | def open_new(self, url): self.open(url) | c75fd3de79457d9891801c2dd0c58b144120a306 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c75fd3de79457d9891801c2dd0c58b144120a306/webbrowser.py |
if tr_enc: if tr_enc.lower() != 'chunked': raise UnknownTransferEncoding() | if tr_enc and tr_enc.lower() == "chunked": | def begin(self): if self.msg is not None: # we've already started reading the response return | f19b68e76fa171980788a721fecdce8e4f1ca749 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f19b68e76fa171980788a721fecdce8e4f1ca749/httplib.py |
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) | raise HTTPError(req.get_full_url(), code, msg, headers, fp) | def redirect_request(self, req, fp, code, msg, headers, newurl): """Return a Request or None in response to a redirect. | 8e326f613773457e8d58b7ad1946ca3043775ab4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8e326f613773457e8d58b7ad1946ca3043775ab4/urllib2.py |
if terminator is None: | if terminator is None or terminator == '': | def handle_read (self): | ffd1e1e154771676a6ec52ab1b15a7048342cf73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ffd1e1e154771676a6ec52ab1b15a7048342cf73/asynchat.py |
meta = '\n <meta name="aesop" content="%s">' | meta = '<meta name="aesop" content="%s">\n ' % self.aesop_type | def get_header(self): s = HEAD % self.variables if self.uplink: if self.uptitle: link = ('<link rel="up" href="%s" title="%s">' % (self.uplink, self.uptitle)) else: link = '<link rel="up" href="%s">' % self.uplink repl = " %s\n</head>" % link s = s.replace("</head>", repl, 1) if self.aesop_type: meta = '\n <meta name... | 33411ce685a5a992dd895ae9f82908e38a9aa11d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33411ce685a5a992dd895ae9f82908e38a9aa11d/support.py |
if not dircase in _dirs_in_sys_path and os.path.exists(dir): | if not dircase in _dirs_in_sys_path: | def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir) | a5c6294a43a58a97e1d0e9fd71962f3112300cb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5c6294a43a58a97e1d0e9fd71962f3112300cb7/site.py |
created_dirs = [] | def mkpath (name, mode=0777, verbose=0, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists, return silently. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' i... | 4f6719ff1041b68835a25daa16d85ec6660d10ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f6719ff1041b68835a25daa16d85ec6660d10ce/util.py | |
return | return created_dirs | def mkpath (name, mode=0777, verbose=0, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists, return silently. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' i... | 4f6719ff1041b68835a25daa16d85ec6660d10ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f6719ff1041b68835a25daa16d85ec6660d10ce/util.py |
return | return created_dirs | def mkpath (name, mode=0777, verbose=0, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists, return silently. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' i... | 4f6719ff1041b68835a25daa16d85ec6660d10ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f6719ff1041b68835a25daa16d85ec6660d10ce/util.py |
if msg[:3] != '500': raise error_perm, msg | if msg.args[0][:3] != '500': raise | def cwd(self, dirname): '''Change to a directory.''' if dirname == '..': try: return self.voidcmd('CDUP') except error_perm, msg: if msg[:3] != '500': raise error_perm, msg elif dirname == '': dirname = '.' # does nothing, but could return error cmd = 'CWD ' + dirname return self.voidcmd(cmd) | e7b2e16fd57a3b6dbee270a841f682243aa8789e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7b2e16fd57a3b6dbee270a841f682243aa8789e/ftplib.py |
tcltkdata = [(tcltk.id, "REGISTRY.tcl"), | tcldata = [(tcltk.id, "REGISTRY.tcl"), | # File extensions, associated with the REGISTRY.def component | ae4df2dcac34dc3909f10e7b8232f87afade6d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ae4df2dcac34dc3909f10e7b8232f87afade6d57/msi.py |
[("py", "open", 1, None, r'-n -e "%1"'), ("pyw", "open", 1, None, r'-n -e "%1"'), ("pyc", "open", 1, None, r'-n -e "%1"'), ("pyo", "open", 1, None, r'-n -e "%1"')]) | [("py", "open", 1, None, r'"%1"'), ("pyw", "open", 1, None, r'"%1"'), ("pyc", "open", 1, None, r'"%1"'), ("pyo", "open", 1, None, r'"%1"')]) | # File extensions, associated with the REGISTRY.def component | ae4df2dcac34dc3909f10e7b8232f87afade6d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ae4df2dcac34dc3909f10e7b8232f87afade6d57/msi.py |
screenbounds = Qd.qd.screenBits.bounds screenbounds = screenbounds[0]+4, screenbounds[1]+4, \ screenbounds[2]-4, screenbounds[3]-4 | def AskYesNoCancel(question, default = 0): | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py | |
def __init__(self, label="Working...", maxval=100): self.label = label | def __init__(self, title="Working...", maxval=100, label=""): | def __init__(self, label="Working...", maxval=100): self.label = label self.maxval = maxval self.curval = -1 self.d = GetNewDialog(259, -1) tp, text_h, rect = self.d.GetDialogItem(2) SetDialogItemText(text_h, label) self._update(0) | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py |
SetDialogItemText(text_h, label) self._update(0) | SetDialogItemText(text_h, self._label) | def __init__(self, label="Working...", maxval=100): self.label = label self.maxval = maxval self.curval = -1 self.d = GetNewDialog(259, -1) tp, text_h, rect = self.d.GetDialogItem(2) SetDialogItemText(text_h, label) self._update(0) | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py |
if ModalDialog(_ProgressBar_filterfunc) == 1: raise KeyboardInterrupt | ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 ) if ready : what,msg,when,where,mod = ev part = Win.FindWindow(where)[0] if Dlg.IsDialogEvent(ev): ds = Dlg.DialogSelect(ev) if ds[0] and ds[1] == self.d and ds[-1] == 1: raise KeyboardInterrupt, ev else: if part == 4: self.d.DragWindow(where, screenbounds) else: Ma... | def _update(self, value): tp, h, bar_rect = self.d.GetDialogItem(3) Qd.SetPort(self.d) Qd.FrameRect(bar_rect) # Draw outline inner_rect = Qd.InsetRect(bar_rect, 1, 1) l, t, r, b = inner_rect | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py |
def _ProgressBar_filterfunc(*args): return 2 | def inc(self, n=1): """inc(amt) - Increment progress bar position""" self.set(self.curval + n) | def set(self, value): if value < 0: value = 0 if value > self.maxval: value = self.maxval self._update(value) | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py |
bar = ProgressBar("Counting...", 100) for i in range(100): bar.set(i) del bar | text = ( "Working Hard...", "Hardly Working..." , "So far, so good!", "Keep on truckin'" ) bar = ProgressBar("Progress, progress...", 100) try: appsw = MacOS.EnableAppswitch(0) for i in range(100): bar.set(i) time.sleep(0.1) if i % 10 == 0: bar.label(text[(i/10) % 4]) bar.label("Done.") time.sleep(0.3) finally: del bar... | def test(): Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") if ok > 0: s = AskString("Enter your first name") Message("Thank you,\015%s" % `s`) bar = ProgressBar("Counting...", 100) for i in range(100): bar.set(i) del bar | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py |
test() | try: test() except KeyboardInterrupt: Message("Operation Canceled.") | def test(): Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") if ok > 0: s = AskString("Enter your first name") Message("Thank you,\015%s" % `s`) bar = ProgressBar("Counting...", 100) for i in range(100): bar.set(i) del bar | efc0170fc1e14e215043d1c284970cbbdb41d3f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/efc0170fc1e14e215043d1c284970cbbdb41d3f8/EasyDialogs.py |
if not os.isatty(slave_fd) and sys.platform not in fickle_isatty: | if not os.isatty(slave_fd): | def test_basic_pty(): try: debug("Calling master_open()") master_fd, slave_name = pty.master_open() debug("Got master_fd '%d', slave_name '%s'"%(master_fd, slave_name)) debug("Calling slave_open(%r)"%(slave_name,)) slave_fd = pty.slave_open(slave_name) debug("Got slave_fd '%d'"%slave_fd) except OSError: # " An optional... | 7fbecc6e4f25c49e8e53a0d7007a71cb1ee15ad5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7fbecc6e4f25c49e8e53a0d7007a71cb1ee15ad5/test_pty.py |
if nodelist[3][0] != symbol.except_clause: return self.com_try_finally(nodelist) return self.com_try_except(nodelist) | return self.com_try_except_finally(nodelist) | def try_stmt(self, nodelist): # 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite] # | 'try' ':' suite 'finally' ':' suite if nodelist[3][0] != symbol.except_clause: return self.com_try_finally(nodelist) | 1cac368f5f265c3a934ad65d7da75d350146c773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cac368f5f265c3a934ad65d7da75d350146c773/transformer.py |
def com_try_finally(self, nodelist): return TryFinally(self.com_node(nodelist[2]), self.com_node(nodelist[5]), lineno=nodelist[0][2]) def com_try_except(self, nodelist): | def com_try_except_finally(self, nodelist): if nodelist[3][0] == token.NAME: return TryFinally(self.com_node(nodelist[2]), self.com_node(nodelist[5]), lineno=nodelist[0][2]) | def com_try_finally(self, nodelist): # try_fin_stmt: "try" ":" suite "finally" ":" suite return TryFinally(self.com_node(nodelist[2]), self.com_node(nodelist[5]), lineno=nodelist[0][2]) | 1cac368f5f265c3a934ad65d7da75d350146c773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cac368f5f265c3a934ad65d7da75d350146c773/transformer.py |
stmt = self.com_node(nodelist[2]) | def com_try_except(self, nodelist): # try_except: 'try' ':' suite (except_clause ':' suite)* ['else' suite] #tryexcept: [TryNode, [except_clauses], elseNode)] stmt = self.com_node(nodelist[2]) clauses = [] elseNode = None for i in range(3, len(nodelist), 3): node = nodelist[i] if node[0] == symbol.except_clause: # exc... | 1cac368f5f265c3a934ad65d7da75d350146c773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cac368f5f265c3a934ad65d7da75d350146c773/transformer.py | |
elseNode = self.com_node(nodelist[i+2]) return TryExcept(self.com_node(nodelist[2]), clauses, elseNode, lineno=nodelist[0][2]) | if node[1] == 'else': elseNode = self.com_node(nodelist[i+2]) elif node[1] == 'finally': finallyNode = self.com_node(nodelist[i+2]) try_except = TryExcept(self.com_node(nodelist[2]), clauses, elseNode, lineno=nodelist[0][2]) if finallyNode: return TryFinally(try_except, finallyNode, lineno=nodelist[0][2]) else: return ... | def com_try_except(self, nodelist): # try_except: 'try' ':' suite (except_clause ':' suite)* ['else' suite] #tryexcept: [TryNode, [except_clauses], elseNode)] stmt = self.com_node(nodelist[2]) clauses = [] elseNode = None for i in range(3, len(nodelist), 3): node = nodelist[i] if node[0] == symbol.except_clause: # exc... | 1cac368f5f265c3a934ad65d7da75d350146c773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cac368f5f265c3a934ad65d7da75d350146c773/transformer.py |
prefix = get_config_vars('prefix', 'exec_prefix') | (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix') | def finalize_options (self): | 42af12a673b43b676492fc3828c7b7f73e4af7af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/42af12a673b43b676492fc3828c7b7f73e4af7af/install.py |
def unpack(self, archive, output=None): | def unpack(self, archive, output=None, package=None): | def unpack(self, archive, output=None): return None | b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5/pimp.py |
def unpack(self, archive, output=None): | def unpack(self, archive, output=None, package=None): | def unpack(self, archive, output=None): cmd = self.argument % archive if _cmd(output, self._dir, cmd): return "unpack command failed" | b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8bc1787f4d2ad5bafcd19ae7aee7c0bf279e0f5/pimp.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.