rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def toggle_debugger(self, event=None): if self.executing: tkMessageBox.showerror("Don't debug now", "You can only toggle the debugger when idle", master=self.text) self.set_debugger_indicator() return "break" else: db = self.interp.getdebugger() if db: self.close_debugger() else: self.open_debugger()
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ sys.stdin = sys.__stdin__
sys.stdout = self.save_stdout sys.stderr = self.save_stderr sys.stdin = self.save_stdin
def close(self): # Extend base class method if self.executing: # XXX Need to ask a question here if not tkMessageBox.askokcancel( "Kill?", "The program is still running; do you want to kill it?", default="ok", master=self.text): return "cancel" self.canceled = 1 if self.reading: self.top.quit() return "cancel" reply = ...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
return "Python Shell"
return self.shell_title
def short_title(self): return "Python Shell"
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
opts, args = getopt.getopt(sys.argv[1:], "d")
opts, args = getopt.getopt(sys.argv[1:], "c:deist:")
def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sy...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
if o == "-d":
if o == '-c': cmd = a if o == '-d':
def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sy...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
if args: for filename in sys.argv[1:]:
if edit: for filename in args:
def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sy...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin()
shell = PyShell(flist) interp = shell.interp flist.pyshell = shell if startup: filename = os.environ.get("IDLESTARTUP") or \ os.environ.get("PYTHONSTARTUP") if filename and os.path.isfile(filename): interp.execfile(filename)
def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sy...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
t.open_debugger()
shell.open_debugger() if cmd: interp.execsource(cmd) elif not edit and args and args[0] != "-": interp.execfile(args[0]) shell.begin()
def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sy...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
self.apply() self.cancel()
try: self.apply() finally: self.cancel()
def ok(self, event=None):
aa3bf1b430175396199b7f8f546ad31f71c5592d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa3bf1b430175396199b7f8f546ad31f71c5592d/tkSimpleDialog.py
if debuginfo: self.move_file(debuginfo[0], self.dist_dir)
def run (self):
4262a31ba47d577d67fbc10fb3ec0729a2d14bbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4262a31ba47d577d67fbc10fb3ec0729a2d14bbe/bdist_rpm.py
if platform not in ['cygwin']: exts.append( Extension('resource', ['resource.c']) )
exts.append( Extension('resource', ['resource.c']) )
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' )
7eb7bd426bc260e6250d7b29a0a05fca725c0899 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7eb7bd426bc260e6250d7b29a0a05fca725c0899/setup.py
if short_first: self.format_option_strings = self.format_option_strings_short_first else: self.format_option_strings = self.format_option_strings_long_first
self.short_first = short_first
def __init__ (self, indent_increment, max_help_position, width, short_first): self.indent_increment = indent_increment self.help_position = self.max_help_position = max_help_position self.width = width self.current_indent = 0 self.level = 0 self.help_width = width - max_help_position if short_first: self.format_option_...
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
raise NotImplementedError( "abstract method: use format_option_strings_short_first or " "format_option_strings_long_first instead.") def format_option_strings_short_first (self, option): opts = [] takes_value = option.takes_value() if takes_value:
if option.takes_value():
def format_option_strings (self, option): """Return a comma-separated list of option strings & metavariables.""" raise NotImplementedError( "abstract method: use format_option_strings_short_first or " "format_option_strings_long_first instead.")
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts.append(lopt + "=" + metavar) else: for opt in option._short_opts + option._long_opts: opts.append(opt)
short_opts = [sopt + metavar for sopt in option._short_opts] long_opts = [lopt + "=" + metavar for lopt in option._long_opts] else: short_opts = option._short_opts long_opts = option._long_opts if self.short_first: opts = short_opts + long_opts else: opts = long_opts + short_opts
def format_option_strings_short_first (self, option): opts = [] # list of "-a" or "--foo=FILE" strings takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts....
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
def format_option_strings_long_first (self, option): opts = [] takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for lopt in option._long_opts: opts.append(lopt + "=" + metavar) for sopt in option._short_opts: opts.append(sopt + metavar) else: for opt in option._long_op...
def format_option_strings_short_first (self, option): opts = [] # list of "-a" or "--foo=FILE" strings takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts....
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
self._short_opts = [] self._long_opts = []
def __init__ (self, *opts, **attrs): # Set _short_opts, _long_opts attrs from 'opts' tuple opts = self._check_opt_strings(opts) self._set_opt_strings(opts)
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
raise OptionError("at least one option string must be supplied", self)
raise TypeError("at least one option string must be supplied")
def _check_opt_strings (self, opts): # Filter out None because early versions of Optik had exactly # one short option and one long option, either of which # could be None. opts = filter(None, opts) if not opts: raise OptionError("at least one option string must be supplied", self) return opts
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
self._short_opts = [] self._long_opts = []
def _set_opt_strings (self, opts): self._short_opts = [] self._long_opts = [] for opt in opts: if len(opt) < 2: raise OptionError( "invalid option string %r: " "must be at least two characters long" % opt, self) elif len(opt) == 2: if not (opt[0] == "-" and opt[1] != "-"): raise OptionError( "invalid short option strin...
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
if self._short_opts or self._long_opts: return "/".join(self._short_opts + self._long_opts) else: raise RuntimeError, "short_opts and long_opts both empty!"
return "/".join(self._short_opts + self._long_opts)
def __str__ (self): if self._short_opts or self._long_opts: return "/".join(self._short_opts + self._long_opts) else: raise RuntimeError, "short_opts and long_opts both empty!"
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
setattr(values, dest, 1)
setattr(values, dest, True)
def take_action (self, action, dest, opt, value, values, parser): if action == "store": setattr(values, dest, value) elif action == "store_const": setattr(values, dest, self.const) elif action == "store_true": setattr(values, dest, 1) elif action == "store_false": setattr(values, dest, 0) elif action == "append": value...
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
setattr(values, dest, 0)
setattr(values, dest, False)
def take_action (self, action, dest, opt, value, values, parser): if action == "store": setattr(values, dest, value) elif action == "store_const": setattr(values, dest, self.const) elif action == "store_true": setattr(values, dest, 1) elif action == "store_false": setattr(values, dest, 0) elif action == "append": value...
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
your program (os.path.basename(sys.argv[0])).
your program (self.prog or os.path.basename(sys.argv[0])). prog : string the name of the current program (to override os.path.basename(sys.argv[0])).
def format_help (self, formatter): result = formatter.format_heading(self.title) formatter.indent() result += OptionContainer.format_help(self, formatter) formatter.dedent() return result
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
add_help_option=1):
add_help_option=1, prog=None):
def __init__ (self, usage=None, option_list=None, option_class=Option, version=None, conflict_handler="error", description=None, formatter=None, add_help_option=1): OptionContainer.__init__( self, option_class, conflict_handler, description) self.set_usage(usage) self.version = version self.allow_interspersed_args = 1 ...
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
spawn(("gpg", "--detach-sign", "-a", filename),
gpg_args = ["gpg", "--detach-sign", "-a", filename] if self.identity: gpg_args[2:2] = ["--local-user", self.identity] spawn(gpg_args,
def upload_file(self, command, pyversion, filename): # Sign if requested if self.sign: spawn(("gpg", "--detach-sign", "-a", filename), dry_run=self.dry_run)
49c6a9b35690fefdb1471c848c6c72cb076acd07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49c6a9b35690fefdb1471c848c6c72cb076acd07/upload.py
g['BINLIBDEST']=os.path.join(sys.exec_prefix, "Lib")
g['BINLIBDEST']= os.path.join(sys.exec_prefix, "Lib")
def _init_nt(): """Initialize the module as appropriate for NT""" g=globals() # load config.h, though I don't know how useful this is parse_config_h(open( os.path.join(sys.exec_prefix, "include", "config.h")), g) # set basic install directories g['LIBDEST']=os.path.join(sys.exec_prefix, "Lib") g['BINLIBDEST']=os.path.j...
7b84dfff61ef4008680bd0426a4abacdbd2db041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7b84dfff61ef4008680bd0426a4abacdbd2db041/sysconfig.py
... self.close = self.generator.close
... def __init__(self, name):
82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py
>>> for s in sets: s.close()
... def __str__(self):
82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py
... self.close = g.close
... def __init__(self, g):
82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py
>>> m235.close()
>>> def m235():
82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py
>>> fib.close()
... def tail(g):
82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py
exclude=0, single=0, randomize=0, leakdebug=0,
exclude=0, single=0, randomize=0, findleaks=0,
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py
single, randomize, and leakdebug) allow programmers calling main()
single, randomize, and findleaks) allow programmers calling main()
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py
if o == '-l': leakdebug = 1
if o == '-l': findleaks = 1
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py
if leakdebug:
if findleaks:
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py
gc.set_debug(gc.DEBUG_LEAK)
gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = []
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py
fullname = '.'.join(path)+'.'+name
fullname = string.join(path, '.')+'.'+name
def find_module(self, name, path): if path: fullname = '.'.join(path)+'.'+name else: fullname = name if fullname in self.excludes: self.msgout(3, "find_module -> Excluded", fullname) raise ImportError, name
315b34e57013d60d33b0e132a4708a6b20278951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/315b34e57013d60d33b0e132a4708a6b20278951/modulefinder.py
self.buf = self.buf + string.joinfields(self.buflist, '')
self.buf += EMPTYSTRING.join(self.buflist)
def seek(self, pos, mode = 0): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if mode == 1: pos = pos + self.pos elif mode == 2: pos = pos + self.len self.pos = max(0, pos)
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
pos = pos + self.pos
pos += self.pos
def seek(self, pos, mode = 0): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if mode == 1: pos = pos + self.pos elif mode == 2: pos = pos + self.len self.pos = max(0, pos)
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
pos = pos + self.len
pos += self.len
def seek(self, pos, mode = 0): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if mode == 1: pos = pos + self.pos elif mode == 2: pos = pos + self.len self.pos = max(0, pos)
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
self.buf = self.buf + string.joinfields(self.buflist, '')
self.buf += EMPTYSTRING.join(self.buflist)
def read(self, n = -1): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if n < 0: newpos = self.len else: newpos = min(self.pos+n, self.len) r = self.buf[self.pos:newpos] self.pos = newpos return r
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
self.buf = self.buf + string.joinfields(self.buflist, '')
self.buf += EMPTYSTRING.join(self.buflist)
def readline(self, length=None): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] i = string.find(self.buf, '\n', self.pos) if i < 0: newpos = self.len else: newpos = i+1 if length is not None: if self.pos + len...
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
i = string.find(self.buf, '\n', self.pos)
i = self.buf.find('\n', self.pos)
def readline(self, length=None): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] i = string.find(self.buf, '\n', self.pos) if i < 0: newpos = self.len else: newpos = i+1 if length is not None: if self.pos + len...
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
raise IOError(errno.EINVAL, "Negative size not allowed")
raise IOError(EINVAL, "Negative size not allowed")
def truncate(self, size=None): if self.closed: raise ValueError, "I/O operation on closed file" if size is None: size = self.pos elif size < 0: raise IOError(errno.EINVAL, "Negative size not allowed") elif size < self.pos: self.pos = size self.buf = self.getvalue()[:size]
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
self.buf = self.buf + string.joinfields(self.buflist, '')
self.buf += EMPTYSTRING.join(self.buflist)
def write(self, s): if self.closed: raise ValueError, "I/O operation on closed file" if not s: return if self.pos > self.len: self.buflist.append('\0'*(self.pos - self.len)) self.len = self.pos newpos = self.pos + len(s) if self.pos < self.len: if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') ...
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
self.write(string.joinfields(list, ''))
self.write(EMPTYSTRING.join(list))
def writelines(self, list): self.write(string.joinfields(list, ''))
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
self.buf = self.buf + string.joinfields(self.buflist, '')
self.buf += EMPTYSTRING.join(self.buflist)
def getvalue(self): if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] return self.buf
15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py
print 'Skip', path,'- Up-to-date'
print 'Skip', dstfile,'- Up-to-date'
def hexbincwprojects(creator): """Compact and hexbin all files remembered with a given creator""" print 'Please start project mgr with signature', creator,'-' sys.stdin.readline() try: mgr = MwShell(creator) except 'foo': print 'Not handled:', creator return for fss in project_files[creator]: srcfile = fss.as_pathname(...
b5d44e9549704b0a87dded5104aec25d683258b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b5d44e9549704b0a87dded5104aec25d683258b0/binhextree.py
self.botframe = frame
self.botframe = frame.f_back
def dispatch_call(self, frame, arg): # XXX 'arg' is no longer used if self.botframe is None: # First call of dispatch since reset() self.botframe = frame return self.trace_dispatch if not (self.stop_here(frame) or self.break_anywhere(frame)): # No need to trace this function return # None self.user_call(frame, arg) if ...
b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py
if self.stopframe is None: return True
def stop_here(self, frame): if self.stopframe is None: return True if frame is self.stopframe: return True while frame is not None and frame is not self.stopframe: if frame is self.botframe: return True frame = frame.f_back return False
b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py
try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back
frame = sys._getframe().f_back
def set_trace(self): """Start debugging from here.""" try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back self.reset() while frame: frame.f_trace = self.trace_dispatch self.botframe = frame frame = frame.f_back self.set_step() sys.settrace(self.trace_dispatch)
b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py
try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back
frame = sys._getframe().f_back
def set_continue(self): # Don't stop except at breakpoints or when finished self.stopframe = self.botframe self.returnframe = None self.quitting = 0 if not self.breaks: # no breakpoints; run without debugger overhead sys.settrace(None) try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back while frame a...
b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py
(1, Complex(0,10), 'TypeError'),
(1, Complex(0,10), 1),
def test(): testsuite = { 'a+b': [ (1, 10, 11), (1, Complex(0,10), Complex(1,10)), (Complex(0,10), 1, Complex(1,10)), (Complex(0,10), Complex(1), Complex(1,10)), (Complex(1), Complex(0,10), Complex(1,10)), ], 'a-b': [ (1, 10, -9), (1, Complex(0,10), Complex(1,-10)), (Complex(0,10), 1, Complex(-1,10)), (Complex(0,10), C...
5d63d562e8015e55591da523d87bba373733db00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d63d562e8015e55591da523d87bba373733db00/Complex.py
(Complex(1), Complex(0,10), 'TypeError'),
(Complex(1), Complex(0,10), 1),
def test(): testsuite = { 'a+b': [ (1, 10, 11), (1, Complex(0,10), Complex(1,10)), (Complex(0,10), 1, Complex(1,10)), (Complex(0,10), Complex(1), Complex(1,10)), (Complex(1), Complex(0,10), Complex(1,10)), ], 'a-b': [ (1, 10, -9), (1, Complex(0,10), Complex(1,-10)), (Complex(0,10), 1, Complex(-1,10)), (Complex(0,10), C...
5d63d562e8015e55591da523d87bba373733db00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d63d562e8015e55591da523d87bba373733db00/Complex.py
self.file = self.sock.makefile('r')
self.file = self.sock.makefile('rb')
def open(self, host, port): """Setup connection to remote server on "host:port". This connection will be used by the routines: read, readline, send, shutdown. """ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((self.host, self.port)) self.file = self.sock.makefile('r')
04103a153ea4758e2cbc44bdeb16aa3d06c59e57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/04103a153ea4758e2cbc44bdeb16aa3d06c59e57/imaplib.py
host = user + ':' + passwd + '@' + host
host = quote(user, safe='') + ':' + quote(passwd, safe='') + '@' + host
def retry_http_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = host.find('@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = 'http://' + host + selector if data is None: return sel...
b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d/urllib.py
host = user + ':' + passwd + '@' + host
host = quote(user, safe='') + ':' + quote(passwd, safe='') + '@' + host
def retry_https_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = host.find('@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = '//' + host + selector return self.open_https(newurl)
b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d/urllib.py
return self.open_https(newurl)
return self.open_https(newurl, data)
def retry_https_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = host.find('@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = '//' + host + selector return self.open_https(newurl)
b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d/urllib.py
sf = StringIO('Content-Length: %d\n' % retrlen) headers = mimetools.Message(sf) else: headers = noheaders()
headers += "Content-Length: %d\n" % retrlen sf = StringIO(headers) headers = mimetools.Message(sf)
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...
c7175ef29367585cda7fe83ae56eec1a9bbb3095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7175ef29367585cda7fe83ae56eec1a9bbb3095/urllib2.py
host = 'www.cwi.nl:80' selector = '/index.html'
host = 'www.python.org' selector = '/'
def test(): import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.cwi.nl:80' selector = '/index.html' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) ...
13f1e4ccda2702676721f1befbb119e8994986c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/13f1e4ccda2702676721f1befbb119e8994986c5/httplib.py
print 'headers =', headers
def test(): import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.cwi.nl:80' selector = '/index.html' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) ...
13f1e4ccda2702676721f1befbb119e8994986c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/13f1e4ccda2702676721f1befbb119e8994986c5/httplib.py
if not os.path.isfile(makefile):
if not os.path.isfile(makefile) or os.path.getsize(makefile)==0:
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py
run_configure(configure, do_script)
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py
print "Executing nmake over the ssl makefiles..."
makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile) print "Executing ssl makefiles:", makeCommand
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py
rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile))
rc = os.system(makeCommand)
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py
if not uthread2:
if uthread2:
def execstring(pytext, globals, locals, filename="<string>", debugging=0, modname="__main__", profiling=0): if debugging: import PyDebugger, bdb BdbQuit = bdb.BdbQuit else: BdbQuit = 'BdbQuitDummyException' pytext = string.split(pytext, '\r') pytext = string.join(pytext, '\n') + '\n' W.SetCursor("watch") globals['__nam...
5e10bdfe10958c54bfb2d7ceace5480414f83b44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5e10bdfe10958c54bfb2d7ceace5480414f83b44/PyEdit.py
scheme = urllib.splittype(url)
scheme, path = urllib.splittype(url)
def getpage(self, url_pair): # Incoming argument name is a (URL, fragment) pair. # The page may have been cached in the name_table variable. url, fragment = url_pair if self.name_table.has_key(url): return self.name_table[url]
ecf526e708be1036120a6c22e69316822aa8f96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecf526e708be1036120a6c22e69316822aa8f96a/webchecker.py
self.draw['xscroll'] = self.draw.scrollX.set self.draw['yscroll'] = self.draw.scrollY.set
self.draw['xscrollcommand'] = self.draw.scrollX.set self.draw['yscrollcommand'] = self.draw.scrollY.set
def createWidgets(self):
5ed621cc1b8f032243c17d561a7d07438eadf7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5ed621cc1b8f032243c17d561a7d07438eadf7e0/canvas-with-scrollbars.py
def __init__(self, host, port=None, **x509): keys = x509.keys() try: keys.remove('key_file') except ValueError: pass try: keys.remove('cert_file') except ValueError: pass if keys: raise IllegalKeywordArgument()
def __init__(self, host, port=None, key_file=None, cert_file=None):
def __init__(self, host, port=None, **x509): keys = x509.keys() try: keys.remove('key_file') except ValueError: pass try: keys.remove('cert_file') except ValueError: pass if keys: raise IllegalKeywordArgument() HTTPConnection.__init__(self, host, port) self.key_file = x509.get('key_file') self.cert_file = x509.get('cer...
f71d815f6d0d1fff51094f6b246c622fb96c49ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f71d815f6d0d1fff51094f6b246c622fb96c49ee/httplib.py
self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file')
self.key_file = key_file self.cert_file = cert_file
def __init__(self, host, port=None, **x509): keys = x509.keys() try: keys.remove('key_file') except ValueError: pass try: keys.remove('cert_file') except ValueError: pass if keys: raise IllegalKeywordArgument() HTTPConnection.__init__(self, host, port) self.key_file = x509.get('key_file') self.cert_file = x509.get('cer...
f71d815f6d0d1fff51094f6b246c622fb96c49ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f71d815f6d0d1fff51094f6b246c622fb96c49ee/httplib.py
pass class IllegalKeywordArgument(HTTPException):
def __init__(self, version): self.version = version
f71d815f6d0d1fff51094f6b246c622fb96c49ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f71d815f6d0d1fff51094f6b246c622fb96c49ee/httplib.py
if line == '' or line == '\n' and self.skip_blanks:
if (line == '' or line == '\n') and self.skip_blanks:
def readline (self): """Read and return a single logical line from the current file (or from an internal buffer if lines have previously been "unread" with 'unreadline()'). If the 'join_lines' option is true, this may involve reading multiple physical lines concatenated into a single string. Updates the current line ...
7389dad779f0ab697162fd05a2822896bed26a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7389dad779f0ab697162fd05a2822896bed26a34/text_file.py
try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e try: unicode('\xff') except Exception, e: sampleUnicodeDecodeError = e
try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e try: unicode('\xff') except Exception, e: sampleUnicodeDecodeError = e
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py
except NameError: pass import pickle, random
except NameError: pass
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py
if len(args) == 2: raise exc else: raise exc(*args[1])
if len(args) == 2: raise exc else: raise exc(*args[1])
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py
type(e) is not exc):
type(e) is not exc):
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py
new = pickle.loads(pickle.dumps(e, random.randint(0, 2))) for checkArgName in expected: self.assertEquals(repr(getattr(e, checkArgName)), repr(expected[checkArgName]), 'pickled exception "%s", attribute "%s' % (repr(e), checkArgName))
for p in pickle, cPickle: for protocol in range(p.HIGHEST_PROTOCOL + 1): new = p.loads(p.dumps(e, protocol)) for checkArgName in expected: got = repr(getattr(new, checkArgName)) want = repr(expected[checkArgName]) self.assertEquals(got, want, 'pickled "%r", attribute "%s' % (e, checkArgName))
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py
"Compression requires the (missing) zlib module"
"Compression requires the (missing) zlib module"
def __init__(self, filename, mode="r", compression=ZIP_STORED): 'Open the ZIP file with mode read "r", write "w" or append "a".' if compression == ZIP_STORED: pass elif compression == ZIP_DEFLATED: if not zlib: raise RuntimeError,\ "Compression requires the (missing) zlib module" else: raise RuntimeError, "That compres...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
'File name in Central Directory "%s" and File Header "%s" differ.' % ( data.filename, fname)
'File name in directory "%s" and header "%s" differ.' % ( data.filename, fname)
def _GetContents(self): "Read in the table of contents for the zip file" fp = self.fp fp.seek(-22, 2) # Start of end-of-archive record filesize = fp.tell() + 22 # Get file size endrec = fp.read(22) # Archive must not end with a comment! if endrec[0:4] != stringEndArchive or endrec[-2:] != "\000\000": raise BadZipfile,...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
"Attempt to read ZIP archive that was already closed"
"Attempt to read ZIP archive that was already closed"
def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_o...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
"De-compression requires the (missing) zlib module"
"De-compression requires the (missing) zlib module"
def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_o...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
"Unsupported compression method %d for file %s" % \
"Unsupported compression method %d for file %s" % \
def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_o...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
"Attempt to write ZIP archive that was already closed"
"Attempt to write ZIP archive that was already closed"
def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: ra...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
"Compression requires the (missing) zlib module"
"Compression requires the (missing) zlib module"
def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: ra...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
"That compression method is not supported"
"That compression method is not supported"
def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: ra...
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
'Files added with writepy() must end with ".py"'
'Files added with writepy() must end with ".py"'
def writepy(self, pathname, basename = ""): """Add all files from "pathname" to the ZIP archive.
d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py
raise xml.sax.SAXParseException(expat.ErrorString(error_code), None, self)
raise SAXParseException(expat.ErrorString(error_code), None, self)
def parse(self, stream_or_string): "Parse an XML document from a URL." if type(stream_or_string) is type(""): stream = open(stream_or_string) else: stream = stream_or_string
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
"Looks up and returns the state of a SAX2 feature."
if name == feature_namespaces: return self._namespaces
def getFeature(self, name): "Looks up and returns the state of a SAX2 feature." raise SAXNotRecognizedException("Feature '%s' not recognized" % name)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
"Sets the state of a SAX2 feature." raise SAXNotRecognizedException("Feature '%s' not recognized" % name)
if self._parsing: raise SAXNotSupportedException("Cannot set features while parsing") if name == feature_namespaces: self._namespaces = state else: raise SAXNotRecognizedException("Feature '%s' not recognized" % name)
def setFeature(self, name, state): "Sets the state of a SAX2 feature." raise SAXNotRecognizedException("Feature '%s' not recognized" % name)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
"Looks up and returns the value of a SAX2 property."
def getProperty(self, name): "Looks up and returns the value of a SAX2 property." raise SAXNotRecognizedException("Property '%s' not recognized" % name)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
"Sets the value of a SAX2 property."
def setProperty(self, name, value): "Sets the value of a SAX2 property." raise SAXNotRecognizedException("Property '%s' not recognized" % name)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
self._parser.Parse(data, 0)
if not self._parser.Parse(data, 0): msg = pyexpat.ErrorString(self._parser.ErrorCode) raise SAXParseException(msg, None, self)
def feed(self, data): if not self._parsing: self._parsing = 1 self.reset() self._cont_handler.startDocument() # FIXME: error checking and endDocument() self._parser.Parse(data, 0)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
self._cont_handler.startElement(name, name, xmlreader.AttributesImpl(attrs, attrs))
self._cont_handler.startElement(name, self._attrs)
def start_element(self, name, attrs): self._cont_handler.startElement(name, name, xmlreader.AttributesImpl(attrs, attrs))
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
self._cont_handler.endElement(name, name)
self._cont_handler.endElement(name)
def end_element(self, name): self._cont_handler.endElement(name, name)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
tup = (None, name) else: tup = pair
pair = (None, name)
def start_element_ns(self, name, attrs): pair = name.split() if len(pair) == 1: tup = (None, name) else: tup = pair
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
self._cont_handler.startElement(tup, None, xmlreader.AttributesImpl(attrs, None))
self._cont_handler.startElementNS(pair, None, self._attrs)
def start_element_ns(self, name, attrs): pair = name.split() if len(pair) == 1: tup = (None, name) else: tup = pair
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
name = (None, name, None) else: name = pair + [None]
name = (None, name)
def end_element_ns(self, name): pair = name.split() if len(pair) == 1: name = (None, name, None) else: name = pair + [None] # prefix is not implemented yet! self._cont_handler.endElement(name, None)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
self._cont_handler.endElement(name, None)
self._cont_handler.endElementNS(pair, None)
def end_element_ns(self, name): pair = name.split() if len(pair) == 1: name = (None, name, None) else: name = pair + [None] # prefix is not implemented yet! self._cont_handler.endElement(name, None)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
def end_element_ns(self, name): pair = name.split() if len(pair) == 1: name = (None, name, None) else: name = pair + [None] # prefix is not implemented yet! self._cont_handler.endElement(name, None)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
def processing_instruction(self, target, data): self._cont_handler.processingInstruction(target, data)
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py
assert 0
raise NotImplementedError()
def external_entity_ref(self, context, base, sysid, pubid): assert 0 # not implemented source = self._ent_handler.resolveEntity(pubid, sysid) source = saxutils.prepare_input_source(source) # FIXME: create new parser, stack self._source and self._parser # FIXME: reuse code from self.parse(...) return 1
c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py