rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
by 'read_template()', but really don't belong there: specifically, the build tree (typically "build") and the release tree itself (only an issue if we ran "sdist" previously with --keep-tree, or it aborted).
by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-tree, or it aborted) * any RCS or CVS directories
def prune_file_list (self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: specifically, the build tree (typically "build") and the release tree itself (only an issue if we ran "sdist" previously with --keep-tree, or it aborted). """ build = self.get_finalized_command('build') base_dir = self.distribution.get_fullname() self.exclude_pattern (self.files, None, prefix=build.build_base) self.exclude_pattern (self.files, None, prefix=base_dir)
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py
def select_pattern (self, files, pattern, anchor=1, prefix=None):
self.exclude_pattern (self.files, r'/(RCS|CVS)/.*', is_regex=1) def select_pattern (self, files, pattern, anchor=1, prefix=None, is_regex=0):
def prune_file_list (self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: specifically, the build tree (typically "build") and the release tree itself (only an issue if we ran "sdist" previously with --keep-tree, or it aborted). """ build = self.get_finalized_command('build') base_dir = self.distribution.get_fullname() self.exclude_pattern (self.files, None, prefix=build.build_base) self.exclude_pattern (self.files, None, prefix=base_dir)
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py
pattern_re = translate_pattern (pattern, anchor, prefix)
pattern_re = translate_pattern (pattern, anchor, prefix, is_regex)
def select_pattern (self, files, pattern, anchor=1, prefix=None): """Select strings (presumably filenames) from 'files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform-dependent: slash on Unix, colon, slash, and backslash on DOS/Windows, and colon on Mac OS.
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py
def exclude_pattern (self, files, pattern, anchor=1, prefix=None):
def exclude_pattern (self, files, pattern, anchor=1, prefix=None, is_regex=0):
def exclude_pattern (self, files, pattern, anchor=1, prefix=None): """Remove strings (presumably filenames) from 'files' that match 'pattern'. 'pattern', 'anchor', 'and 'prefix' are the same as for 'select_pattern()', above. The list 'files' is modified in place. """ pattern_re = translate_pattern (pattern, anchor, prefix) self.debug_print("exclude_pattern: applying regex r'%s'" % pattern_re.pattern) for i in range (len(files)-1, -1, -1): if pattern_re.search (files[i]): self.debug_print(" removing " + files[i]) del files[i]
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py
'pattern'. 'pattern', 'anchor', 'and 'prefix' are the same as for 'select_pattern()', above. The list 'files' is modified in place. """ pattern_re = translate_pattern (pattern, anchor, prefix)
'pattern'. Other parameters are the same as for 'select_pattern()', above. The list 'files' is modified in place. """ pattern_re = translate_pattern (pattern, anchor, prefix, is_regex)
def exclude_pattern (self, files, pattern, anchor=1, prefix=None): """Remove strings (presumably filenames) from 'files' that match 'pattern'. 'pattern', 'anchor', 'and 'prefix' are the same as for 'select_pattern()', above. The list 'files' is modified in place. """ pattern_re = translate_pattern (pattern, anchor, prefix) self.debug_print("exclude_pattern: applying regex r'%s'" % pattern_re.pattern) for i in range (len(files)-1, -1, -1): if pattern_re.search (files[i]): self.debug_print(" removing " + files[i]) del files[i]
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py
list.append (fullname) if os.path.isdir (fullname) and not os.path.islink(fullname):
stat = os.stat(fullname) mode = stat[ST_MODE] if S_ISREG(mode): list.append (fullname) elif S_ISDIR(mode) and not S_ISLNK(mode):
def findall (dir = os.curdir): """Find all files under 'dir' and return the list of full filenames (relative to 'dir'). """ list = [] stack = [dir] pop = stack.pop push = stack.append while stack: dir = pop() names = os.listdir (dir) for name in names: if dir != os.curdir: # avoid the dreaded "./" syndrome fullname = os.path.join (dir, name) else: fullname = name list.append (fullname) if os.path.isdir (fullname) and not os.path.islink(fullname): push (fullname) return list
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py
if not type: type = 'file'
if not type: type = 'file'
def open(self, fullurl, data=None): fullurl = unwrap(fullurl) if self.tempcache and self.tempcache.has_key(fullurl): filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') return addinfourl(fp, headers, fullurl) type, url = splittype(fullurl) if not type: type = 'file' if self.proxies.has_key(type): proxy = self.proxies[type] type, proxy = splittype(proxy) host, selector = splithost(proxy) url = (host, fullurl) # Signal special case to open_*() name = 'open_' + type if '-' in name: # replace - with _ name = string.join(string.split(name, '-'), '_') if not hasattr(self, name): if data is None: return self.open_unknown(fullurl) else: return self.open_unknown(fullurl, data) try: if data is None: return getattr(self, name)(url) else: return getattr(self, name)(url, data) except socket.error, msg: raise IOError, ('socket error', msg), sys.exc_info()[2]
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
match = _hostprog.match(url)
match = _hostprog.match(url)
def splithost(url): global _hostprog if _hostprog is None: import re _hostprog = re.compile('^//([^/]+)(.*)$') match = _hostprog.match(url) if match: return match.group(1, 2) return None, url
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
match = _userprog.match(host)
match = _userprog.match(host)
def splituser(host): global _userprog if _userprog is None: import re _userprog = re.compile('^([^@]*)@(.*)$') match = _userprog.match(host) if match: return match.group(1, 2) return None, host
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
match = _passwdprog.match(user)
match = _passwdprog.match(user)
def splitpasswd(user): global _passwdprog if _passwdprog is None: import re _passwdprog = re.compile('^([^:]*):(.*)$') match = _passwdprog.match(user) if match: return match.group(1, 2) return user, None
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
match = _portprog.match(host)
match = _portprog.match(host)
def splitport(host): global _portprog if _portprog is None: import re _portprog = re.compile('^(.*):([0-9]+)$') match = _portprog.match(host) if match: return match.group(1, 2) return host, None
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
match = _nportprog.match(host)
match = _nportprog.match(host)
def splitnport(host, defport=-1): global _nportprog if _nportprog is None: import re _nportprog = re.compile('^(.*):(.*)$') match = _nportprog.match(host) if match: host, port = match.group(1, 2) try: if not port: raise string.atoi_error, "no digits" nport = string.atoi(port) except string.atoi_error: nport = None return host, nport return host, defport
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
match = _queryprog.match(url)
match = _queryprog.match(url)
def splitquery(url): global _queryprog if _queryprog is None: import re _queryprog = re.compile('^(.*)\?([^?]*)$') match = _queryprog.match(url) if match: return match.group(1, 2) return url, None
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
match = _tagprog.match(url)
match = _tagprog.match(url)
def splittag(url): global _tagprog if _tagprog is None: import re _tagprog = re.compile('^(.*)#([^#]*)$') match = _tagprog.match(url) if match: return match.group(1, 2) return url, None
a08fabad72af05d7c4f47823793e602447df957f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a08fabad72af05d7c4f47823793e602447df957f/urllib.py
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
sqlite_inc_paths = [ '/usr/include',
sqlite_inc_paths = [ '/usr/include',
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
MIN_SQLITE_VERSION_NUMBER = 3000008 MIN_SQLITE_VERSION = "3.0.8"
MIN_SQLITE_VERSION_NUMBER = (3, 0, 8) MIN_SQLITE_VERSION = ".".join([str(x) for x in 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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
f = open(f).read() m = re.search(r"
incf = open(f).read() m = re.search( r'\s*.*
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
sqlite_version = int(m.group(1)) if sqlite_version >= MIN_SQLITE_VERSION_NUMBER:
sqlite_version = m.group(1) sqlite_version_tuple = tuple([int(x) for x in sqlite_version.split(".")]) if sqlite_version_tuple >= 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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
elif sqlite_version == 3000000: if sqlite_setup_debug: print "found buggy SQLITE_VERSION_NUMBER, checking" m = re.search(r' f) if m: sqlite_version = m.group(1) if sqlite_version >= MIN_SQLITE_VERSION: print "%s/sqlite3.h: version %s"%(d, sqlite_version) sqlite_incdir = d break
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
if sqlite_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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
elif sqlite_setup_debug: print "sqlite: %s had no SQLITE_VERSION"%(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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
sqlite_defines.append(('PYSQLITE_VERSION',
sqlite_defines.append(('PYSQLITE_VERSION',
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
sqlite_defines.append(('PYSQLITE_VERSION',
sqlite_defines.append(('PYSQLITE_VERSION',
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
sqlite_defines.append(('PY_MAJOR_VERSION',
sqlite_defines.append(('PY_MAJOR_VERSION',
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
sqlite_defines.append(('PY_MINOR_VERSION',
sqlite_defines.append(('PY_MINOR_VERSION',
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
include_dirs=["Modules/_sqlite",
include_dirs=["Modules/_sqlite",
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')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
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')
81d40d6f4728d4f023a54217c2e6a4fa23291399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81d40d6f4728d4f023a54217c2e6a4fa23291399/setup.py
try: del sys.modules[modname] except KeyError: pass
def check_all(modname): names = {} try: exec "import %s" % modname in names except ImportError: # silent fail here seems the best route since some modules # may not be available in all environments return verify(hasattr(sys.modules[modname], "__all__"), "%s has no __all__ attribute" % modname) names = {} exec "from %s import *" % modname in names if names.has_key("__builtins__"): del names["__builtins__"] keys = names.keys() keys.sort() all = list(sys.modules[modname].__all__) # in case it's a tuple all.sort() verify(keys==all, "%s != %s" % (keys, all))
76c066b103c23702d328aa9056c65d02abb8a3ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76c066b103c23702d328aa9056c65d02abb8a3ac/test___all__.py
pass
if size > self.extrasize: size = self.extrasize
def read(self, size=None): if self.extrasize <= 0 and self.fileobj is None: return ''
84c6fc9653ec5482fc94a8923812591a0cf14e53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84c6fc9653ec5482fc94a8923812591a0cf14e53/gzip.py
self.extrasize = len(self.extrabuf)
self.extrasize = len(buf) + self.extrasize
def _unread(self, buf): self.extrabuf = buf + self.extrabuf self.extrasize = len(self.extrabuf)
84c6fc9653ec5482fc94a8923812591a0cf14e53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84c6fc9653ec5482fc94a8923812591a0cf14e53/gzip.py
return string.split(buf, '\n')
lines = string.split(buf, '\n') for i in range(len(lines)-1): lines[i] = lines[i] + '\n' if lines and not lines[-1]: del lines[-1] return lines
def readlines(self): buf = self.read() return string.split(buf, '\n')
84c6fc9653ec5482fc94a8923812591a0cf14e53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84c6fc9653ec5482fc94a8923812591a0cf14e53/gzip.py
upp_dispose_handler = NewWENewObjectProc(my_dispose_handler); upp_draw_handler = NewWENewObjectProc(my_draw_handler); upp_click_handler = NewWENewObjectProc(my_click_handler);
upp_dispose_handler = NewWEDisposeObjectProc(my_dispose_handler); upp_draw_handler = NewWEDrawObjectProc(my_draw_handler); upp_click_handler = NewWEClickObjectProc(my_click_handler);
def outputCheckNewArg(self): Output("""if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }""")
25241d99785698072e6952b37da79b7f441c4b9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/25241d99785698072e6952b37da79b7f441c4b9d/wastesupport.py
if ( selector == weNewHandler ) handler = upp_new_handler; else if ( selector == weDisposeHandler ) handler = upp_dispose_handler; else if ( selector == weDrawHandler ) handler = upp_draw_handler; else if ( selector == weClickHandler ) handler = upp_click_handler;
if ( selector == weNewHandler ) handler = (UniversalProcPtr)upp_new_handler; else if ( selector == weDisposeHandler ) handler = (UniversalProcPtr)upp_dispose_handler; else if ( selector == weDrawHandler ) handler = (UniversalProcPtr)upp_draw_handler; else if ( selector == weClickHandler ) handler = (UniversalProcPtr)upp_click_handler;
def outputCheckNewArg(self): Output("""if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }""")
25241d99785698072e6952b37da79b7f441c4b9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/25241d99785698072e6952b37da79b7f441c4b9d/wastesupport.py
for version in ['8.4', '8.3', '8.2', '8.1', '8.0']:
for version in ['8.4', '84', '8.3', '83', '8.2', '82', '8.1', '81', '8.0', '80']:
def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. # Assume we haven't found any of the libraries or include files tcllib = tklib = tcl_includes = tk_includes = None for version in ['8.4', '8.3', '8.2', '8.1', '8.0']: tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version ) tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version ) if tklib and tcllib: # Exit the loop when we've found the Tcl/Tk libraries break
3db5b8cc76d055c6576aaff51722fc4d64d64388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3db5b8cc76d055c6576aaff51722fc4d64d64388/setup.py
libs.append('X11')
if platform != "cygwin": libs.append('X11')
def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. # Assume we haven't found any of the libraries or include files tcllib = tklib = tcl_includes = tk_includes = None for version in ['8.4', '8.3', '8.2', '8.1', '8.0']: tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version ) tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version ) if tklib and tcllib: # Exit the loop when we've found the Tcl/Tk libraries break
3db5b8cc76d055c6576aaff51722fc4d64d64388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3db5b8cc76d055c6576aaff51722fc4d64d64388/setup.py
f = open(filename, 'r')
f = open(filename, 'rb')
def whathdr(filename): """Recognize sound headers""" f = open(filename, 'r') h = f.read(512) for tf in tests: res = tf(h, f) if res: return res return None
3fc958282120dd46744d32a4a01d48bbb1ca0040 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fc958282120dd46744d32a4a01d48bbb1ca0040/sndhdr.py
parts = split(path, '.')
parts = [part for part in split(path, '.') if part]
def locate(path, forceload=0): """Locate an object by name or dotted path, importing as necessary.""" parts = split(path, '.') module, n = None, 0 while n < len(parts): nextmodule = safeimport(join(parts[:n+1], '.'), forceload) if nextmodule: module, n = nextmodule, n + 1 else: break if module: object = module for part in parts[n:]: try: object = getattr(object, part) except AttributeError: return None return object else: import __builtin__ if hasattr(__builtin__, path): return getattr(__builtin__, path)
97dede0202b1e961bdbe19f7181e0e6652988dae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/97dede0202b1e961bdbe19f7181e0e6652988dae/pydoc.py
from pprint import pprint print "config vars:" pprint (self.config_vars)
if DEBUG: from pprint import pprint print "config vars:" pprint (self.config_vars)
def finalize_options (self):
fbb04c448c31a653930039f61cf726ab16d93469 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fbb04c448c31a653930039f61cf726ab16d93469/install.py
def finalize_options (self):
fbb04c448c31a653930039f61cf726ab16d93469 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fbb04c448c31a653930039f61cf726ab16d93469/install.py
from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate (opt_name, longopt_xlate) val = getattr (self, opt_name) print " %s: %s" % (opt_name, val)
if DEBUG: from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate (opt_name, longopt_xlate) val = getattr (self, opt_name) print " %s: %s" % (opt_name, val)
def dump_dirs (self, msg): from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate (opt_name, longopt_xlate) val = getattr (self, opt_name) print " %s: %s" % (opt_name, val)
fbb04c448c31a653930039f61cf726ab16d93469 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fbb04c448c31a653930039f61cf726ab16d93469/install.py
self.add_library ( "python" + sys.version[0] + sys.version[2] )
def __init__ (self, verbose=0, dry_run=0, force=0):
4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d/msvccompiler.py
cc_args = self.compile_options + \
cc_args = compile_options + \
def compile (self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None):
4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d/msvccompiler.py
if debug: pass
def compile (self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None):
4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d/msvccompiler.py
self.shared_library_name(output_libname))
self.shared_library_name(output_libname), output_dir=output_dir, libraries=libraries, library_dirs=library_dirs, debug=debug, extra_preargs=extra_preargs, extra_postargs=extra_postargs)
def link_shared_lib (self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, debug=0, extra_preargs=None, extra_postargs=None):
4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d/msvccompiler.py
ld_args = self.ldflags_shared + lib_opts + \
if debug: ldflags = self.ldflags_shared_debug basename, ext = os.path.splitext (output_filename) output_filename = basename + '_d' + ext else: ldflags = self.ldflags_shared ld_args = ldflags + lib_opts + \
def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, extra_preargs=None, extra_postargs=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'.""" if libraries is None: libraries = [] if library_dirs is None: library_dirs = [] lib_opts = gen_lib_options (self, self.library_dirs + library_dirs, self.libraries + libraries)
4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d/msvccompiler.py
if debug: pass
def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, extra_preargs=None, extra_postargs=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'.""" if libraries is None: libraries = [] if library_dirs is None: library_dirs = [] lib_opts = gen_lib_options (self, self.library_dirs + library_dirs, self.libraries + libraries)
4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ba9b2e3b64c31b488b1454c9ec4c8e0e2d7da9d/msvccompiler.py
self.assert_(len(read) == 1024, "Error performing sendall.") read = filter(lambda x: x == 'f', read) self.assert_(len(read) == 1024, "Error performing sendall.")
msg += read self.assertEqual(msg, 'f' * 2048)
def testSendAll(self): # Testing sendall() with a 2048 byte string over TCP while 1: read = self.cli_conn.recv(1024) if not read: break self.assert_(len(read) == 1024, "Error performing sendall.") read = filter(lambda x: x == 'f', read) self.assert_(len(read) == 1024, "Error performing sendall.")
e531e296fa178a3a8fc8ec708035e5255f327227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e531e296fa178a3a8fc8ec708035e5255f327227/test_socket.py
raise error, "illegal range"
raise error, "bad character range"
def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) while 1: if source.next in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments if this in WHITESPACE: continue if this == "#": while 1: this = source.get() if this in (None, "\n"): break continue if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, ord(this))) elif this == "[": # character set set = []
470ea5ab9493993b0e65842db2aa412ed9807e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470ea5ab9493993b0e65842db2aa412ed9807e37/sre_parse.py
raise error, "illegal range"
raise error, "bad character range"
def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) while 1: if source.next in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments if this in WHITESPACE: continue if this == "#": while 1: this = source.get() if this in (None, "\n"): break continue if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, ord(this))) elif this == "[": # character set set = []
470ea5ab9493993b0e65842db2aa412ed9807e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470ea5ab9493993b0e65842db2aa412ed9807e37/sre_parse.py
if max < min: raise error, "bad repeat interval"
def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) while 1: if source.next in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments if this in WHITESPACE: continue if this == "#": while 1: this = source.get() if this in (None, "\n"): break continue if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, ord(this))) elif this == "[": # character set set = []
470ea5ab9493993b0e65842db2aa412ed9807e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470ea5ab9493993b0e65842db2aa412ed9807e37/sre_parse.py
raise error, "illegal character in group name"
raise error, "bad character in group name"
def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) while 1: if source.next in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments if this in WHITESPACE: continue if this == "#": while 1: this = source.get() if this in (None, "\n"): break continue if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, ord(this))) elif this == "[": # character set set = []
470ea5ab9493993b0e65842db2aa412ed9807e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470ea5ab9493993b0e65842db2aa412ed9807e37/sre_parse.py
raise error, "illegal character in group name"
raise error, "bad character in group name"
def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) while 1: if source.next in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments if this in WHITESPACE: continue if this == "#": while 1: this = source.get() if this in (None, "\n"): break continue if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, ord(this))) elif this == "[": # character set set = []
470ea5ab9493993b0e65842db2aa412ed9807e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470ea5ab9493993b0e65842db2aa412ed9807e37/sre_parse.py
if char is None or char == ")":
if char is None: raise error, "unexpected end of pattern" if char == ")":
def _parse(source, state): # parse a simple pattern subpattern = SubPattern(state) while 1: if source.next in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments if this in WHITESPACE: continue if this == "#": while 1: this = source.get() if this in (None, "\n"): break continue if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, ord(this))) elif this == "[": # character set set = []
470ea5ab9493993b0e65842db2aa412ed9807e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470ea5ab9493993b0e65842db2aa412ed9807e37/sre_parse.py
raise error, "illegal character in group name"
raise error, "bad character in group name"
def parse_template(source, pattern): # parse 're' replacement string into list of literals and # group references s = Tokenizer(source) p = [] a = p.append while 1: this = s.get() if this is None: break # end of replacement string if this and this[0] == "\\": # group if this == "\\g": name = "" if s.match("<"): while 1: char = s.get() if char is None: raise error, "unterminated group name" if char == ">": break name = name + char if not name: raise error, "bad group name" try: index = int(name) except ValueError: if not isname(name): raise error, "illegal character in group name" try: index = pattern.groupindex[name] except KeyError: raise IndexError, "unknown group name" a((MARK, index)) elif len(this) > 1 and this[1] in DIGITS: code = None while 1: group = _group(this, pattern.groups+1) if group: if (s.next not in DIGITS or not _group(this + s.next, pattern.groups+1)): code = MARK, int(group) break elif s.next in OCTDIGITS: this = this + s.get() else: break if not code: this = this[1:] code = LITERAL, int(this[-6:], 8) & 0xff a(code) else: try: a(ESCAPES[this]) except KeyError: for c in this: a((LITERAL, ord(c))) else: a((LITERAL, ord(this))) return p
470ea5ab9493993b0e65842db2aa412ed9807e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/470ea5ab9493993b0e65842db2aa412ed9807e37/sre_parse.py
{'code': code, 'message': message, 'explain': explain})
{'code': code, 'message': _quote_html(message), 'explain': explain})
def send_error(self, code, message=None): """Send and log an error reply.
a2aa1ac42b02e473a00cd1be225c750726869b41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2aa1ac42b02e473a00cd1be225c750726869b41/BaseHTTPServer.py
verify(log == [('getattr', '__setattr__'), ("setattr", "foo", 12),
verify(log == [("setattr", "foo", 12),
def __delattr__(self, name): log.append(("delattr", name)) MT.__delattr__(self, name)
ce129a5e791548dab11c49bb1fe6ec0a1d6bd8b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce129a5e791548dab11c49bb1fe6ec0a1d6bd8b0/test_descr.py
('getattr', '__delattr__'),
def __delattr__(self, name): log.append(("delattr", name)) MT.__delattr__(self, name)
ce129a5e791548dab11c49bb1fe6ec0a1d6bd8b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce129a5e791548dab11c49bb1fe6ec0a1d6bd8b0/test_descr.py
("Visual Studio 2003 needs to be installed before " "building extensions for Python.")
("""Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")
def load_macros(self, version): vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot") try: if version > 7.0: self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") else: self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") except KeyError, exc: # raise DistutilsPlatformError, \ ("Visual Studio 2003 needs to be installed before " "building extensions for Python.")
77621585e48c7f00a8ce3874d2bc3cb317c0f8eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/77621585e48c7f00a8ce3874d2bc3cb317c0f8eb/msvccompiler.py
class Konquerer: """Controller for the KDE File Manager (kfm, or Konquerer).
class Konqueror: """Controller for the KDE File Manager (kfm, or Konqueror).
def open_new(self, url): self._remote("openURL(%s, new-window)" % url)
2d3eb133b7b66408ee7abf182101dbdc3358b8d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d3eb133b7b66408ee7abf182101dbdc3358b8d9/webbrowser.py
for more information on the Konquerer remote-control interface.
for more information on the Konqueror remote-control interface.
def open_new(self, url): self._remote("openURL(%s, new-window)" % url)
2d3eb133b7b66408ee7abf182101dbdc3358b8d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d3eb133b7b66408ee7abf182101dbdc3358b8d9/webbrowser.py
register("kfm", Konquerer)
register("kfm", Konqueror)
def open_new(self, url): self._remote("openURL %s" % url)
2d3eb133b7b66408ee7abf182101dbdc3358b8d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d3eb133b7b66408ee7abf182101dbdc3358b8d9/webbrowser.py
if timeout is None: while not self.__stopped: self.__block.wait() if __debug__: self._note("%s.join(): thread stopped", self) else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else:
try: if timeout is None: while not self.__stopped: self.__block.wait()
def join(self, timeout=None): assert self.__initialized, "Thread.__init__() not called" assert self.__started, "cannot join thread before it is started" assert self is not currentThread(), "cannot join current thread" if __debug__: if not self.__stopped: self._note("%s.join(): waiting until thread stops", self) self.__block.acquire() if timeout is None: while not self.__stopped: self.__block.wait() if __debug__: self._note("%s.join(): thread stopped", self) else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else: if __debug__: self._note("%s.join(): thread stopped", self) self.__block.release()
ad07ff2c77699c49b99140c0e1f36bfcdc9b2e17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad07ff2c77699c49b99140c0e1f36bfcdc9b2e17/threading.py
self.__block.release()
else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else: if __debug__: self._note("%s.join(): thread stopped", self) finally: self.__block.release()
def join(self, timeout=None): assert self.__initialized, "Thread.__init__() not called" assert self.__started, "cannot join thread before it is started" assert self is not currentThread(), "cannot join current thread" if __debug__: if not self.__stopped: self._note("%s.join(): waiting until thread stops", self) self.__block.acquire() if timeout is None: while not self.__stopped: self.__block.wait() if __debug__: self._note("%s.join(): thread stopped", self) else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else: if __debug__: self._note("%s.join(): thread stopped", self) self.__block.release()
ad07ff2c77699c49b99140c0e1f36bfcdc9b2e17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad07ff2c77699c49b99140c0e1f36bfcdc9b2e17/threading.py
srcfinfo = srcfss.GetFInfo() Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1)
if os.path.isdir(src): cr, tp = 'MACS', 'fdrp' else: cr, tp = srcfss.GetCreatorType() Res.FSpCreateResFile(dstfss, cr, tp, -1)
def mkalias(src, dst, relative=None): """Create a finder alias""" srcfss = macfs.FSSpec(src) dstfss = macfs.FSSpec(dst) if relative: relativefss = macfs.FSSpec(relative) # ik mag er geen None in stoppen :-( alias = srcfss.NewAlias(relativefss) else: alias = srcfss.NewAlias() srcfinfo = srcfss.GetFInfo() Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1) h = Res.FSpOpenResFile(dstfss, 3) resource = Res.Resource(alias.data) resource.AddResource('alis', 0, '') Res.CloseResFile(h) dstfinfo = dstfss.GetFInfo() dstfinfo.Flags = dstfinfo.Flags|0x8000 # Alias flag dstfss.SetFInfo(dstfinfo)
a2168eceb0277f767877a0845537f6564f0410a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2168eceb0277f767877a0845537f6564f0410a0/macostools.py
raise SystemError,\ 'module "%s.%s" failed to register' % \ (__name__,modname)
raise CodecRegistryError,\ 'module "%s" (%s) failed to register' % \ (mod.__name__, mod.__file__)
def search_function(encoding): # Cache lookup entry = _cache.get(encoding,_unknown) if entry is not _unknown: return entry # Import the module modname = encoding.replace('-', '_') modname = aliases.aliases.get(modname,modname) try: mod = __import__(modname,globals(),locals(),'*') except ImportError,why: # cache misses _cache[encoding] = None return None # Now ask the module for the registry entry try: entry = tuple(mod.getregentry()) except AttributeError: entry = () if len(entry) != 4: raise SystemError,\ 'module "%s.%s" failed to register' % \ (__name__,modname) for obj in entry: if not callable(obj): raise SystemError,\ 'incompatible codecs in module "%s.%s"' % \ (__name__,modname) # Cache the codec registry entry _cache[encoding] = entry # Register its aliases (without overwriting previously registered # aliases) try: codecaliases = mod.getaliases() except AttributeError: pass else: for alias in codecaliases: if not aliases.aliases.has_key(alias): aliases.aliases[alias] = modname # Return the registry entry return entry
816a1b75b76b9b6cb74c3ea43508e3507491638e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/816a1b75b76b9b6cb74c3ea43508e3507491638e/__init__.py
raise SystemError,\ 'incompatible codecs in module "%s.%s"' % \ (__name__,modname)
raise CodecRegistryError,\ 'incompatible codecs in module "%s" (%s)' % \ (mod.__name__, mod.__file__)
def search_function(encoding): # Cache lookup entry = _cache.get(encoding,_unknown) if entry is not _unknown: return entry # Import the module modname = encoding.replace('-', '_') modname = aliases.aliases.get(modname,modname) try: mod = __import__(modname,globals(),locals(),'*') except ImportError,why: # cache misses _cache[encoding] = None return None # Now ask the module for the registry entry try: entry = tuple(mod.getregentry()) except AttributeError: entry = () if len(entry) != 4: raise SystemError,\ 'module "%s.%s" failed to register' % \ (__name__,modname) for obj in entry: if not callable(obj): raise SystemError,\ 'incompatible codecs in module "%s.%s"' % \ (__name__,modname) # Cache the codec registry entry _cache[encoding] = entry # Register its aliases (without overwriting previously registered # aliases) try: codecaliases = mod.getaliases() except AttributeError: pass else: for alias in codecaliases: if not aliases.aliases.has_key(alias): aliases.aliases[alias] = modname # Return the registry entry return entry
816a1b75b76b9b6cb74c3ea43508e3507491638e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/816a1b75b76b9b6cb74c3ea43508e3507491638e/__init__.py
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_unicode(self): for s in [u"", u"Andr Previn", u"abc", u" "*10000]: new = marshal.loads(marshal.dumps(s)) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) marshal.dump(s, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) os.unlink(test_support.TESTFN)
61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_string(self): for s in ["", "Andr Previn", "abc", " "*10000]: new = marshal.loads(marshal.dumps(s)) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) marshal.dump(s, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) os.unlink(test_support.TESTFN)
61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_buffer(self): for s in ["", "Andr Previn", "abc", " "*10000]: b = buffer(s) new = marshal.loads(marshal.dumps(b)) self.assertEqual(s, new) marshal.dump(b, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(s, new) os.unlink(test_support.TESTFN)
61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_dict(self): new = marshal.loads(marshal.dumps(self.d)) self.assertEqual(self.d, new) marshal.dump(self.d, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(self.d, new) os.unlink(test_support.TESTFN)
61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_list(self): lst = self.d.items() new = marshal.loads(marshal.dumps(lst)) self.assertEqual(lst, new) marshal.dump(lst, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(lst, new) os.unlink(test_support.TESTFN)
61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_tuple(self): t = tuple(self.d.keys()) new = marshal.loads(marshal.dumps(t)) self.assertEqual(t, new) marshal.dump(t, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(t, new) os.unlink(test_support.TESTFN)
61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_sets(self): for constructor in (set, frozenset): t = constructor(self.d.keys()) new = marshal.loads(marshal.dumps(t)) self.assertEqual(t, new) self.assert_(isinstance(new, constructor)) self.assertNotEqual(id(t), id(new)) marshal.dump(t, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(t, new) os.unlink(test_support.TESTFN)
61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py
if type(value) != type([]):
if type(value) not in (type([]), type( () )):
def post_to_server(self, data, auth=None): ''' Post a query to the server, and return a string response. '''
9d57e53e4e2e359aa188850872566768a8c58075 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d57e53e4e2e359aa188850872566768a8c58075/register.py
def testboth(formatstr, *args): testformat(formatstr, *args) if have_unicode: testformat(unicode(formatstr), *args)
549ab8a98d0d5981558660b414b9c0849d644795 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/549ab8a98d0d5981558660b414b9c0849d644795/test_format.py
def testboth(formatstr, *args): testformat(formatstr, *args) if have_unicode: testformat(unicode(formatstr), *args)
549ab8a98d0d5981558660b414b9c0849d644795 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/549ab8a98d0d5981558660b414b9c0849d644795/test_format.py
raise ErrorDuringImport(filename, sys.exc_info())
raise ErrorDuringImport(path, sys.exc_info())
def locate(path): """Locate an object by name (or dotted path), importing as necessary.""" if not path: # special case: imp.find_module('') strangely succeeds return None if type(path) is not types.StringType: return path parts = split(path, '.') n = len(parts) while n > 0: path = join(parts[:n], '.') try: module = freshimport(path) except: # Did the error occur before or after the module was found? (exc, value, tb) = info = sys.exc_info() if sys.modules.has_key(path): # An error occured while executing the imported module. raise ErrorDuringImport(sys.modules[path].__file__, info) elif exc is SyntaxError: # A SyntaxError occurred before we could execute the module. raise ErrorDuringImport(value.filename, info) elif exc is ImportError and \ split(lower(str(value)))[:2] == ['no', 'module']: # The module was not found. n = n - 1 continue else: # Some other error occurred before executing the module. raise ErrorDuringImport(filename, sys.exc_info()) try: x = module for p in parts[n:]: x = getattr(x, p) return x except AttributeError: n = n - 1 continue if hasattr(__builtins__, path): return getattr(__builtins__, path) return None
41763b96039e2270a9b9d01702215e4642343134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/41763b96039e2270a9b9d01702215e4642343134/pydoc.py
if self.disp.format == 'mono': nline = (len(data)*8)/self.vw elif self.disp.format == 'grey2': nline = (len(data)*4)/self.vw elif self.disp.format == 'grey4': nline = (len(data)*2)/self.vw else: nline = len(data)/self.vw if nline*self.vw <> len(data): print 'Incorrect-sized video fragment ignored' return
nline = len(data)/self.linewidth() if nline*self.linewidth() <> len(data): print 'Incorrect-sized video fragment ignored' return
def putnextpacket(self, pos, data): if self.disp.format == 'mono': # Unfortunately size-check is difficult for # packed video nline = (len(data)*8)/self.vw elif self.disp.format == 'grey2': nline = (len(data)*4)/self.vw elif self.disp.format == 'grey4': nline = (len(data)*2)/self.vw else: nline = len(data)/self.vw if nline*self.vw <> len(data): print 'Incorrect-sized video fragment ignored' return oldwid = gl.winget() gl.winset(self.wid) self.disp.showpartframe(data, None, (0, pos, self.vw, nline)) gl.winset(oldwid)
2c49017279b89b9631a1cb6adc8fda72ff9c26c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2c49017279b89b9631a1cb6adc8fda72ff9c26c9/LiveVideoOut.py
attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd]
attempdirs = ['/tmp', '/var/tmp', '/usr/tmp', pwd]
def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0, '\\TEMP') elif os.name == 'mac': import macfs, MACFS try: refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kTemporaryFolderType, 1) dirname = macfs.FSSpec((refnum, dirid, '')).as_pathname() attempdirs.insert(0, dirname) except macfs.error: pass for envname in 'TMPDIR', 'TEMP', 'TMP': if os.environ.has_key(envname): attempdirs.insert(0, os.environ[envname]) testfile = gettempprefix() + 'test' for dir in attempdirs: try: filename = os.path.join(dir, testfile) if os.name == 'posix': try: fd = os.open(filename, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0700) except OSError: pass else: fp = os.fdopen(fd, 'w') fp.write('blat') fp.close() os.unlink(filename) del fp, fd tempdir = dir break else: fp = open(filename, 'w') fp.write('blat') fp.close() os.unlink(filename) tempdir = dir break except IOError: pass if tempdir is None: msg = "Can't find a usable temporary directory amongst " + `attempdirs` raise IOError, msg return tempdir
7dcf84f2f8e55fe21130bcea5d3bf3eb7ccf9df7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7dcf84f2f8e55fe21130bcea5d3bf3eb7ccf9df7/tempfile.py
slave_fd = _slave_open(slave_name)
slave_fd = slave_open(slave_name)
def openpty(): """openpty() -> (master_fd, slave_fd) Open a pty master/slave pair, using os.openpty() if possible.""" try: return os.openpty() except (AttributeError, OSError): pass master_fd, slave_name = _open_terminal() slave_fd = _slave_open(slave_name) return master_fd, slave_fd
0ea1fc8acf33bdbfe578d8ccaba6e030da6bde40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ea1fc8acf33bdbfe578d8ccaba6e030da6bde40/pty.py
text.bind('<<close-window', self.close_event)
text.bind('<<close-window>>', self.close_event)
def __init__(self, flist=None, filename=None, key=None, root=None): if EditorWindow.help_url is None: dochome = os.path.join(sys.prefix, 'Doc', 'index.html') if sys.platform.count('linux'): # look for html docs in a couple of standard places pyver = 'python-docs-' + '%s.%s.%s' % sys.version_info[:3] if os.path.isdir('/var/www/html/python/'): # "python2" rpm dochome = '/var/www/html/python/index.html' else: basepath = '/usr/share/doc/' # standard location dochome = os.path.join(basepath, pyver, 'Doc', 'index.html') elif sys.platform[:3] == 'win': chmfile = os.path.join(sys.prefix, 'Doc', 'Python%d%d.chm' % sys.version_info[:2]) if os.path.isfile(chmfile): dochome = chmfile
3075e16c516e3975b61e4356a6d64def9cc5110e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3075e16c516e3975b61e4356a6d64def9cc5110e/EditorWindow.py
reverse[tuple(keys)] = (k, v)
reverse.setdefault(tuple(keys), []).append((k, v))
def write(self, fp): options = self.__options timestamp = time.ctime(time.time()) # The time stamp in the header doesn't have the same format as that # generated by xgettext... print >> fp, pot_header % {'time': timestamp, 'version': __version__} # Sort the entries. First sort each particular entry's keys, then # sort all the entries by their first item. reverse = {} for k, v in self.__messages.items(): keys = v.keys() keys.sort() reverse[tuple(keys)] = (k, v) rkeys = reverse.keys() rkeys.sort() for rkey in rkeys: k, v = reverse[rkey] # If the entry was gleaned out of a docstring, then add a comment # stating so. This is to aid translators who may wish to skip # translating some unimportant docstrings. if reduce(operator.__add__, v.values()): print >> fp, '#. docstring' # k is the message string, v is a dictionary-set of (filename, # lineno) tuples. We want to sort the entries in v first by file # name and then by line number. v = v.keys() v.sort() if not options.writelocations: pass # location comments are different b/w Solaris and GNU: elif options.locationstyle == options.SOLARIS: for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} print >>fp, _('# File: %(filename)s, line: %(lineno)d') % d elif options.locationstyle == options.GNU: # fit as many locations on one line, as long as the # resulting line length doesn't exceeds 'options.width' locline = '#:' for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} s = _(' %(filename)s:%(lineno)d') % d if len(locline) + len(s) <= options.width: locline = locline + s else: print >> fp, locline locline = "#:" + s if len(locline) > 2: print >> fp, locline # TBD: sorting, normalizing print >> fp, 'msgid', normalize(k) print >> fp, 'msgstr ""\n'
50cf706b5c3238ced48cc849532bf17f6c7c9197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/50cf706b5c3238ced48cc849532bf17f6c7c9197/pygettext.py
k, v = reverse[rkey] if reduce(operator.__add__, v.values()): print >> fp, ' v = v.keys() v.sort() if not options.writelocations: pass elif options.locationstyle == options.SOLARIS: for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} print >>fp, _(' elif options.locationstyle == options.GNU: locline = ' for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} s = _(' %(filename)s:%(lineno)d') % d if len(locline) + len(s) <= options.width: locline = locline + s else:
rentries = reverse[rkey] rentries.sort() for k, v in rentries: if reduce(operator.__add__, v.values()): print >> fp, ' v = v.keys() v.sort() if not options.writelocations: pass elif options.locationstyle == options.SOLARIS: for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} print >>fp, _( ' elif options.locationstyle == options.GNU: locline = ' for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} s = _(' %(filename)s:%(lineno)d') % d if len(locline) + len(s) <= options.width: locline = locline + s else: print >> fp, locline locline = " if len(locline) > 2:
def write(self, fp): options = self.__options timestamp = time.ctime(time.time()) # The time stamp in the header doesn't have the same format as that # generated by xgettext... print >> fp, pot_header % {'time': timestamp, 'version': __version__} # Sort the entries. First sort each particular entry's keys, then # sort all the entries by their first item. reverse = {} for k, v in self.__messages.items(): keys = v.keys() keys.sort() reverse[tuple(keys)] = (k, v) rkeys = reverse.keys() rkeys.sort() for rkey in rkeys: k, v = reverse[rkey] # If the entry was gleaned out of a docstring, then add a comment # stating so. This is to aid translators who may wish to skip # translating some unimportant docstrings. if reduce(operator.__add__, v.values()): print >> fp, '#. docstring' # k is the message string, v is a dictionary-set of (filename, # lineno) tuples. We want to sort the entries in v first by file # name and then by line number. v = v.keys() v.sort() if not options.writelocations: pass # location comments are different b/w Solaris and GNU: elif options.locationstyle == options.SOLARIS: for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} print >>fp, _('# File: %(filename)s, line: %(lineno)d') % d elif options.locationstyle == options.GNU: # fit as many locations on one line, as long as the # resulting line length doesn't exceeds 'options.width' locline = '#:' for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} s = _(' %(filename)s:%(lineno)d') % d if len(locline) + len(s) <= options.width: locline = locline + s else: print >> fp, locline locline = "#:" + s if len(locline) > 2: print >> fp, locline # TBD: sorting, normalizing print >> fp, 'msgid', normalize(k) print >> fp, 'msgstr ""\n'
50cf706b5c3238ced48cc849532bf17f6c7c9197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/50cf706b5c3238ced48cc849532bf17f6c7c9197/pygettext.py
locline = " if len(locline) > 2: print >> fp, locline print >> fp, 'msgid', normalize(k) print >> fp, 'msgstr ""\n'
print >> fp, 'msgid', normalize(k) print >> fp, 'msgstr ""\n'
def write(self, fp): options = self.__options timestamp = time.ctime(time.time()) # The time stamp in the header doesn't have the same format as that # generated by xgettext... print >> fp, pot_header % {'time': timestamp, 'version': __version__} # Sort the entries. First sort each particular entry's keys, then # sort all the entries by their first item. reverse = {} for k, v in self.__messages.items(): keys = v.keys() keys.sort() reverse[tuple(keys)] = (k, v) rkeys = reverse.keys() rkeys.sort() for rkey in rkeys: k, v = reverse[rkey] # If the entry was gleaned out of a docstring, then add a comment # stating so. This is to aid translators who may wish to skip # translating some unimportant docstrings. if reduce(operator.__add__, v.values()): print >> fp, '#. docstring' # k is the message string, v is a dictionary-set of (filename, # lineno) tuples. We want to sort the entries in v first by file # name and then by line number. v = v.keys() v.sort() if not options.writelocations: pass # location comments are different b/w Solaris and GNU: elif options.locationstyle == options.SOLARIS: for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} print >>fp, _('# File: %(filename)s, line: %(lineno)d') % d elif options.locationstyle == options.GNU: # fit as many locations on one line, as long as the # resulting line length doesn't exceeds 'options.width' locline = '#:' for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} s = _(' %(filename)s:%(lineno)d') % d if len(locline) + len(s) <= options.width: locline = locline + s else: print >> fp, locline locline = "#:" + s if len(locline) > 2: print >> fp, locline # TBD: sorting, normalizing print >> fp, 'msgid', normalize(k) print >> fp, 'msgstr ""\n'
50cf706b5c3238ced48cc849532bf17f6c7c9197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/50cf706b5c3238ced48cc849532bf17f6c7c9197/pygettext.py
self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs
self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet()
def RemoveKeybindings(self): "Remove the keybindings before they are changed." # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist) for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: for event, keylist in keydefs.items():
xkeydefs = idleConf.GetExtensionBindings(extensionName) if xkeydefs: for event, keylist in xkeydefs.items():
def RemoveKeybindings(self): "Remove the keybindings before they are changed." # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist) for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
self.Bindings.default_keydefs=idleConf.GetCurrentKeySet()
self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet()
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs)
xkeydefs = idleConf.GetExtensionBindings(extensionName) if xkeydefs: self.apply_bindings(xkeydefs)
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
menuEventDict={}
menuEventDict = {}
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
menuEventDict[menu[0]]={}
menuEventDict[menu[0]] = {}
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1]
menuEventDict[menu[0]][prepstr(item[0])[1]] = item[1]
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator')
menu = self.menudict[menubarItem] end = menu.index(END) + 1 for index in range(0, end): if menu.type(index) == 'command': accel = menu.entrycget(index, 'accelerator')
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
itemName=menu.entrycget(index,'label') event=''
itemName = menu.entrycget(index, 'label') event = ''
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
event=menuEventDict[menubarItem][itemName]
event = menuEventDict[menubarItem][itemName]
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
accel = get_accelerator(keydefs, event) menu.entryconfig(index, accelerator=accel)
def ApplyKeybindings(self): "Update the keybindings after they are changed" # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): keydefs = idleConf.GetExtensionBindings(extensionName) if keydefs: self.apply_bindings(keydefs) #update menu accelerators menuEventDict={} for menu in self.Bindings.menudefs: menuEventDict[menu[0]]={} for item in menu[1]: if item: menuEventDict[menu[0]][prepstr(item[0])[1]]=item[1] for menubarItem in self.menudict.keys(): menu=self.menudict[menubarItem] end=menu.index(END)+1 for index in range(0,end): if menu.type(index)=='command': accel=menu.entrycget(index,'accelerator') if accel: itemName=menu.entrycget(index,'label') event='' if menuEventDict.has_key(menubarItem): if menuEventDict[menubarItem].has_key(itemName): event=menuEventDict[menubarItem][itemName] if event: accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel)
5a67f9b815fdd34617395c6ec5d9a679361b76ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a67f9b815fdd34617395c6ec5d9a679361b76ea/EditorWindow.py
containing the table) showing a side by side, line by line comparision
containing the table) showing a side by side, line by line comparison
def _line_pair_iterator(): """Yields from/to lines of text with a change indication.
55be9eab3874aa93dccdfcf3df4838e25e598cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/55be9eab3874aa93dccdfcf3df4838e25e598cc4/difflib.py
(sys.platform.startswith('linux') and
((sys.platform.startswith('linux') or sys.platform.startswith('gnu')) and
def finalize_options (self): from distutils import sysconfig
fa713e18f6f7b3ef253fbd2c36a8814de1b3f607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa713e18f6f7b3ef253fbd2c36a8814de1b3f607/build_ext.py
self.fail("expected TypeError")
def test_union_update(self): try: self.set |= self.other self.fail("expected TypeError") except TypeError: pass
6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py
try: self.other | self.set self.fail("expected TypeError") except TypeError: pass try: self.set | self.other self.fail("expected TypeError") except TypeError: pass
self.assertRaises(TypeError, lambda: self.set | self.other) self.assertRaises(TypeError, lambda: self.other | self.set)
def test_union(self): try: self.other | self.set self.fail("expected TypeError") except TypeError: pass try: self.set | self.other self.fail("expected TypeError") except TypeError: pass
6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py