rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
self.imported = "time" | self.imported = imported | def __init__(self, filename_base=TESTFN, imported="time", good_dirname="__testdir__", bad_dirname="__bad"): """Initialize instance variables""" self.filename = filename_base + ".pth" self.base_dir = os.path.abspath('') self.file_path = os.path.join(self.base_dir, self.filename) self.imported = "time" self.good_dirname = good_dirname self.bad_dirname = bad_dirname self.good_dir_path = os.path.join(self.base_dir, self.good_dirname) self.bad_dir_path = os.path.join(self.base_dir, self.bad_dirname) | ee86a66dd87787e54772c93c961fa611311b1502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee86a66dd87787e54772c93c961fa611311b1502/test_site.py |
def cleanup(self): | def cleanup(self, prep=False): | def cleanup(self): """Make sure that the .pth file is deleted, self.imported is not in sys.modules, and that both self.good_dirname and self.bad_dirname are not existing directories.""" try: os.remove(self.file_path) except OSError: pass try: del sys.modules[self.imported] except KeyError: pass try: os.rmdir(self.good_dir_path) except OSError: pass try: os.rmdir(self.bad_dir_path) except OSError: pass | ee86a66dd87787e54772c93c961fa611311b1502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee86a66dd87787e54772c93c961fa611311b1502/test_site.py |
try: | if os.path.exists(self.file_path): | def cleanup(self): """Make sure that the .pth file is deleted, self.imported is not in sys.modules, and that both self.good_dirname and self.bad_dirname are not existing directories.""" try: os.remove(self.file_path) except OSError: pass try: del sys.modules[self.imported] except KeyError: pass try: os.rmdir(self.good_dir_path) except OSError: pass try: os.rmdir(self.bad_dir_path) except OSError: pass | ee86a66dd87787e54772c93c961fa611311b1502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee86a66dd87787e54772c93c961fa611311b1502/test_site.py |
except OSError: pass try: del sys.modules[self.imported] except KeyError: pass try: | if prep: self.imported_module = sys.modules.get(self.imported) if self.imported_module: del sys.modules[self.imported] else: if self.imported_module: sys.modules[self.imported] = self.imported_module if os.path.exists(self.good_dir_path): | def cleanup(self): """Make sure that the .pth file is deleted, self.imported is not in sys.modules, and that both self.good_dirname and self.bad_dirname are not existing directories.""" try: os.remove(self.file_path) except OSError: pass try: del sys.modules[self.imported] except KeyError: pass try: os.rmdir(self.good_dir_path) except OSError: pass try: os.rmdir(self.bad_dir_path) except OSError: pass | ee86a66dd87787e54772c93c961fa611311b1502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee86a66dd87787e54772c93c961fa611311b1502/test_site.py |
except OSError: pass try: | if os.path.exists(self.bad_dir_path): | def cleanup(self): """Make sure that the .pth file is deleted, self.imported is not in sys.modules, and that both self.good_dirname and self.bad_dirname are not existing directories.""" try: os.remove(self.file_path) except OSError: pass try: del sys.modules[self.imported] except KeyError: pass try: os.rmdir(self.good_dir_path) except OSError: pass try: os.rmdir(self.bad_dir_path) except OSError: pass | ee86a66dd87787e54772c93c961fa611311b1502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee86a66dd87787e54772c93c961fa611311b1502/test_site.py |
except OSError: pass def test(self): """Test to make sure that was and was not supposed to be created by using the .pth file occurred""" assert site.makepath(self.good_dir_path)[0] in sys.path assert self.imported in sys.modules assert not os.path.exists(self.bad_dir_path) | def cleanup(self): """Make sure that the .pth file is deleted, self.imported is not in sys.modules, and that both self.good_dirname and self.bad_dirname are not existing directories.""" try: os.remove(self.file_path) except OSError: pass try: del sys.modules[self.imported] except KeyError: pass try: os.rmdir(self.good_dir_path) except OSError: pass try: os.rmdir(self.bad_dir_path) except OSError: pass | ee86a66dd87787e54772c93c961fa611311b1502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee86a66dd87787e54772c93c961fa611311b1502/test_site.py |
|
[("MyInBuffer", 'inDataPtr', "InMode")]) | [("MyInBuffer", 'inDataPtr', "InMode")]), ([("Boolean", 'ioWasInRgn', "OutMode")], [("Boolean", 'ioWasInRgn', "InOutMode")]), | def makerepairinstructions(self): return [ ([("UInt32", 'inSize', "InMode"), ("void_ptr", 'inDataPtr', "InMode")], [("MyInBuffer", 'inDataPtr', "InMode")]) ] | 4b367359b554b4e111d789f90a65a069e990745b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b367359b554b4e111d789f90a65a069e990745b/CarbonEvtscan.py |
def makerepairinstructions(self): return [ ([("UInt32", 'inSize', "InMode"), ("void_ptr", 'inDataPtr', "InMode")], [("MyInBuffer", 'inDataPtr', "InMode")]) ] | 4b367359b554b4e111d789f90a65a069e990745b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b367359b554b4e111d789f90a65a069e990745b/CarbonEvtscan.py |
||
filename = "<console | filename = "<pyshell | def runsource(self, source): # Extend base class to stuff the source in the line cache filename = "<console#%d>" % self.gid self.gid = self.gid + 1 lines = string.split(source, "\n") linecache.cache[filename] = len(source)+1, 0, lines, filename self.more = 0 return InteractiveInterpreter.runsource(self, source, filename) | cc0ade8cd51d8b02885217d3109d4d470eb9702a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc0ade8cd51d8b02885217d3109d4d470eb9702a/PyShell.py |
def write(self, s): # Override base class write self.tkconsole.console.write(s) | cc0ade8cd51d8b02885217d3109d4d470eb9702a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc0ade8cd51d8b02885217d3109d4d470eb9702a/PyShell.py |
||
m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each) | m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?',each) | def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ self.esmtp_features = {} self.putcmd("ehlo", name or self.local_hostname) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MTA's will disconnect on an ehlo. Toss an exception if # that happens -ddm if code == -1 and len(msg) == 0: self.close() raise SMTPServerDisconnected("Server not connected") self.ehlo_resp=msg if code != 250: return (code,msg) self.does_esmtp=1 #parse the ehlo response -ddm resp=self.ehlo_resp.split('\n') del resp[0] for each in resp: m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each) if m: feature=m.group("feature").lower() params=m.string[m.end("feature"):].strip() self.esmtp_features[feature]=params return (code,msg) | be22ae6def4ff3bfb826a96c1e5b1360b5a7c1e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/be22ae6def4ff3bfb826a96c1e5b1360b5a7c1e0/smtplib.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) | 07c57d4e60083981a3ddcd8ca56b85dbc62c4dbb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/07c57d4e60083981a3ddcd8ca56b85dbc62c4dbb/calendar.py |
try: fp = open(file) except: return None | fp = open(file) | def __init__(self, file=None): if not file: file = os.path.join(os.environ['HOME'], ".netrc") try: fp = open(file) except: return None self.hosts = {} self.macros = {} lexer = shlex.shlex(fp) | 5e70cfe22fb4df86c6a3af887148ee6b96d59bc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5e70cfe22fb4df86c6a3af887148ee6b96d59bc9/netrc.py |
s.save_views() | def run(app, s): try: app.start() except KeyboardInterrupt: pass # save the option database s.save_views() | 877d299292063ce07c5ecc3e897216731bdf4e5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/877d299292063ce07c5ecc3e897216731bdf4e5a/Main.py |
|
run() | app, sb = build(initialcolor=initialcolor, initfile=initfile, ignore=ignore) run(app, sb) sb.save_views() | def main(): try: opts, args = getopt.getopt( sys.argv[1:], 'hd:i:X', ['database=', 'initfile=', 'ignore', 'help']) except getopt.error, msg: usage(1, msg) if len(args) == 0: initialcolor = None elif len(args) == 1: initialcolor = args[0] else: usage(1) ignore = 0 initfile = os.path.expanduser('~/.pynche') for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-d', '--database'): RGB_TXT.insert(0, arg) elif opt in ('-X', '--ignore'): ignore = 1 elif opt in ('-i', '--initfile'): initfile = arg run() | 877d299292063ce07c5ecc3e897216731bdf4e5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/877d299292063ce07c5ecc3e897216731bdf4e5a/Main.py |
ifp = open(args) | ifp = open(args[0]) | def main(): global DEBUG # opts, args = getopt.getopt(sys.argv[1:], "D", ["debug"]) for opt, arg in opts: if opt in ("-D", "--debug"): DEBUG = DEBUG + 1 if len(args) == 0: ifp = sys.stdin ofp = sys.stdout elif len(args) == 1: ifp = open(args) ofp = sys.stdout elif len(args) == 2: ifp = open(args[0]) ofp = open(args[1], "w") else: usage() sys.exit(2) table = load_table(open(os.path.join(sys.path[0], 'conversion.xml'))) convert(ifp, ofp, table) | d15a0a05d3161930928355e0b89091994bc54ee5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d15a0a05d3161930928355e0b89091994bc54ee5/latex2esis.py |
suffixes_map). | suffix_map). | def guess_type(url): """Guess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no encoding or the name of the program used to encode (e.g. compress or gzip). The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitive, then case insensitive. The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped to ".tar.gz". (This is table-driven too, using the dictionary suffixes_map). """ if not inited: init() base, ext = posixpath.splitext(url) while suffix_map.has_key(ext): base, ext = posixpath.splitext(base + suffix_map[ext]) if encodings_map.has_key(ext): encoding = encodings_map[ext] base, ext = posixpath.splitext(base) else: encoding = None if types_map.has_key(ext): return types_map[ext], encoding elif types_map.has_key(string.lower(ext)): return types_map[string.lower(ext)], encoding else: return None, encoding | 3130b7a2a97dbb322342b248cb9d9fae5b89b8f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3130b7a2a97dbb322342b248cb9d9fae5b89b8f5/mimetypes.py |
return self.readlines().join('') | return ''.join(self.readlines()) | def read(self): # Note: no size argument -- read until EOF only! return self.readlines().join('') | 521c83dd80afa929816ced389d4f92a97815b978 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/521c83dd80afa929816ced389d4f92a97815b978/multifile.py |
write32(self.fileobj, int(time.time())) | write32u(self.fileobj, long(time.time())) | def _write_gzip_header(self): self.fileobj.write('\037\213') # magic header self.fileobj.write('\010') # compression method fname = self.filename[:-3] flags = 0 if fname: flags = FNAME self.fileobj.write(chr(flags)) write32(self.fileobj, int(time.time())) self.fileobj.write('\002') self.fileobj.write('\377') if fname: self.fileobj.write(fname + '\000') | 95bdd0b60466f38166e86b83d27ecff3df0352d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95bdd0b60466f38166e86b83d27ecff3df0352d5/gzip.py |
if crc32 != self.crc: | if crc32%0x100000000L != self.crc%0x100000000L: | 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 = read32(self.fileobj) if crc32 != self.crc: raise ValueError, "CRC check failed" elif isize != self.size: raise ValueError, "Incorrect length of data produced" | 95bdd0b60466f38166e86b83d27ecff3df0352d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95bdd0b60466f38166e86b83d27ecff3df0352d5/gzip.py |
for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): | for base in (HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, HKEY_USERS): | def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" if not _can_read_reg: return [] K = 'Software\\Microsoft\\Devstudio' L = [] for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: p = _RegEnumKey(k,i) if p[0] in '123456789' and p not in L: L.append(p) except _RegError: break i = i + 1 except _RegError: pass L.sort() L.reverse() return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
k = _RegOpenKeyEx(base,K) | k = RegOpenKeyEx(base,K) | def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" if not _can_read_reg: return [] K = 'Software\\Microsoft\\Devstudio' L = [] for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: p = _RegEnumKey(k,i) if p[0] in '123456789' and p not in L: L.append(p) except _RegError: break i = i + 1 except _RegError: pass L.sort() L.reverse() return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
p = _RegEnumKey(k,i) | p = RegEnumKey(k,i) | def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" if not _can_read_reg: return [] K = 'Software\\Microsoft\\Devstudio' L = [] for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: p = _RegEnumKey(k,i) if p[0] in '123456789' and p not in L: L.append(p) except _RegError: break i = i + 1 except _RegError: pass L.sort() L.reverse() return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
except _RegError: | except RegError: | def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" if not _can_read_reg: return [] K = 'Software\\Microsoft\\Devstudio' L = [] for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: p = _RegEnumKey(k,i) if p[0] in '123456789' and p not in L: L.append(p) except _RegError: break i = i + 1 except _RegError: pass L.sort() L.reverse() return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
except _RegError: | except RegError: | def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" if not _can_read_reg: return [] K = 'Software\\Microsoft\\Devstudio' L = [] for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: p = _RegEnumKey(k,i) if p[0] in '123456789' and p not in L: L.append(p) except _RegError: break i = i + 1 except _RegError: pass L.sort() L.reverse() return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): | for base in (HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, HKEY_USERS): | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" if not _can_read_reg: return [] L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Components\\Platforms\\Win32 (%s)\\Directories') % \ (version,platform) for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: (p,v,t) = _RegEnumValue(k,i) if string.upper(p) == path: V = string.split(v,';') for v in V: if v == '' or v in L: continue L.append(v) break i = i + 1 except _RegError: break except _RegError: pass return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
k = _RegOpenKeyEx(base,K) | k = RegOpenKeyEx(base,K) | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" if not _can_read_reg: return [] L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Components\\Platforms\\Win32 (%s)\\Directories') % \ (version,platform) for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: (p,v,t) = _RegEnumValue(k,i) if string.upper(p) == path: V = string.split(v,';') for v in V: if v == '' or v in L: continue L.append(v) break i = i + 1 except _RegError: break except _RegError: pass return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
(p,v,t) = _RegEnumValue(k,i) | (p,v,t) = RegEnumValue(k,i) | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" if not _can_read_reg: return [] L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Components\\Platforms\\Win32 (%s)\\Directories') % \ (version,platform) for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: (p,v,t) = _RegEnumValue(k,i) if string.upper(p) == path: V = string.split(v,';') for v in V: if v == '' or v in L: continue L.append(v) break i = i + 1 except _RegError: break except _RegError: pass return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
except _RegError: | except RegError: | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" if not _can_read_reg: return [] L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Components\\Platforms\\Win32 (%s)\\Directories') % \ (version,platform) for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: (p,v,t) = _RegEnumValue(k,i) if string.upper(p) == path: V = string.split(v,';') for v in V: if v == '' or v in L: continue L.append(v) break i = i + 1 except _RegError: break except _RegError: pass return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
except _RegError: | except RegError: | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" if not _can_read_reg: return [] L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Components\\Platforms\\Win32 (%s)\\Directories') % \ (version,platform) for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: (p,v,t) = _RegEnumValue(k,i) if string.upper(p) == path: V = string.split(v,';') for v in V: if v == '' or v in L: continue L.append(v) break i = i + 1 except _RegError: break except _RegError: pass return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py |
cmd_obj = self.get_command_obj (command) for (key, val) in cmd_options.items(): cmd_obj.set_option (key, val) | opt_dict = self.get_option_dict(command) for (opt, val) in cmd_options.items(): opt_dict[opt] = ("setup script", val) | def __init__ (self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then uses 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null value: 0, None, an empty list or dictionary, etc.) Most importantly, initialize the 'command_obj' attribute to the empty dictionary; this will be filled in with real command objects by 'parse_command_line()'.""" | 0e48cfd2c5735a500d638aed929c3207173a4f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0e48cfd2c5735a500d638aed929c3207173a4f9e/dist.py |
if not self.command_options.has_key(section): self.command_options[section] = {} opts = self.command_options[section] | opt_dict = self.get_option_dict(section) | def parse_config_files (self, filenames=None): | 0e48cfd2c5735a500d638aed929c3207173a4f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0e48cfd2c5735a500d638aed929c3207173a4f9e/dist.py |
opts[opt] = (filename, parser.get(section,opt)) | opt_dict[opt] = (filename, parser.get(section,opt)) | def parse_config_files (self, filenames=None): | 0e48cfd2c5735a500d638aed929c3207173a4f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0e48cfd2c5735a500d638aed929c3207173a4f9e/dist.py |
if not self.command_options.has_key(command): self.command_options[command] = {} cmd_opts = self.command_options[command] | opt_dict = self.get_option_dict(command) | def _parse_command_opts (self, parser, args): | 0e48cfd2c5735a500d638aed929c3207173a4f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0e48cfd2c5735a500d638aed929c3207173a4f9e/dist.py |
cmd_opts[name] = ("command line", value) | opt_dict[name] = ("command line", value) | def _parse_command_opts (self, parser, args): | 0e48cfd2c5735a500d638aed929c3207173a4f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0e48cfd2c5735a500d638aed929c3207173a4f9e/dist.py |
raise DistutilsSetupError, \ "invalid distribution option '%s'" % key | msg = "Unknown distribution option: %s" % repr(key) if warnings is not None: warnings.warn(msg) else: sys.stderr.write(msg + "\n") | def __init__ (self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null value: 0, None, an empty list or dictionary, etc.) Most importantly, initialize the 'command_obj' attribute to the empty dictionary; this will be filled in with real command objects by 'parse_command_line()'. """ | ff4ad9a1cec90b66b65cb5f1b647e41742d7aab1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ff4ad9a1cec90b66b65cb5f1b647e41742d7aab1/dist.py |
self.headers = None return -1, line, self.headers | try: [ver, code] = string.split(line, None, 1) msg = "" except ValueError: self.headers = None return -1, line, self.headers | def getreply(self): """Get a reply from the server. Returns a tuple consisting of: - server response code (e.g. '200' if all goes well) - server response string corresponding to response code - any RFC822 headers in the response from the server | 29c4688659577ffa12698dadef7de47dd784a5f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/29c4688659577ffa12698dadef7de47dd784a5f3/httplib.py |
tcltkdata = [(tcltk.id, "REGISTRY.tcl"), | tcldata = [(tcltk.id, "REGISTRY.tcl"), | # File extensions, associated with the REGISTRY.def component | 7d3755d2c0d6d586308666b1dddf185f0169c320 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7d3755d2c0d6d586308666b1dddf185f0169c320/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 | 7d3755d2c0d6d586308666b1dddf185f0169c320 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7d3755d2c0d6d586308666b1dddf185f0169c320/msi.py |
def unpack(self, archive, output=None): | def unpack(self, archive, output=None, package=None): | def unpack(self, archive, output=None): return None | 5da131b2df84d0b91fbce739eba46ad170188d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5da131b2df84d0b91fbce739eba46ad170188d5e/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" | 5da131b2df84d0b91fbce739eba46ad170188d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5da131b2df84d0b91fbce739eba46ad170188d5e/pimp.py |
def unpack(self, archive, output=None): | def unpack(self, archive, output=None, package=None): | def unpack(self, archive, output=None): tf = tarfile.open(archive, "r") members = tf.getmembers() skip = [] if self._renames: for member in members: for oldprefix, newprefix in self._renames: if oldprefix[:len(self._dir)] == self._dir: oldprefix2 = oldprefix[len(self._dir):] else: oldprefix2 = None if member.name[:len(oldprefix)] == oldprefix: if newprefix is None: skip.append(member) #print 'SKIP', member.name else: member.name = newprefix + member.name[len(oldprefix):] print ' ', member.name break elif oldprefix2 and member.name[:len(oldprefix2)] == oldprefix2: if newprefix is None: skip.append(member) #print 'SKIP', member.name else: member.name = newprefix + member.name[len(oldprefix2):] #print ' ', member.name break else: skip.append(member) #print '????', member.name for member in members: if member in skip: continue tf.extract(member, self._dir) if skip: names = [member.name for member in skip if member.name[-1] != '/'] if names: return "Not all files were unpacked: %s" % " ".join(names) | 5da131b2df84d0b91fbce739eba46ad170188d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5da131b2df84d0b91fbce739eba46ad170188d5e/pimp.py |
def unpack(self, archive, output=None): tf = tarfile.open(archive, "r") members = tf.getmembers() skip = [] if self._renames: for member in members: for oldprefix, newprefix in self._renames: if oldprefix[:len(self._dir)] == self._dir: oldprefix2 = oldprefix[len(self._dir):] else: oldprefix2 = None if member.name[:len(oldprefix)] == oldprefix: if newprefix is None: skip.append(member) #print 'SKIP', member.name else: member.name = newprefix + member.name[len(oldprefix):] print ' ', member.name break elif oldprefix2 and member.name[:len(oldprefix2)] == oldprefix2: if newprefix is None: skip.append(member) #print 'SKIP', member.name else: member.name = newprefix + member.name[len(oldprefix2):] #print ' ', member.name break else: skip.append(member) #print '????', member.name for member in members: if member in skip: continue tf.extract(member, self._dir) if skip: names = [member.name for member in skip if member.name[-1] != '/'] if names: return "Not all files were unpacked: %s" % " ".join(names) | 5da131b2df84d0b91fbce739eba46ad170188d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5da131b2df84d0b91fbce739eba46ad170188d5e/pimp.py |
||
"MD5Sum" | "MD5Sum", "User-install-skips", "Systemwide-only", | def find(self, ident): """Find a package. The package can be specified by name or as a dictionary with name, version and flavor entries. Only name is obligatory. If there are multiple matches the best one (higher version number, flavors ordered according to users' preference) is returned.""" if type(ident) == str: # Remove ( and ) for pseudo-packages if ident[0] == '(' and ident[-1] == ')': ident = ident[1:-1] # Split into name-version-flavor fields = ident.split('-') if len(fields) < 1 or len(fields) > 3: return None name = fields[0] if len(fields) > 1: version = fields[1] else: version = None if len(fields) > 2: flavor = fields[2] else: flavor = None else: name = ident['Name'] version = ident.get('Version') flavor = ident.get('Flavor') found = None for p in self._packages: if name == p.name() and \ (not version or version == p.version()) and \ (not flavor or flavor == p.flavor()): if not found or found < p: found = p return found | 5da131b2df84d0b91fbce739eba46ad170188d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5da131b2df84d0b91fbce739eba46ad170188d5e/pimp.py |
rv = unpacker.unpack(self.archiveFilename, output=output) | rv = unpacker.unpack(self.archiveFilename, output=output, package=self) | def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Install-command'): return "%s: Binary package cannot have Install-command" % self.fullname() if self._dict.has_key('Pre-install-command'): if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) self.beforeInstall() | 5da131b2df84d0b91fbce739eba46ad170188d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5da131b2df84d0b91fbce739eba46ad170188d5e/pimp.py |
xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)), | xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)), | def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data. | a5453c48d56317c9abfd141461fd16f01274f45d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a5453c48d56317c9abfd141461fd16f01274f45d/SimpleXMLRPCServer.py |
'faultString' : "%s:%s" % (sys.exc_type, sys.exc_value)} | 'faultString' : "%s:%s" % (exc_type, exc_value)} | def system_multicall(self, call_list): """system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => \ | a5453c48d56317c9abfd141461fd16f01274f45d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a5453c48d56317c9abfd141461fd16f01274f45d/SimpleXMLRPCServer.py |
'BuildRoot: %{_tmppath}/%{name}-buildroot', | 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot', | def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + self.distribution.get_description(), ] | cf525241bb14c29f747e5fa3045a57bc80a74557 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cf525241bb14c29f747e5fa3045a57bc80a74557/bdist_rpm.py |
def test_it(self): def tr(frame, event, arg): | def trace(self, frame, event, arg): """A trace function that raises an exception in response to a specific trace event.""" if event == self.raiseOnEvent: | def test_it(self): def tr(frame, event, arg): raise ValueError # just something that isn't RuntimeError def f(): return 1 try: for i in xrange(sys.getrecursionlimit() + 1): sys.settrace(tr) try: f() except ValueError: pass else: self.fail("exception not thrown!") except RuntimeError: self.fail("recursion counter not reset") | 006c75265fe815fefadd119d6c7f322b1105c9bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/006c75265fe815fefadd119d6c7f322b1105c9bb/test_trace.py |
def f(): | else: return self.trace def f(self): """The function to trace; raises an exception if that's the case we're testing, so that the 'exception' trace event fires.""" if self.raiseOnEvent == 'exception': x = 0 y = 1/x else: | def f(): return 1 | 006c75265fe815fefadd119d6c7f322b1105c9bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/006c75265fe815fefadd119d6c7f322b1105c9bb/test_trace.py |
sys.settrace(tr) | sys.settrace(self.trace) | def f(): return 1 | 006c75265fe815fefadd119d6c7f322b1105c9bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/006c75265fe815fefadd119d6c7f322b1105c9bb/test_trace.py |
f() | self.f() | def f(): return 1 | 006c75265fe815fefadd119d6c7f322b1105c9bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/006c75265fe815fefadd119d6c7f322b1105c9bb/test_trace.py |
def test_call(self): self.run_test_for_event('call') def test_line(self): self.run_test_for_event('line') def test_return(self): self.run_test_for_event('return') def test_exception(self): self.run_test_for_event('exception') | def f(): return 1 | 006c75265fe815fefadd119d6c7f322b1105c9bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/006c75265fe815fefadd119d6c7f322b1105c9bb/test_trace.py |
|
self.pack_uint(int(x>>32 & 0xffffffff)) self.pack_uint(int(x & 0xffffffff)) | self.pack_uint(x>>32 & 0xffffffffL) self.pack_uint(x & 0xffffffffL) | def pack_uhyper(self, x): | 1d0fe31d7e4d3d7a756678e991c3284202877cda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d0fe31d7e4d3d7a756678e991c3284202877cda/xdrlib.py |
self._bounds = Qd.OffsetRect(self._possize(width, height), pl, pt) | self._bounds = Qd.OffsetRect(_intRect(self._possize(width, height)), pl, pt) | def _calcbounds(self): # calculate absolute bounds relative to the window origin from our # abstract _possize attribute, which is either a 4-tuple or a callable object oldbounds = self._bounds pl, pt, pr, pb = self._parent._bounds if callable(self._possize): # _possize is callable, let it figure it out by itself: it should return # the bounds relative to our parent widget. width = pr - pl height = pb - pt self._bounds = Qd.OffsetRect(self._possize(width, height), pl, pt) else: # _possize must be a 4-tuple. This is where the algorithm by Peter Kriens and # Petr van Blokland kicks in. (*** Parts of this algorithm are applied for # patents by Ericsson, Sweden ***) l, t, r, b = self._possize # depending on the values of l(eft), t(op), r(right) and b(ottom), # they mean different things: if l < -1: # l is less than -1, this mean it measures from the *right* of it's parent l = pr + l else: # l is -1 or greater, this mean it measures from the *left* of it's parent l = pl + l if t < -1: # t is less than -1, this mean it measures from the *bottom* of it's parent t = pb + t else: # t is -1 or greater, this mean it measures from the *top* of it's parent t = pt + t if r > 1: # r is greater than 1, this means r is the *width* of the widget r = l + r else: # r is less than 1, this means it measures from the *right* of it's parent r = pr + r if b > 1: # b is greater than 1, this means b is the *height* of the widget b = t + b else: # b is less than 1, this means it measures from the *bottom* of it's parent b = pb + b self._bounds = (l, t, r, b) if oldbounds and oldbounds <> self._bounds: self.adjust(oldbounds) for w in self._widgets: w._calcbounds() | 8d97b9bd36ad3437c2594deecf8b778e5508b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d97b9bd36ad3437c2594deecf8b778e5508b8c1/Wbase.py |
Qd.PaintRect(rect) | Qd.PaintRect(_intRect(rect)) | def click(self, point, modifiers): # what a mess... orgmouse = point[self._direction] halfgutter = self._gutter / 2 l, t, r, b = self._bounds if self._direction: begin, end = t, b else: begin, end = l, r i = self.findgutter(orgmouse, begin, end) if i is None: return pos = orgpos = begin + (end - begin) * self._gutters[i] # init pos too, for fast click on border, bug done by Petr minpos = self._panesizes[i][0] maxpos = self._panesizes[i+1][1] minpos = begin + (end - begin) * minpos + 64 maxpos = begin + (end - begin) * maxpos - 64 if minpos > orgpos and maxpos < orgpos: return #SetCursor("fist") self.SetPort() if self._direction: rect = l, orgpos - 1, r, orgpos else: rect = orgpos - 1, t, orgpos, b # track mouse --- XXX move to separate method? Qd.PenMode(QuickDraw.srcXor) Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = None while Evt.Button(): pos = orgpos - orgmouse + Evt.GetMouse()[self._direction] pos = max(pos, minpos) pos = min(pos, maxpos) if pos == lastpos: continue Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) if self._direction: rect = l, pos - 1, r, pos else: rect = pos - 1, t, pos, b Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = pos self._parentwindow.wid.GetWindowPort().QDFlushPortBuffer(None) Evt.WaitNextEvent(0, 3) Qd.PaintRect(rect) Qd.PenNormal() SetCursor("watch") newpos = (pos - begin) / float(end - begin) self._gutters[i] = newpos self._panesizes[i] = self._panesizes[i][0], newpos self._panesizes[i+1] = newpos, self._panesizes[i+1][1] self.makepanebounds() self.installbounds() self._calcbounds() | 8d97b9bd36ad3437c2594deecf8b778e5508b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d97b9bd36ad3437c2594deecf8b778e5508b8c1/Wbase.py |
Qd.PaintRect(rect) | Qd.PaintRect(_intRect(rect)) | def click(self, point, modifiers): # what a mess... orgmouse = point[self._direction] halfgutter = self._gutter / 2 l, t, r, b = self._bounds if self._direction: begin, end = t, b else: begin, end = l, r i = self.findgutter(orgmouse, begin, end) if i is None: return pos = orgpos = begin + (end - begin) * self._gutters[i] # init pos too, for fast click on border, bug done by Petr minpos = self._panesizes[i][0] maxpos = self._panesizes[i+1][1] minpos = begin + (end - begin) * minpos + 64 maxpos = begin + (end - begin) * maxpos - 64 if minpos > orgpos and maxpos < orgpos: return #SetCursor("fist") self.SetPort() if self._direction: rect = l, orgpos - 1, r, orgpos else: rect = orgpos - 1, t, orgpos, b # track mouse --- XXX move to separate method? Qd.PenMode(QuickDraw.srcXor) Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = None while Evt.Button(): pos = orgpos - orgmouse + Evt.GetMouse()[self._direction] pos = max(pos, minpos) pos = min(pos, maxpos) if pos == lastpos: continue Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) if self._direction: rect = l, pos - 1, r, pos else: rect = pos - 1, t, pos, b Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = pos self._parentwindow.wid.GetWindowPort().QDFlushPortBuffer(None) Evt.WaitNextEvent(0, 3) Qd.PaintRect(rect) Qd.PenNormal() SetCursor("watch") newpos = (pos - begin) / float(end - begin) self._gutters[i] = newpos self._panesizes[i] = self._panesizes[i][0], newpos self._panesizes[i+1] = newpos, self._panesizes[i+1][1] self.makepanebounds() self.installbounds() self._calcbounds() | 8d97b9bd36ad3437c2594deecf8b778e5508b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d97b9bd36ad3437c2594deecf8b778e5508b8c1/Wbase.py |
Qd.PaintRect(rect) | Qd.PaintRect(_intRect(rect)) | def click(self, point, modifiers): # what a mess... orgmouse = point[self._direction] halfgutter = self._gutter / 2 l, t, r, b = self._bounds if self._direction: begin, end = t, b else: begin, end = l, r i = self.findgutter(orgmouse, begin, end) if i is None: return pos = orgpos = begin + (end - begin) * self._gutters[i] # init pos too, for fast click on border, bug done by Petr minpos = self._panesizes[i][0] maxpos = self._panesizes[i+1][1] minpos = begin + (end - begin) * minpos + 64 maxpos = begin + (end - begin) * maxpos - 64 if minpos > orgpos and maxpos < orgpos: return #SetCursor("fist") self.SetPort() if self._direction: rect = l, orgpos - 1, r, orgpos else: rect = orgpos - 1, t, orgpos, b # track mouse --- XXX move to separate method? Qd.PenMode(QuickDraw.srcXor) Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = None while Evt.Button(): pos = orgpos - orgmouse + Evt.GetMouse()[self._direction] pos = max(pos, minpos) pos = min(pos, maxpos) if pos == lastpos: continue Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) if self._direction: rect = l, pos - 1, r, pos else: rect = pos - 1, t, pos, b Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = pos self._parentwindow.wid.GetWindowPort().QDFlushPortBuffer(None) Evt.WaitNextEvent(0, 3) Qd.PaintRect(rect) Qd.PenNormal() SetCursor("watch") newpos = (pos - begin) / float(end - begin) self._gutters[i] = newpos self._panesizes[i] = self._panesizes[i][0], newpos self._panesizes[i+1] = newpos, self._panesizes[i+1][1] self.makepanebounds() self.installbounds() self._calcbounds() | 8d97b9bd36ad3437c2594deecf8b778e5508b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d97b9bd36ad3437c2594deecf8b778e5508b8c1/Wbase.py |
Qd.PaintRect(rect) | Qd.PaintRect(_intRect(rect)) | def click(self, point, modifiers): # what a mess... orgmouse = point[self._direction] halfgutter = self._gutter / 2 l, t, r, b = self._bounds if self._direction: begin, end = t, b else: begin, end = l, r i = self.findgutter(orgmouse, begin, end) if i is None: return pos = orgpos = begin + (end - begin) * self._gutters[i] # init pos too, for fast click on border, bug done by Petr minpos = self._panesizes[i][0] maxpos = self._panesizes[i+1][1] minpos = begin + (end - begin) * minpos + 64 maxpos = begin + (end - begin) * maxpos - 64 if minpos > orgpos and maxpos < orgpos: return #SetCursor("fist") self.SetPort() if self._direction: rect = l, orgpos - 1, r, orgpos else: rect = orgpos - 1, t, orgpos, b # track mouse --- XXX move to separate method? Qd.PenMode(QuickDraw.srcXor) Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = None while Evt.Button(): pos = orgpos - orgmouse + Evt.GetMouse()[self._direction] pos = max(pos, minpos) pos = min(pos, maxpos) if pos == lastpos: continue Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) if self._direction: rect = l, pos - 1, r, pos else: rect = pos - 1, t, pos, b Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PaintRect(rect) lastpos = pos self._parentwindow.wid.GetWindowPort().QDFlushPortBuffer(None) Evt.WaitNextEvent(0, 3) Qd.PaintRect(rect) Qd.PenNormal() SetCursor("watch") newpos = (pos - begin) / float(end - begin) self._gutters[i] = newpos self._panesizes[i] = self._panesizes[i][0], newpos self._panesizes[i+1] = newpos, self._panesizes[i+1][1] self.makepanebounds() self.installbounds() self._calcbounds() | 8d97b9bd36ad3437c2594deecf8b778e5508b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d97b9bd36ad3437c2594deecf8b778e5508b8c1/Wbase.py |
verify(inc(1) == 2) | verify(inc(1) == 11) | def adder(y): return global_nest_x + y | 251ef9666e44792a71c5f1cb83c5b1f3b110a46f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/251ef9666e44792a71c5f1cb83c5b1f3b110a46f/test_scope.py |
__builtin__.credits = _Printer("credits", "Python development is led by BeOpen PythonLabs (www.pythonlabs.com).") | if sys.platform[:4] == 'java': __builtin__.credits = _Printer( "credits", "Jython is maintained by the Jython developers (www.jython.org).") else: __builtin__.credits = _Printer("credits", """\ Thanks to CWI, CNRI, BeOpen.com, Digital Creations and a cast of thousands for supporting Python development. See www.python.org for more information.""") | def __call__(self): self.__setup() prompt = 'Hit Return for more, or q (and Return) to quit: ' lineno = 0 while 1: try: for i in range(lineno, lineno + self.MAXLINES): print self.__lines[i] except IndexError: break else: lineno += self.MAXLINES key = None while key is None: key = raw_input(prompt) if key not in ('', 'q'): key = None if key == 'q': break | 23f26ce813910aec4bb1c0c80ec10f2909a838d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/23f26ce813910aec4bb1c0c80ec10f2909a838d5/site.py |
def __call__(self): self.__setup() prompt = 'Hit Return for more, or q (and Return) to quit: ' lineno = 0 while 1: try: for i in range(lineno, lineno + self.MAXLINES): print self.__lines[i] except IndexError: break else: lineno += self.MAXLINES key = None while key is None: key = raw_input(prompt) if key not in ('', 'q'): key = None if key == 'q': break | 23f26ce813910aec4bb1c0c80ec10f2909a838d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/23f26ce813910aec4bb1c0c80ec10f2909a838d5/site.py |
||
ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', | ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', 'hexversion', | def default_path(self): return self.rexec.modules['sys'].path | 69dc0c5bf5aff342afb4fa35c44dc726e2cd772f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69dc0c5bf5aff342afb4fa35c44dc726e2cd772f/rexec.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
x/2 | x//2 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
x/2 | x//2 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
x/2 | x//2 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
... >>> print x/0 | ... >>> print x//0 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
... >>> print 'pre-exception output', x/0 | ... >>> print 'pre-exception output', x//0 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
print 'pre-exception output', x/0 | print 'pre-exception output', x//0 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
... >>> 1/0 | ... >>> 1//0 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
1/0 | 1//0 | >>> def f(x): | 1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5bc1c9d7a4a0d0670565bc03dd9354f9fe2fe5/test_doctest.py |
self.storeName(alias or mod) | if alias: self._resolveDots(name) self.storeName(alias) else: self.storeName(mod) | def visitImport(self, node): self.set_lineno(node) for name, alias in node.names: if VERSION > 1: self.emit('LOAD_CONST', None) self.emit('IMPORT_NAME', name) mod = name.split(".")[0] self.storeName(alias or mod) | 896e5164bb8562d0e5daeccd5f9f5f1d03aedeba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/896e5164bb8562d0e5daeccd5f9f5f1d03aedeba/pycodegen.py |
self._parser.ProcessingInstructionHandler = \ self._cont_handler.processingInstruction self._parser.CharacterDataHandler = self._cont_handler.characters | self._reset_cont_handler() | def reset(self): if self._namespaces: self._parser = expat.ParserCreate(None, " ") self._parser.StartElementHandler = self.start_element_ns self._parser.EndElementHandler = self.end_element_ns else: self._parser = expat.ParserCreate() self._parser.StartElementHandler = self.start_element self._parser.EndElementHandler = self.end_element | fb73bb129b2ccbd9644709ac8eeac1d5e7f0a32d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fb73bb129b2ccbd9644709ac8eeac1d5e7f0a32d/expatreader.py |
self._parser.CommentHandler = self._lex_handler_prop.comment self._parser.StartCdataSectionHandler = self._lex_handler_prop.startCDATA self._parser.EndCdataSectionHandler = self._lex_handler_prop.endCDATA | self._reset_lex_handler_prop() | def reset(self): if self._namespaces: self._parser = expat.ParserCreate(None, " ") self._parser.StartElementHandler = self.start_element_ns self._parser.EndElementHandler = self.end_element_ns else: self._parser = expat.ParserCreate() self._parser.StartElementHandler = self.start_element self._parser.EndElementHandler = self.end_element | fb73bb129b2ccbd9644709ac8eeac1d5e7f0a32d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fb73bb129b2ccbd9644709ac8eeac1d5e7f0a32d/expatreader.py |
def _get_tagged_response(self, tag): | 19ce91be92a31f4c24c0c5a88c568ae3b31f8fc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19ce91be92a31f4c24c0c5a88c568ae3b31f8fc6/imaplib.py |
||
_mesg('abort exception ignored: %s' % val) | def _get_tagged_response(self, tag): | 19ce91be92a31f4c24c0c5a88c568ae3b31f8fc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19ce91be92a31f4c24c0c5a88c568ae3b31f8fc6/imaplib.py |
|
for l in text[1:]: lines.append (big_indent + l) | def generate_help (self, header=None): """Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object.""" | 373dbfa723e79d33c97007194f4a674afedd5c96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/373dbfa723e79d33c97007194f4a674afedd5c96/fancy_getopt.py |
|
def test_string_charset(self): eq = self.assertEqual h = Header() h.append('hello', 'iso-8859-1') eq(h, '=?iso-8859-1?q?hello?=') | e99e2f53e7365d82229e7e033e6a9219b6075912 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e99e2f53e7365d82229e7e033e6a9219b6075912/test_email.py |
||
library_dirs=None): | library_dirs=None, build_info=None): | def link_shared_lib (self, objects, output_libname, libraries=None, library_dirs=None): """Link a bunch of stuff together to create a shared library file. Has the same effect as 'link_static_lib()' except that the filename inferred from 'output_libname' will most likely be different, and the type of file generated will almost certainly be different.""" pass | 26e48ea7df9681c7a138388241ae6cb000d215b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26e48ea7df9681c7a138388241ae6cb000d215b0/ccompiler.py |
library_dirs=None): | library_dirs=None, build_info=None): | def link_shared_object (self, objects, output_filename, libraries=None, library_dirs=None): """Link a bunch of stuff together to create a shared object file. Much like 'link_shared_lib()', except the output filename is explicitly supplied as 'output_filename'.""" pass | 26e48ea7df9681c7a138388241ae6cb000d215b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26e48ea7df9681c7a138388241ae6cb000d215b0/ccompiler.py |
def object_filenames (source_filenames): | def object_filenames (self, source_filenames): | def object_filenames (source_filenames): """Return the list of object filenames corresponding to each specified source filename.""" pass | 26e48ea7df9681c7a138388241ae6cb000d215b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26e48ea7df9681c7a138388241ae6cb000d215b0/ccompiler.py |
def shared_object_filename (source_filename): | def shared_object_filename (self, source_filename): | def shared_object_filename (source_filename): """Return the shared object filename corresponding to a specified source filename.""" pass | 26e48ea7df9681c7a138388241ae6cb000d215b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26e48ea7df9681c7a138388241ae6cb000d215b0/ccompiler.py |
def library_filename (libname): | def library_filename (self, libname): | def library_filename (libname): """Return the static library filename corresponding to the specified library name.""" pass | 26e48ea7df9681c7a138388241ae6cb000d215b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26e48ea7df9681c7a138388241ae6cb000d215b0/ccompiler.py |
def shared_library_filename (libname): | def shared_library_filename (self, libname): | def shared_library_filename (libname): """Return the shared library filename corresponding to the specified library name.""" pass | 26e48ea7df9681c7a138388241ae6cb000d215b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26e48ea7df9681c7a138388241ae6cb000d215b0/ccompiler.py |
r = gl.getgdesc(GL.GD_BITS_NORM_SNG_RED) g = gl.getgdesc(GL.GD_BITS_NORM_SNG_GREEN) b = gl.getgdesc(GL.GD_BITS_NORM_SNG_BLUE) if (r, g, b) <> (3, 3, 2): raise Error, 'Sorry, can only grab rgb8 on 8-bit Indigo' | if not is_entry_indigo(): raise Error, 'Sorry, can only grab rgb8 on entry level Indigo' | def grab_rgb8(w, h, pf): if gl.getdisplaymode() <> DMRGB: raise Error, 'Sorry, can only grab rgb8 in single-buf rgbmode' if pf <> 1 and pf <> 0: raise Error, 'Sorry, can only grab rgb8 with packfactor 1' r = gl.getgdesc(GL.GD_BITS_NORM_SNG_RED) g = gl.getgdesc(GL.GD_BITS_NORM_SNG_GREEN) b = gl.getgdesc(GL.GD_BITS_NORM_SNG_BLUE) if (r, g, b) <> (3, 3, 2): raise Error, 'Sorry, can only grab rgb8 on 8-bit Indigo' # XXX Dirty Dirty here. # XXX Set buffer to cmap mode, grab image and set it back. # XXX (Shouldn't be necessary???) gl.cmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 8) data = gl.lrectread(0, 0, w-1, h-1) data = data[:w*h] # BUG FIX for python lrectread gl.RGBmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 32) return data, None | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
def grab_rgb8(w, h, pf): if gl.getdisplaymode() <> DMRGB: raise Error, 'Sorry, can only grab rgb8 in single-buf rgbmode' if pf <> 1 and pf <> 0: raise Error, 'Sorry, can only grab rgb8 with packfactor 1' r = gl.getgdesc(GL.GD_BITS_NORM_SNG_RED) g = gl.getgdesc(GL.GD_BITS_NORM_SNG_GREEN) b = gl.getgdesc(GL.GD_BITS_NORM_SNG_BLUE) if (r, g, b) <> (3, 3, 2): raise Error, 'Sorry, can only grab rgb8 on 8-bit Indigo' # XXX Dirty Dirty here. # XXX Set buffer to cmap mode, grab image and set it back. # XXX (Shouldn't be necessary???) gl.cmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 8) data = gl.lrectread(0, 0, w-1, h-1) data = data[:w*h] # BUG FIX for python lrectread gl.RGBmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 32) return data, None | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
||
def printinfo(self): print 'Format: ', self.format print 'Size: ', self.width, 'x', self.height print 'Pack: ', self.packfactor, '; chrom:', self.chrompack print 'Bits: ', self.c0bits, self.c1bits, self.c2bits print 'Offset: ', self.offset | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
||
self.colormapinited = 1 | def initcolormap(self): if self.format == 'rgb': gl.RGBmode() gl.gconfig() self.colormapinited = 1 gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return gl.cmode() gl.gconfig() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() self.colormapinited = 1 self.clear() if not self.quiet: sys.stderr.write(' Done.\n') | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
|
self.colormapinited = 1 self.clear() | gl.clear() | def initcolormap(self): if self.format == 'rgb': gl.RGBmode() gl.gconfig() self.colormapinited = 1 gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return gl.cmode() gl.gconfig() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() self.colormapinited = 1 self.clear() if not self.quiet: sys.stderr.write(' Done.\n') | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
def initcolormap(self): if self.format == 'rgb': gl.RGBmode() gl.gconfig() self.colormapinited = 1 gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return gl.cmode() gl.gconfig() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() self.colormapinited = 1 self.clear() if not self.quiet: sys.stderr.write(' Done.\n') | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
||
if self.offset == 0: gl.color(0x800) | if gl.getdisplaymode() in (DMRGB, DMRGBDOUBLE): gl.RGBcolor(200, 200, 200) | def clear(self): if not self.colormapinited: raise CallError if self.offset == 0: gl.color(0x800) gl.clear() else: gl.clear() | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
else: | return gl.writemask(0xffffffff) gl.clear() def clearto(self, r, g, b): if not self.colormapinited: raise CallError if gl.getdisplaymode() in (DMRGB, DMRGBDOUBLE): gl.RGBcolor(r, g, b) | def clear(self): if not self.colormapinited: raise CallError if self.offset == 0: gl.color(0x800) gl.clear() else: gl.clear() | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
return index = self.color0[0] self.fixcolor0 = 1 gl.mapcolor(index, r, g, b) gl.writemask(0xffffffff) gl.clear() gl.gflush() | def clear(self): if not self.colormapinited: raise CallError if self.offset == 0: gl.color(0x800) gl.clear() else: gl.clear() | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
|
c0bits, c1bits, c2bits = self.c0bits, self.c1bits, self.c2bits | c0bits = self.c0bits c1bits = self.c1bits c2bits = self.c2bits | def _initcmap(self): convcolor = choose_conversion(self.format) maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE) if maxbits > 11: maxbits = 11 c0bits, c1bits, c2bits = self.c0bits, self.c1bits, self.c2bits if c0bits+c1bits+c2bits > maxbits: if self.fallback and c0bits < maxbits: # Cannot display frames in this mode, use grey self.skipchrom = 1 c1bits = c2bits = 0 convcolor = choose_conversion('grey') else: raise Error, 'Sorry, '+`maxbits`+ \ ' bits max on this machine' maxc0 = 1 << c0bits maxc1 = 1 << c1bits maxc2 = 1 << c2bits if self.offset == 0 and maxbits == 11: offset = 2048 else: offset = self.offset if maxbits <> 11: offset = offset & ((1<<maxbits)-1) # XXX why is this here? # for i in range(512, MAXMAP): # gl.mapcolor(i, 0, 0, 0) # gl.gflush() for c0 in range(maxc0): c0v = c0/float(maxc0-1) for c1 in range(maxc1): if maxc1 == 1: c1v = 0 else: c1v = c1/float(maxc1-1) for c2 in range(maxc2): if maxc2 == 1: c2v = 0 else: c2v = c2/float(maxc2-1) index = offset + c0 + (c1<<c0bits) + \ (c2 << (c0bits+c1bits)) if index < MAXMAP: rv, gv, bv = \ convcolor(c0v, c1v, c2v) r, g, b = int(rv*255.0), \ int(gv*255.0), \ int(bv*255.0) gl.mapcolor(index, r, g, b) gl.gflush() # send the colormap changes to the X server | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
self.color0 = None self.fixcolor0 = 0 | def _initcmap(self): convcolor = choose_conversion(self.format) maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE) if maxbits > 11: maxbits = 11 c0bits, c1bits, c2bits = self.c0bits, self.c1bits, self.c2bits if c0bits+c1bits+c2bits > maxbits: if self.fallback and c0bits < maxbits: # Cannot display frames in this mode, use grey self.skipchrom = 1 c1bits = c2bits = 0 convcolor = choose_conversion('grey') else: raise Error, 'Sorry, '+`maxbits`+ \ ' bits max on this machine' maxc0 = 1 << c0bits maxc1 = 1 << c1bits maxc2 = 1 << c2bits if self.offset == 0 and maxbits == 11: offset = 2048 else: offset = self.offset if maxbits <> 11: offset = offset & ((1<<maxbits)-1) # XXX why is this here? # for i in range(512, MAXMAP): # gl.mapcolor(i, 0, 0, 0) # gl.gflush() for c0 in range(maxc0): c0v = c0/float(maxc0-1) for c1 in range(maxc1): if maxc1 == 1: c1v = 0 else: c1v = c1/float(maxc1-1) for c2 in range(maxc2): if maxc2 == 1: c2v = 0 else: c2v = c2/float(maxc2-1) index = offset + c0 + (c1<<c0bits) + \ (c2 << (c0bits+c1bits)) if index < MAXMAP: rv, gv, bv = \ convcolor(c0v, c1v, c2v) r, g, b = int(rv*255.0), \ int(gv*255.0), \ int(bv*255.0) gl.mapcolor(index, r, g, b) gl.gflush() # send the colormap changes to the X server | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
|
pass | print '[BasicVinFile.warmcache() not implemented]' | def warmcache(self): pass | 4526f379bca5695b2144f1142f6a524d77bb7fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4526f379bca5695b2144f1142f6a524d77bb7fe4/VFile.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.