rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
url = string.strip(url[1:-1]) if url[:4] == 'URL:': url = string.strip(url[4:])
url = url[1:-1].strip() if url[:4] == 'URL:': url = url[4:].strip()
def unwrap(url): """unwrap('<URL:type://host/path>') --> 'type://host/path'.""" url = string.strip(url) if url[:1] == '<' and url[-1:] == '>': url = string.strip(url[1:-1]) if url[:4] == 'URL:': url = string.strip(url[4:]) return url
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
if not port: raise string.atoi_error, "no digits" nport = string.atoi(port) except string.atoi_error:
if not port: raise ValueError, "no digits" nport = int(port) except ValueError:
def splitnport(host, defport=-1): """Split host and port, returning numeric port. Return given default port if no ':' found; defaults to -1. Return numerical port if a valid number are found after ':'. Return None if ':' but not a valid number.""" global _nportprog if _nportprog is None: import re _nportprog = re.compi...
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
words = string.splitfields(url, ';')
words = url.split(';')
def splitattr(url): """splitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].""" words = string.splitfields(url, ';') return words[0], words[1:]
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
myatoi = string.atoi list = string.split(s, '%')
myatoi = int list = s.split('%')
def unquote(s): """unquote('abc%20def') -> 'abc def'.""" mychr = chr myatoi = string.atoi list = string.split(s, '%') res = [list[0]] myappend = res.append del list[0] for item in list: if item[1:2]: try: myappend(mychr(myatoi(item[:2], 16)) + item[2:]) except: myappend('%' + item) else: myappend('%' + item) return str...
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
return string.join(res, "")
return "".join(res)
def unquote(s): """unquote('abc%20def') -> 'abc def'.""" mychr = chr myatoi = string.atoi list = string.split(s, '%') res = [list[0]] myappend = res.append del list[0] for item in list: if item[1:2]: try: myappend(mychr(myatoi(item[:2], 16)) + item[2:]) except: myappend('%' + item) else: myappend('%' + item) return str...
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
s = string.join(string.split(s, '+'), ' ')
s = ' '.join(s.split('+'))
def unquote_plus(s): """unquote('%7e/abc+def') -> '~/abc def'""" if '+' in s: # replace '+' with ' ' s = string.join(string.split(s, '+'), ' ') return unquote(s)
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
return string.join(res, '')
return ''.join(res)
def _fast_quote(s): global _fast_safe if _fast_safe is None: _fast_safe = {} for c in _fast_safe_test: _fast_safe[c] = c res = list(s) for i in range(len(res)): c = res[i] if not _fast_safe.has_key(c): res[i] = '%%%02x' % ord(c) return string.join(res, '')
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
return string.join(res, '')
return ''.join(res)
def quote(s, safe = '/'): """quote('abc def') -> 'abc%20def' Each part of a URL, e.g. the path info, the query, etc., has a different set of reserved characters that must be quoted. RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax lists the following reserved characters. reserved = ";" | "/" | "?" | ":...
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
l = string.split(s, ' ')
l = s.split(' ')
def quote_plus(s, safe = ''): """Quote the query fragment of a URL; replacing ' ' with '+'""" if ' ' in s: l = string.split(s, ' ') for i in range(len(l)): l[i] = quote(l[i], safe) return string.join(l, '+') else: return quote(s, safe)
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
return string.join(l, '+')
return '+'.join(l)
def quote_plus(s, safe = ''): """Quote the query fragment of a URL; replacing ' ' with '+'""" if ' ' in s: l = string.split(s, ' ') for i in range(len(l)): l[i] = quote(l[i], safe) return string.join(l, '+') else: return quote(s, safe)
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
return string.join(l, '&')
return '&'.join(l)
def urlencode(dict): """Encode a dictionary of form entries into a URL query string.""" l = [] for k, v in dict.items(): k = quote_plus(str(k)) v = quote_plus(str(v)) l.append(k + '=' + v) return string.join(l, '&')
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
name = string.lower(name)
name = name.lower()
def getproxies_environment(): """Return a dictionary of scheme -> proxy server URL mappings. Scan the environment for variables named <scheme>_proxy; this seems to be the standard convention. If you need a different way, you can pass a proxies dictionary to the [Fancy]URLopener constructor. """ proxies = {} for name...
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
print "Block number: %d, Block size: %d, Total size: %d" % (blocknum, blocksize, totalsize)
print "Block number: %d, Block size: %d, Total size: %d" % ( blocknum, blocksize, totalsize)
def reporthook(blocknum, blocksize, totalsize): # Report during remote transfers print "Block number: %d, Block size: %d, Total size: %d" % (blocknum, blocksize, totalsize)
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
print fn, h
print fn
def test(args=[]): if not args: args = [ '/etc/passwd', 'file:/etc/passwd', 'file://localhost/etc/passwd', 'ftp://ftp.python.org/etc/passwd',
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
data = string.translate(data, table, "\r")
data = data.translate(table, "\r")
def test(args=[]): if not args: args = [ '/etc/passwd', 'file:/etc/passwd', 'file://localhost/etc/passwd', 'ftp://ftp.python.org/etc/passwd',
b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py
def build_extensions (self, extensions):
2f1b5bb905c2a8a1462833635e6d912a36eae1a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2f1b5bb905c2a8a1462833635e6d912a36eae1a9/build_ext.py
libraries, library_dirs)
libraries, library_dirs, build_info)
def build_extensions (self, extensions):
2f1b5bb905c2a8a1462833635e6d912a36eae1a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2f1b5bb905c2a8a1462833635e6d912a36eae1a9/build_ext.py
The walk is performed in breadth-first order. This method is a
The walk is performed in depth-first order. This method is a
def walk(self): """Walk over the message tree, yielding each subpart.
2a9e3852eeaa3a4d039e2dcedded011dddb612c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a9e3852eeaa3a4d039e2dcedded011dddb612c0/Message.py
from Carbon import Qd
def close(self): if self.editgroup.editor.changed: import EasyDialogs from Carbon import Qd Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save window "%s" before closing?' % self.title, default=1, no="Don\xd5t save") if save > 0: if self.domenu_save(): return 1 elif save < 0: return 1 self.globals = None W.Window....
2ad9419c8f14652170858cfd42b1638af116ba5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2ad9419c8f14652170858cfd42b1638af116ba5e/PyEdit.py
import Qd; Qd.InitCursor()
Qd.InitCursor()
def _run(self): if self.run_with_interpreter: if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run u...
2ad9419c8f14652170858cfd42b1638af116ba5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2ad9419c8f14652170858cfd42b1638af116ba5e/PyEdit.py
if self._eoln != '\n': import EasyDialogs ok = EasyDialogs.AskYesNoCancel('Warning: "%s" does not have Unix line-endings' % self.title, 1, yes='OK', no='') if not ok: return
def _run(self): if self.run_with_interpreter: if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run u...
2ad9419c8f14652170858cfd42b1638af116ba5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2ad9419c8f14652170858cfd42b1638af116ba5e/PyEdit.py
import Qd; Qd.InitCursor()
Qd.InitCursor()
def _run(self): if self.run_with_interpreter: if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run u...
2ad9419c8f14652170858cfd42b1638af116ba5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2ad9419c8f14652170858cfd42b1638af116ba5e/PyEdit.py
f.fileno = None
def open_data(self, url, data=None): """Use "data" URL.""" # ignore POSTed data # # syntax of data URLs: # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data # mediatype := [ type "/" subtype ] *( ";" parameter ) # data := *urlchar # parameter := attribute "=" value import mimetools try: from cStringIO impo...
1f663574ee154dfc95b883747137040f51ea7ef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f663574ee154dfc95b883747137040f51ea7ef6/urllib.py
if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno
if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno else: self.fileno = lambda: None
def __init__(self, fp): self.fp = fp self.read = self.fp.read self.readline = self.fp.readline if hasattr(self.fp, "readlines"): self.readlines = self.fp.readlines if hasattr(self.fp, "fileno"): self.fileno = self.fp.fileno if hasattr(self.fp, "__iter__"): self.__iter__ = self.fp.__iter__ if hasattr(self.fp, "next"): s...
1f663574ee154dfc95b883747137040f51ea7ef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f663574ee154dfc95b883747137040f51ea7ef6/urllib.py
if (isinstance (filename, str)): new_base = base.decode(TESTFN_ENCODING) file_list = [f.decode(TESTFN_ENCODING) for f in os.listdir(path)] else: new_base = base file_list = os.listdir(path)
if isinstance(base, str): base = base.decode(TESTFN_ENCODING) file_list = os.listdir(path) if file_list and isinstance(file_list[0], str): file_list = [f.decode(TESTFN_ENCODING) for f in file_list]
def _do_single(self, filename): self.failUnless(os.path.exists(filename)) self.failUnless(os.path.isfile(filename)) self.failUnless(os.path.exists(os.path.abspath(filename))) self.failUnless(os.path.isfile(os.path.abspath(filename))) os.chmod(filename, 0777) os.utime(filename, None) os.utime(filename, (time.time(), tim...
3b04ce824dfba83c5b736138b91aea07d0d2d5da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3b04ce824dfba83c5b736138b91aea07d0d2d5da/test_unicode_file.py
new_base = unicodedata.normalize("NFD", new_base)
base = unicodedata.normalize("NFD", base)
def _do_single(self, filename): self.failUnless(os.path.exists(filename)) self.failUnless(os.path.isfile(filename)) self.failUnless(os.path.exists(os.path.abspath(filename))) self.failUnless(os.path.isfile(os.path.abspath(filename))) os.chmod(filename, 0777) os.utime(filename, None) os.utime(filename, (time.time(), tim...
3b04ce824dfba83c5b736138b91aea07d0d2d5da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3b04ce824dfba83c5b736138b91aea07d0d2d5da/test_unicode_file.py
self.failUnless(new_base in file_list)
self.failUnless(base in file_list)
def _do_single(self, filename): self.failUnless(os.path.exists(filename)) self.failUnless(os.path.isfile(filename)) self.failUnless(os.path.exists(os.path.abspath(filename))) self.failUnless(os.path.isfile(os.path.abspath(filename))) os.chmod(filename, 0777) os.utime(filename, None) os.utime(filename, (time.time(), tim...
3b04ce824dfba83c5b736138b91aea07d0d2d5da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3b04ce824dfba83c5b736138b91aea07d0d2d5da/test_unicode_file.py
filename="<testcase>", mode="exec"):
filename="<testcase>", mode="exec", subclass=None):
def _check_error(self, code, errtext, filename="<testcase>", mode="exec"): """Check that compiling code raises SyntaxError with errtext.
777367103c9ab487fb74ce3f3ac8ea2701de328e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/777367103c9ab487fb74ce3f3ac8ea2701de328e/test_syntax.py
test of the exception raised.
test of the exception raised. If subclass is specified it is the expected subclass of SyntaxError (e.g. IndentationError).
def _check_error(self, code, errtext, filename="<testcase>", mode="exec"): """Check that compiling code raises SyntaxError with errtext.
777367103c9ab487fb74ce3f3ac8ea2701de328e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/777367103c9ab487fb74ce3f3ac8ea2701de328e/test_syntax.py
pdir = self.package_dir.get('') if pdir is not None: tail.insert(0, pdir)
def get_package_dir (self, package): """Return the directory, relative to the top of the source distribution, where package 'package' should be found (at least according to the 'package_dir' option, if any)."""
8bbba17d3815a44eefbd0cf33db937a56fe50db5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8bbba17d3815a44eefbd0cf33db937a56fe50db5/build_py.py
if not os.path.isfile (init_py):
if os.path.isfile (init_py): return init_py else:
def check_package (self, package, package_dir):
8bbba17d3815a44eefbd0cf33db937a56fe50db5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8bbba17d3815a44eefbd0cf33db937a56fe50db5/build_py.py
def find_modules (self): # Map package names to tuples of useful info about the package: # (package_dir, checked) # package_dir - the directory where we'll find source files for # this package # checked - true if we have checked that the package directory # is valid (exists, contains __init__.py, ... ?) packages...
8bbba17d3815a44eefbd0cf33db937a56fe50db5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8bbba17d3815a44eefbd0cf33db937a56fe50db5/build_py.py
self.check_package (package, package_dir)
init_py = self.check_package (package, package_dir)
def find_modules (self): # Map package names to tuples of useful info about the package: # (package_dir, checked) # package_dir - the directory where we'll find source files for # this package # checked - true if we have checked that the package directory # is valid (exists, contains __init__.py, ... ?) packages...
8bbba17d3815a44eefbd0cf33db937a56fe50db5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8bbba17d3815a44eefbd0cf33db937a56fe50db5/build_py.py
modules.append ((package, module, module_file))
modules.append ((package, module_base, module_file))
def find_modules (self): # Map package names to tuples of useful info about the package: # (package_dir, checked) # package_dir - the directory where we'll find source files for # this package # checked - true if we have checked that the package directory # is valid (exists, contains __init__.py, ... ?) packages...
8bbba17d3815a44eefbd0cf33db937a56fe50db5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8bbba17d3815a44eefbd0cf33db937a56fe50db5/build_py.py
if len (words) != 2:
if len (words) < 2:
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
"'%s' expects a single <pattern>" %
"'%s' expects <pattern1> <pattern2> ..." %
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
pattern = native_path (words[1])
pattern_list = map(native_path, words[1:])
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
if len (words) != 3:
if len (words) < 3:
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
"'%s' expects <dir> <pattern>" %
"'%s' expects <dir> <pattern1> <pattern2> ..." %
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
(dir, pattern) = map (native_path, words[1:3])
dir = native_path(words[1]) pattern_list = map (native_path, words[2:])
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
print "include", pattern files = select_pattern (all_files, pattern, anchor=1) if not files: template.warn ("no files found matching '%s'" % pattern) else: self.files.extend (files)
print "include", string.join(pattern_list) for pattern in pattern_list: files = select_pattern (all_files, pattern, anchor=1) if not files: template.warn ("no files found matching '%s'" % pattern) else: self.files.extend (files)
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
print "exclude", pattern num = exclude_pattern (self.files, pattern, anchor=1) if num == 0: template.warn \ ("no previously-included files found matching '%s'" % pattern)
print "exclude", string.join(pattern_list) for pattern in pattern_list: num = exclude_pattern (self.files, pattern, anchor=1) if num == 0: template.warn ( "no previously-included files found matching '%s'"% pattern)
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
print "global-include", pattern files = select_pattern (all_files, pattern, anchor=0) if not files: template.warn (("no files found matching '%s' " + "anywhere in distribution") % pattern) else: self.files.extend (files)
print "global-include", string.join(pattern_list) for pattern in pattern_list: files = select_pattern (all_files, pattern, anchor=0) if not files: template.warn (("no files found matching '%s' " + "anywhere in distribution") % pattern) else: self.files.extend (files)
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
print "global-exclude", pattern num = exclude_pattern (self.files, pattern, anchor=0) if num == 0: template.warn \ (("no previously-included files matching '%s' " + "found anywhere in distribution") % pattern)
print "global-exclude", string.join(pattern_list) for pattern in pattern_list: num = exclude_pattern (self.files, pattern, anchor=0) if num == 0: template.warn \ (("no previously-included files matching '%s' " + "found anywhere in distribution") % pattern)
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
print "recursive-include", dir, pattern files = select_pattern (all_files, pattern, prefix=dir) if not files: template.warn (("no files found matching '%s' " + "under directory '%s'") % (pattern, dir)) else: self.files.extend (files)
print "recursive-include", dir, string.join(pattern_list) for pattern in pattern_list: files = select_pattern (all_files, pattern, prefix=dir) if not files: template.warn (("no files found matching '%s' " + "under directory '%s'") % (pattern, dir)) else: self.files.extend (files)
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
print "recursive-exclude", dir, pattern num = exclude_pattern (self.files, pattern, prefix=dir) if num == 0: template.warn \ (("no previously-included files matching '%s' " + "found under directory '%s'") % (pattern, dir))
print "recursive-exclude", dir, string.join(pattern_list) for pattern in pattern_list: num = exclude_pattern (self.files, pattern, prefix=dir) if num == 0: template.warn \ (("no previously-included files matching '%s' " + "found under directory '%s'") % (pattern, dir))
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
9d5afa9894c2dd18acaf81f6ff52a3591772f40d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d5afa9894c2dd18acaf81f6ff52a3591772f40d/sdist.py
_tryorder = os.environ["BROWSER"].split(":")
_tryorder = os.environ["BROWSER"].split(os.pathsep)
def open_new(self, url): self.open(url)
4b402f207416a448197fc5696ae3a1e4e3fbcac1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b402f207416a448197fc5696ae3a1e4e3fbcac1/webbrowser.py
state = ' '
self.state = ' '
def get_token(self): "Get a token from the input stream (or from stack if it's monempty)" if self.pushback: tok = self.pushback[0] self.pushback = self.pushback[1:] if (self.debug >= 1): print "Popping " + tok return tok tok = '' while 1: nextchar = self.instream.read(1); if nextchar == '\n': self.lineno = self.lineno ...
f247d75507ec767df5ed38e9a2264acb123fe493 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f247d75507ec767df5ed38e9a2264acb123fe493/shlex.py
if (self.compiler.find_library_file(lib_dirs, 'z')): exts.append( Extension('zlib', ['zlibmodule.c'], libraries = ['z']) )
zlib_inc = find_file('zlib.h', [], inc_dirs) if zlib_inc is not None: zlib_h = zlib_inc[0] + '/zlib.h' version = '"0.0.0"' version_req = '"1.1.3"' fp = open(zlib_h) while 1: line = fp.readline() if not line: break if line.find(' version = line.split()[2] break if version >= version_req: if (self.compiler.find_library_f...
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' )
e697091c45001a1674434a553d67e15f2c6b13b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e697091c45001a1674434a553d67e15f2c6b13b8/setup.py
res = platform.libc_ver()
from sys import executable import os if os.path.isdir(executable) and os.path.exists(executable+'.exe'): executable = executable + '.exe' res = platform.libc_ver(executable)
def test_libc_ver(self): res = platform.libc_ver()
06853fc15055686ec02fd2671fd37cda0f69209b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/06853fc15055686ec02fd2671fd37cda0f69209b/test_platform.py
data = self.rfile.read(int(self.headers["content-length"]))
max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chunk_size)) size_remaining -= len(L[-1]) data = ''.join(L)
def do_POST(self): """Handles the HTTP POST request.
e63fde72f397385e09000e243e16eda7e01e3242 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e63fde72f397385e09000e243e16eda7e01e3242/SimpleXMLRPCServer.py
self.assertEqual(sys.stdout.getvalue().splitlines(), ['0', '0.5', '0'])
if 1/2 == 0: expected = ['0', '0.5', '0'] else: expected = ['0.5', '0.5', '0.5'] self.assertEqual(sys.stdout.getvalue().splitlines(), expected)
def test_input_and_raw_input(self): self.write_testfile() fp = open(TESTFN, 'r') savestdin = sys.stdin savestdout = sys.stdout # Eats the echo try: sys.stdin = fp sys.stdout = BitBucket() self.assertEqual(input(), 2) self.assertEqual(input('testing\n'), 2) self.assertEqual(raw_input(), 'The quick brown fox jumps over t...
b82cb8dcd513d49dc674f6973c984628c14cf045 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b82cb8dcd513d49dc674f6973c984628c14cf045/test_builtin.py
def run_suite(suite):
def run_suite(suite, testclass=None):
def run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" if verbose: runner = unittest.TextTestRunner(sys.stdout, verbosity=2) else: runner = BasicTestRunner() result = runner.run(suite) if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] e...
266410355f7faa7c98b29a16b9f50c56a9224f4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/266410355f7faa7c98b29a16b9f50c56a9224f4b/test_support.py
raise TestFailed("errors occurred in %s.%s" % (testclass.__module__, testclass.__name__))
if testclass is None: msg = "errors occurred; run in verbose mode for details" else: msg = "errors occurred in %s.%s" \ % (testclass.__module__, testclass.__name__) raise TestFailed(msg)
def run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" if verbose: runner = unittest.TextTestRunner(sys.stdout, verbosity=2) else: runner = BasicTestRunner() result = runner.run(suite) if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] e...
266410355f7faa7c98b29a16b9f50c56a9224f4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/266410355f7faa7c98b29a16b9f50c56a9224f4b/test_support.py
run_suite(unittest.makeSuite(testclass))
run_suite(unittest.makeSuite(testclass), testclass)
def run_unittest(testclass): """Run tests from a unittest.TestCase-derived class.""" run_suite(unittest.makeSuite(testclass))
266410355f7faa7c98b29a16b9f50c56a9224f4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/266410355f7faa7c98b29a16b9f50c56a9224f4b/test_support.py
while 1:
while formlength > 0:
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ...
7564a641e50de5f4aa569e1413269d71701dee5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7564a641e50de5f4aa569e1413269d71701dee5b/aifc.py
try: chunk = Chunk().init(self._file) except EOFError: raise Error, 'COMM chunk and/or SSND chunk missing'
chunk = Chunk().init(self._file)
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ...
7564a641e50de5f4aa569e1413269d71701dee5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7564a641e50de5f4aa569e1413269d71701dee5b/aifc.py
if formlength <= 0: if not self._comm_chunk_read: raise Error, 'COMM chunk missing' break
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ...
7564a641e50de5f4aa569e1413269d71701dee5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7564a641e50de5f4aa569e1413269d71701dee5b/aifc.py
def setmark(self, (id, pos, name)):
def setmark(self, id, pos, name):
def setmark(self, (id, pos, name)): if id <= 0: raise Error, 'marker ID must be > 0' if pos < 0: raise Error, 'marker position must be >= 0' if type(name) != type(''): raise Error, 'marker name must be a string' for i in range(len(self._markers)): if id == self._markers[i][0]: self._markers[i] = id, pos, name return se...
7564a641e50de5f4aa569e1413269d71701dee5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7564a641e50de5f4aa569e1413269d71701dee5b/aifc.py
self._nframes == self._nframeswritten:
self._nframes == self._nframeswritten and \ self._marklength == 0:
def _patchheader(self): curpos = self._file.tell() if self._datawritten & 1: datalength = self._datawritten + 1 self._file.write(chr(0)) else: datalength = self._datawritten if datalength == self._datalength and \ self._nframes == self._nframeswritten: self._file.seek(curpos, 0) return self._file.seek(self._form_length...
7564a641e50de5f4aa569e1413269d71701dee5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7564a641e50de5f4aa569e1413269d71701dee5b/aifc.py
_write_short(len(self._file, markers))
_write_short(self._file, len(self._markers))
def _writemarkers(self): if len(self._markers) == 0: return self._file.write('MARK') length = 2 for marker in self._markers: id, pos, name = marker length = length + len(name) + 1 + 6 if len(name) & 1 == 0: length = length + 1 _write_long(self._file, length) self._marklength = length + 8 _write_short(len(self._file, ma...
7564a641e50de5f4aa569e1413269d71701dee5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7564a641e50de5f4aa569e1413269d71701dee5b/aifc.py
self.compiler.find_library_file(lib_dirs, 'panel')):
self.compiler.find_library_file(lib_dirs, panel_library)):
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')
86070428898b811339b0e4454e10ebf6f6ad4641 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/86070428898b811339b0e4454e10ebf6f6ad4641/setup.py
libraries = ['panel'] + curses_libs) )
libraries = [panel_library] + curses_libs) )
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')
86070428898b811339b0e4454e10ebf6f6ad4641 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/86070428898b811339b0e4454e10ebf6f6ad4641/setup.py
path = unquote(path)
def ftp_open(self, req): host = req.get_host() if not host: raise IOError, ('ftp error', 'no host given') # XXX handle custom username & password try: host = socket.gethostbyname(host) except socket.error, msg: raise URLError(msg) host, port = splitport(host) if port is None: port = ftplib.FTP_PORT path, attrs = splita...
7db04e7c4802022cfb3a1daacab333cd9efd5a78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7db04e7c4802022cfb3a1daacab333cd9efd5a78/urllib2.py
print self.skip, self.stack,
print '!'*self.debugging, 'process:', self.skip, self.stack,
def process(self, accu): if self.debugging > 1: print self.skip, self.stack, if accu: print accu[0][:30], if accu[0][30:] or accu[1:]: print '...', print if self.stack and self.stack[-1] == 'menu': # XXX should be done differently for line in accu: mo = miprog.match(line) if not mo: line = string.strip(line) + '\n' sel...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
if self.stack and self.stack[-1] == 'menu':
if self.inmenu():
def process(self, accu): if self.debugging > 1: print self.skip, self.stack, if accu: print accu[0][:30], if accu[0][30:] or accu[1:]: print '...', print if self.stack and self.stack[-1] == 'menu': # XXX should be done differently for line in accu: mo = miprog.match(line) if not mo: line = string.strip(line) + '\n' sel...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
if self.debugging: print '--> file', `file`
print '!'*self.debugging, '--> file', `file`
def do_include(self, args): file = args file = os.path.join(self.includedir, file) try: fp = open(file, 'r') except IOError, msg: print '*** Can\'t open include file', `file` return if self.debugging: print '--> file', `file` save_done = self.done save_skip = self.skip save_stack = self.stack self.includedepth = self.i...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
if self.debugging: print '<-- file', `file`
print '!'*self.debugging, '<-- file', `file`
def do_include(self, args): file = args file = os.path.join(self.includedir, file) try: fp = open(file, 'r') except IOError, msg: print '*** Can\'t open include file', `file` return if self.debugging: print '--> file', `file` save_done = self.done save_skip = self.skip save_stack = self.stack self.includedepth = self.i...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
print self.skip, self.stack, '@' + cmd, args
print '!'*self.debugging, 'command:', self.skip, self.stack, \ '@' + cmd, args
def command(self, line, mo): a, b = mo.span(1) cmd = line[a:b] args = string.strip(line[b:]) if self.debugging > 1: print self.skip, self.stack, '@' + cmd, args try: func = getattr(self, 'do_' + cmd) except AttributeError: try: func = getattr(self, 'bgn_' + cmd) except AttributeError: # don't complain if we are skippin...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
print self.values
def do_set(self, args): fields = string.splitfields(args, ' ') key = fields[0] if len(fields) == 1: value = 1 else: value = string.joinfields(fields[1:], ' ') self.values[key] = value print self.values
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
print self.stack print self.stackinfo if self.stackinfo[len(self.stack) + 1]: self.skip = self.skip - 1 del self.stackinfo[len(self.stack) + 1]
try: if self.stackinfo[len(self.stack) + 1]: self.skip = self.skip - 1 del self.stackinfo[len(self.stack) + 1] except KeyError: print '*** end_ifset: KeyError :', len(self.stack) + 1
def end_ifset(self): print self.stack print self.stackinfo if self.stackinfo[len(self.stack) + 1]: self.skip = self.skip - 1 del self.stackinfo[len(self.stack) + 1]
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
end_ifclear = end_ifset
def end_ifclear(self): try: if self.stackinfo[len(self.stack) + 1]: self.skip = self.skip - 1 del self.stackinfo[len(self.stack) + 1] except KeyError: print '*** end_ifclear: KeyError :', len(self.stack) + 1
def bgn_ifclear(self, args): if args in self.values.keys() \ and self.values[args] is not None: self.skip = self.skip + 1 self.stackinfo[len(self.stack)] = 1 else: self.stackinfo[len(self.stack)] = 0
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
print args
def do_settitle(self, args): print args self.startsaving() self.expand(args) self.title = self.collectsavings() print self.title
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
print self.title
def do_settitle(self, args): print args self.startsaving() self.expand(args) self.title = self.collectsavings() print self.title
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
if self.debugging: print '--- writing', file
if self.debugging: print '!'*self.debugging, '--- writing', file
def do_node(self, args): self.endnode() self.nodelineno = 0 parts = string.splitfields(args, ',') while len(parts) < 4: parts.append('') for i in range(4): parts[i] = string.strip(parts[i]) self.nodelinks = parts [name, next, prev, up] = parts[:4] file = self.dirname + '/' + makefile(name) if self.filenames.has_key(fil...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
if self.itemarg[0] == '@' and self.itemarg[1:2] and \
if self.itemarg[0] == '@' and self.itemarg[1] and \
def do_item(self, args): if self.itemindex: self.index(self.itemindex, args) if self.itemarg: if self.itemarg[0] == '@' and self.itemarg[1:2] and \ self.itemarg[1] in string.ascii_letters: args = self.itemarg + '{' + args + '}' else: # some other character, e.g. '-' args = self.itemarg + ' ' + args if self.itemnumber <...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
print '--- Generating', self.indextitle[name], 'index'
print '!'*self.debugging, '--- Generating', \ self.indextitle[name], 'index'
def prindex(self, name): iscodeindex = (name not in self.noncodeindices) index = self.whichindex[name] if not index: return if self.debugging: print '--- Generating', self.indextitle[name], 'index' # The node already provides a title index1 = [] junkprog = re.compile('^(@[a-z]+)?{') for key, node in index: sortkey = s...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
if self.debugging > 1: print key, ':', node
if self.debugging > 1: print '!'*self.debugging, key, ':', node
def prindex(self, name): iscodeindex = (name not in self.noncodeindices) index = self.whichindex[name] if not index: return if self.debugging: print '--- Generating', self.indextitle[name], 'index' # The node already provides a title index1 = [] junkprog = re.compile('^(@[a-z]+)?{') for key, node in index: sortkey = s...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
while sys.argv[1:2] == ['-d']:
htmlhelp = '' while sys.argv[1] == ['-d']:
def test(): import sys debugging = 0 print_headers = 0 cont = 0 html3 = 0 while sys.argv[1:2] == ['-d']: debugging = debugging + 1 del sys.argv[1:2] if sys.argv[1] == '-p': print_headers = 1 del sys.argv[1] if sys.argv[1] == '-c': cont = 1 del sys.argv[1] if sys.argv[1] == '-3': html3 = 1 del sys.argv[1] if len(sys.ar...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
del sys.argv[1:2]
del sys.argv[1]
def test(): import sys debugging = 0 print_headers = 0 cont = 0 html3 = 0 while sys.argv[1:2] == ['-d']: debugging = debugging + 1 del sys.argv[1:2] if sys.argv[1] == '-p': print_headers = 1 del sys.argv[1] if sys.argv[1] == '-c': cont = 1 del sys.argv[1] if sys.argv[1] == '-3': html3 = 1 del sys.argv[1] if len(sys.ar...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
print 'usage: texi2html [-d [-d]] [-p] [-c] inputfile outputdirectory'
print 'usage: texi2hh [-d [-d]] [-p] [-c] [-3] [-H htmlhelp]', \ 'inputfile outputdirectory'
def test(): import sys debugging = 0 print_headers = 0 cont = 0 html3 = 0 while sys.argv[1:2] == ['-d']: debugging = debugging + 1 del sys.argv[1:2] if sys.argv[1] == '-p': print_headers = 1 del sys.argv[1] if sys.argv[1] == '-c': cont = 1 del sys.argv[1] if sys.argv[1] == '-3': html3 = 1 del sys.argv[1] if len(sys.ar...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
parser.setdirname(sys.argv[2]) if file == '-': fp = sys.stdin else:
dirname = sys.argv[2] parser.setdirname(dirname)
def test(): import sys debugging = 0 print_headers = 0 cont = 0 html3 = 0 while sys.argv[1:2] == ['-d']: debugging = debugging + 1 del sys.argv[1:2] if sys.argv[1] == '-p': print_headers = 1 del sys.argv[1] if sys.argv[1] == '-c': cont = 1 del sys.argv[1] if sys.argv[1] == '-3': html3 = 1 del sys.argv[1] if len(sys.ar...
ef5864ed718f5261a00bf695aae3b38b624408c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef5864ed718f5261a00bf695aae3b38b624408c2/texi2html.py
except (ImportError, AttributeError): def _set_cloexec(fd): pass
def _set_cloexec(fd): flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0) if flags >= 0: # flags read successfully, modify flags |= _fcntl.FD_CLOEXEC _fcntl.fcntl(fd, _fcntl.F_SETFD, flags)
291f14e3d386714ea937489e1863bed7f818a970 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/291f14e3d386714ea937489e1863bed7f818a970/tempfile.py
def __init__(self): self.data = {} def __repr__(self): return repr(self.data) def __cmp__(self, dict): if type(dict) == type(self.data): return cmp(self.data, dict) else: return cmp(self.data, dict.data) def __len__(self): return len(self.data) def __getitem__(self, key): return self.data[key] def __setitem__(self, key...
def __init__(self): self.data = {} def __repr__(self): return repr(self.data) def __cmp__(self, dict): if type(dict) == type(self.data): return cmp(self.data, dict) else: return cmp(self.data, dict.data) def __len__(self): return len(self.data) def __getitem__(self, key): return self.data[key] def __setitem__(self, key...
def __init__(self): self.data = {}
b94cd96977ac4d3c2c335ff7d72033d818d59d84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b94cd96977ac4d3c2c335ff7d72033d818d59d84/UserDict.py
s.bind('', self.port)
s.bind(('', self.port))
def __init__(self, port=None, connection_hook=None): self.connections = [] self.port = port or self.default_port self.connection_hook = connection_hook
9a580c440c4f064a92bbc537ac3a2df1c0998afc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a580c440c4f064a92bbc537ac3a2df1c0998afc/protocol.py
@bigmemtest(minsize=_2G, memuse=8)
@bigmemtest(minsize=_2G, memuse=9)
def test_repr_large(self, size): return self.basic_test_repr(size)
b5ccd1416e19773f541256480a014a847bfc53f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5ccd1416e19773f541256480a014a847bfc53f9/test_bigmem.py
@bigmemtest(minsize=_2G + 10, memuse=8)
@bigmemtest(minsize=_2G + 10, memuse=9)
def test_index(self, size): l = [1L, 2L, 3L, 4L, 5L] * (size // 5) self.assertEquals(l.index(1), 0) self.assertEquals(l.index(5, size - 5), size - 1) self.assertEquals(l.index(5, size - 5, size), size - 1) self.assertRaises(ValueError, l.index, 1, size - 4, size) self.assertRaises(ValueError, l.index, 6L)
b5ccd1416e19773f541256480a014a847bfc53f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5ccd1416e19773f541256480a014a847bfc53f9/test_bigmem.py
MIN_SQLITE_VERSION = 3002002
MIN_SQLITE_VERSION_NUMBER = 3000008 MIN_SQLITE_VERSION = "3.0.8"
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
07f5b35e190ab9be85143c6e8e1217d96bbf75ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/07f5b35e190ab9be85143c6e8e1217d96bbf75ca/setup.py
if db_setup_debug: print "found %s"%f
if sqlite_setup_debug: print "sqlite: found %s"%f
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
07f5b35e190ab9be85143c6e8e1217d96bbf75ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/07f5b35e190ab9be85143c6e8e1217d96bbf75ca/setup.py
if sqlite_version >= MIN_SQLITE_VERSION:
if sqlite_version >= MIN_SQLITE_VERSION_NUMBER:
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
07f5b35e190ab9be85143c6e8e1217d96bbf75ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/07f5b35e190ab9be85143c6e8e1217d96bbf75ca/setup.py
if db_setup_debug:
if sqlite_setup_debug:
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
07f5b35e190ab9be85143c6e8e1217d96bbf75ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/07f5b35e190ab9be85143c6e8e1217d96bbf75ca/setup.py
self.relative = 0
def initialize_options (self): self.bdist_dir = None self.plat_name = None self.format = None self.keep_temp = 0 self.dist_dir = None self.skip_build = 0
acd5cb2ff075e9ef3d0952806dbe1ef9a2f00882 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/acd5cb2ff075e9ef3d0952806dbe1ef9a2f00882/bdist_dumb.py
self.make_archive(os.path.join(self.dist_dir, archive_basename), self.format, root_dir=self.bdist_dir)
pseudoinstall_root = os.path.join(self.dist_dir, archive_basename) if not self.relative: archive_root = self.bdist_dir else: if (self.distribution.has_ext_modules() and (install.install_base != install.install_platbase)): raise DistutilsPlatformError, \ ("can't make a dumb built distribution where " "base and platbase ...
def run (self):
acd5cb2ff075e9ef3d0952806dbe1ef9a2f00882 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/acd5cb2ff075e9ef3d0952806dbe1ef9a2f00882/bdist_dumb.py
print 'cwd', os.getcwd() print 'fsspec', macfs.FSSpec(fullname) raise
print '*** Copy failed mysteriously, try again' print '*** cwd', os.getcwd() print '*** fsspec', macfs.FSSpec(fullname) try: i = 1 / 0 except: pass macostools.copy(fullname, os.path.join(destprefix, dest), 1)
def rundir(self, path, destprefix, doit): files = os.listdir(path) todo = [] rv = 1 for f in files: if self.exc.match(f): continue fullname = os.path.join(path, f) if os.path.isdir(fullname): todo.append(fullname) else: dest = self.inc.match(fullname) if dest == None: print 'Not yet resolved:', fullname rv = 0 if dest:...
36bcf9b94f8cbec99881f07225f4c682a7fecbe2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36bcf9b94f8cbec99881f07225f4c682a7fecbe2/MkDistr.py
if args and (len(args) == 1) and args[0]:
if args and (len(args) == 1) and args[0] and (type(args[0]) == types.DictType):
def __init__(self, name, level, pathname, lineno, msg, args, exc_info): """ Initialize a logging record with interesting information. """ ct = time.time() self.name = name self.msg = msg # # The following statement allows passing of a dictionary as a sole # argument, so that you can do something like # logging.debug("...
dccd4321a70c05b94b2efff28b416df440262cb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dccd4321a70c05b94b2efff28b416df440262cb8/__init__.py
def translation(domain, localedir=None, languages=None, class_=None):
def translation(domain, localedir=None, languages=None, class_=None, fallback=0):
def translation(domain, localedir=None, languages=None, class_=None): if class_ is None: class_ = GNUTranslations mofile = find(domain, localedir, languages) if mofile is None: raise IOError(ENOENT, 'No translation file found for domain', domain) key = os.path.abspath(mofile) # TBD: do we need to worry about the file p...
1be641987145f88d61e52d5b4714a8cc6c7e6da8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1be641987145f88d61e52d5b4714a8cc6c7e6da8/gettext.py
translation(domain, localedir).install(unicode)
translation(domain, localedir, fallback=1).install(unicode)
def install(domain, localedir=None, unicode=0): translation(domain, localedir).install(unicode)
1be641987145f88d61e52d5b4714a8cc6c7e6da8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1be641987145f88d61e52d5b4714a8cc6c7e6da8/gettext.py
supported_dists=('SuSE','debian','redhat','mandrake')):
supported_dists=('SuSE', 'debian', 'fedora', 'redhat', 'mandrake')):
def dist(distname='',version='',id='', supported_dists=('SuSE','debian','redhat','mandrake')): """ Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in /etc and then reverts to _dist_try_harder() in case no suitable files are found. Returns a tup...
380f417e15dd36e6656a4f65e9c5ccd75134b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/380f417e15dd36e6656a4f65e9c5ccd75134b8c1/platform.py
def __init__(self, host, port = NNTP_PORT):
def __init__(self, host, port = NNTP_PORT, user=None, password=None):
def __init__(self, host, port = NNTP_PORT): self.host = host self.port = port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect(self.host, self.port) self.file = self.sock.makefile('rb') self.debugging = 0 self.welcome = self.getresp()
dd65975ac716a9a3beaa80189ab72ce0f88779e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dd65975ac716a9a3beaa80189ab72ce0f88779e4/nntplib.py
__call__ = run
def __call__(self, *args, **kwds): return self.run(*args, **kwds)
def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return
664347be946f0a217f91259f93962727ba84c287 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/664347be946f0a217f91259f93962727ba84c287/unittest.py