rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def uid(self, command, args): """Execute "command args" with messages identified by UID,
def uid(self, command, *args): """Execute "command arg ..." with messages identified by UID,
def uid(self, command, args): """Execute "command args" with messages identified by UID, rather than message number.
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
(typ, [data]) = <instance>.uid(command, args)
(typ, [data]) = <instance>.uid(command, arg1, arg2, ...)
def uid(self, command, args): """Execute "command args" with messages identified by UID, rather than message number.
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
typ, dat = self._simple_command('UID', command, args)
typ, dat = apply(self._simple_command, ('UID', command) + args)
def uid(self, command, args): """Execute "command args" with messages identified by UID, rather than message number.
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
def xatom(self, name, arg1=None, arg2=None):
def xatom(self, name, *args):
def xatom(self, name, arg1=None, arg2=None): """Allow simple extension commands notified by server in CAPABILITY response.
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
(typ, [data]) = <instance>.xatom(name, arg1=None, arg2=None)
(typ, [data]) = <instance>.xatom(name, arg, ...)
def xatom(self, name, arg1=None, arg2=None): """Allow simple extension commands notified by server in CAPABILITY response.
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
return self._simple_command(name, arg1, arg2)
return apply(self._simple_command, (name,) + args)
def xatom(self, name, arg1=None, arg2=None): """Allow simple extension commands notified by server in CAPABILITY response.
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
if d is not None: data = '%s %s' % (data, d)
if d is None: continue if type(d) is type(''): l = len(string.split(d)) else: l = 1 if l == 0 or l > 1 and (d[0],d[-1]) not in (('(',')'),('"','"')): data = '%s "%s"' % (data, d) else: data = '%s %s' % (data, d)
def _command(self, name, dat1=None, dat2=None, dat3=None, literal=None):
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
resp = self._get_line()[:-2]
resp = self._get_line()
def _get_response(self):
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
dat = self._get_line()[:-2]
dat = self._get_line()
def _get_response(self):
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
print '\t< %s' % line[:-2]
print '\t< %s' % line
def _get_line(self):
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
def _simple_command(self, name, dat1=None, dat2=None): return self._command_complete(name, self._command(name, dat1, dat2))
def _simple_command(self, name, *args): return self._command_complete(name, apply(self._command, (name,) + args))
def _simple_command(self, name, dat1=None, dat2=None):
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
('create', ('/tmp/xxx',)), ('rename', ('/tmp/xxx', '/tmp/yyy')), ('CREATE', ('/tmp/yyz',)), ('append', ('/tmp/yyz', None, None, 'From: anon@x.y.z\n\ndata...')), ('select', ('/tmp/yyz',)), ('recent', ()),
('create', ('/tmp/xxx 1',)), ('rename', ('/tmp/xxx 1', '/tmp/yyy')), ('CREATE', ('/tmp/yyz 2',)), ('append', ('/tmp/yyz 2', None, None, 'From: anon@x.y.z\n\ndata...')), ('select', ('/tmp/yyz 2',)),
def Time2Internaldate(date_time): """Convert 'date_time' to IMAP4 INTERNALDATE representation. Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' """ dttype = type(date_time) if dttype is type(1): tt = time.localtime(date_time) elif dttype is type(()): tt = date_time elif dttype is type(""): return date_time # As...
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
('response', ('EXISTS',)),
def Time2Internaldate(date_time): """Convert 'date_time' to IMAP4 INTERNALDATE representation. Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' """ dttype = type(date_time) if dttype is type(1): tt = time.localtime(date_time) elif dttype is type(()): tt = date_time elif dttype is type(""): return date_time # As...
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
path = string.split(ml)[-1]
mo = re.match(r'.*"([^"]+)"$', ml) if mo: path = mo.group(1) else: path = string.split(ml)[-1]
def run(cmd, args): typ, dat = apply(eval('M.%s' % cmd), args) print ' %s %s\n => %s %s' % (cmd, args, typ, dat) return dat
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
run('uid', ('FETCH', '%s (FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822)' % uid))
run('uid', ('FETCH', '%s' % uid, '(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822)'))
def run(cmd, args): typ, dat = apply(eval('M.%s' % cmd), args) print ' %s %s\n => %s %s' % (cmd, args, typ, dat) return dat
568f22046d54f57ebb15b35bb4692bb3d957b838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/568f22046d54f57ebb15b35bb4692bb3d957b838/imaplib.py
exception = ['<p>%s: %s' % (strong(str(etype)), str(evalue))]
exception = ['<p>%s: %s' % (strong(pydoc.html.escape(str(etype))), pydoc.html.escape(str(evalue)))]
def reader(lnum=[lnum]): highlight[lnum[0]] = 1 try: return linecache.getline(file, lnum[0]) finally: lnum[0] += 1
380c086b2981818133512e2c47a609270be9ba89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/380c086b2981818133512e2c47a609270be9ba89/cgitb.py
g = {'c': 0, '__builtins__': __builtins__}
import __builtin__ g = {'c': 0, '__builtins__': __builtin__}
def break_yolks(self): self.yolks = self.yolks - 2
151d25b6ce7aceb2f40483046aa715d936ed99fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/151d25b6ce7aceb2f40483046aa715d936ed99fa/test_new.py
print 'new.code()' d = new.code(3, 3, 3, 3, codestr, (), (), (), "<string>", "<name>", 1, "", (), ()) d = new.code(3, 3, 3, 3, codestr, (), (), (), "<string>", "<name>", 1, "") if verbose: print d
if hasattr(new, 'code'): print 'new.code()' d = new.code(3, 3, 3, 3, codestr, (), (), (), "<string>", "<name>", 1, "", (), ()) d = new.code(3, 3, 3, 3, codestr, (), (), (), "<string>", "<name>", 1, "") if verbose: print d
def break_yolks(self): self.yolks = self.yolks - 2
151d25b6ce7aceb2f40483046aa715d936ed99fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/151d25b6ce7aceb2f40483046aa715d936ed99fa/test_new.py
self.ofp.write(struct.pack('>h', self.crc))
if self.crc < 0: fmt = '>h' else: fmt = '>H' self.ofp.write(struct.pack(fmt, self.crc))
def _writecrc(self): # XXXX Should this be here?? # self.crc = binascii.crc_hqx('\0\0', self.crc) self.ofp.write(struct.pack('>h', self.crc)) self.crc = 0
5cdbfa2c86954134b8f3f02431c310ff7dec1dfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5cdbfa2c86954134b8f3f02431c310ff7dec1dfc/binhex.py
if (inspect.getmodule(value) or object) is object:
if (all is not None or (inspect.getmodule(value) or object) is object):
def docmodule(self, object, name=None, mod=None, *ignored): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name try: all = object.__all__ except AttributeError: all = None parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.ht...
33de40b4cc0cd5fac5968bdb19b7641b151fb276 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33de40b4cc0cd5fac5968bdb19b7641b151fb276/pydoc.py
if inspect.isbuiltin(value) or inspect.getmodule(value) is object:
if (all is not None or inspect.isbuiltin(value) or inspect.getmodule(value) is object):
def docmodule(self, object, name=None, mod=None, *ignored): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name try: all = object.__all__ except AttributeError: all = None parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.ht...
33de40b4cc0cd5fac5968bdb19b7641b151fb276 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33de40b4cc0cd5fac5968bdb19b7641b151fb276/pydoc.py
if (inspect.getmodule(value) or object) is object:
if (all is not None or (inspect.getmodule(value) or object) is object):
def docmodule(self, object, name=None, mod=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name synop, desc = splitdoc(getdoc(object)) result = self.section('NAME', name + (synop and ' - ' + synop))
33de40b4cc0cd5fac5968bdb19b7641b151fb276 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33de40b4cc0cd5fac5968bdb19b7641b151fb276/pydoc.py
if inspect.isbuiltin(value) or inspect.getmodule(value) is object:
if (all is not None or inspect.isbuiltin(value) or inspect.getmodule(value) is object):
def docmodule(self, object, name=None, mod=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name synop, desc = splitdoc(getdoc(object)) result = self.section('NAME', name + (synop and ' - ' + synop))
33de40b4cc0cd5fac5968bdb19b7641b151fb276 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33de40b4cc0cd5fac5968bdb19b7641b151fb276/pydoc.py
def test_weak_keys(self): # # This exercises d.copy(), d.items(), d[] = v, d[], del d[], # len(d). # dict, objects = self.make_weak_keyed_dict() for o in objects: self.assert_(weakref.getweakrefcount(o) == 1, "wrong number of weak references to %r!" % o) self.assert_(o.arg is dict[o], "wrong object returned by weak d...
9957a87e94eebc9cfa7bac0a1dcacd2b9ec0d6dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9957a87e94eebc9cfa7bac0a1dcacd2b9ec0d6dc/test_weakref.py
self.wfile = StringIO.StringIO(self.packet)
self.wfile = StringIO.StringIO()
def setup(self): import StringIO self.packet, self.socket = self.request self.rfile = StringIO.StringIO(self.packet) self.wfile = StringIO.StringIO(self.packet)
24f8cb8309826e2b714daa2761c11de98e49d728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/24f8cb8309826e2b714daa2761c11de98e49d728/SocketServer.py
print 'XX', dst, '->', (head, tail)
def mkdirs(dst): """Make directories leading to 'dst' if they don't exist yet""" if dst == '' or os.path.exists(dst): return head, tail = os.path.split(dst) print 'XX', dst, '->', (head, tail) # XXXX Is this a bug in os.path.split? if not ':' in head: head = head + ':' mkdirs(head) os.mkdir(dst, 0777)
4d62b8f4a76c3021ac652513f7af3de60f06a32a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d62b8f4a76c3021ac652513f7af3de60f06a32a/macostools.py
push('<dl><dt><strong>%s</strong></dt>\n' % name) if value.__doc__ is not None: doc = self.markup(value.__doc__, self.preformat, funcs, classes, mdict) push('<dd><tt>%s</tt></dd>\n' % doc) for attr, tag in [('fget', '<em>get</em>'), ('fset', '<em>set</em>'), ('fdel', '<em>delete</em>')]: func = getattr(value, attr) if ...
push(self._docproperty(name, value, mod))
def spillproperties(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: push('<dl><dt><strong>%s</strong></dt>\n' % name) if value.__doc__ is not None: doc = self.markup(value.__doc__, self.preformat, funcs, classes, mdict) push('<dd><tt>%s...
f8f12fab983e23c47b04805b925825e478e1d72d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8f12fab983e23c47b04805b925825e478e1d72d/pydoc.py
push(name) need_blank_after_doc = 0 doc = getdoc(value) or '' if doc: push(self.indent(doc)) need_blank_after_doc = 1 for attr, tag in [('fget', '<get>'), ('fset', '<set>'), ('fdel', '<delete>')]: func = getattr(value, attr) if func is not None: if need_blank_after_doc: push('') need_blank_after_doc = 0 base = self.doc...
push(self._docproperty(name, value, mod))
def spillproperties(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: push(name) need_blank_after_doc = 0 doc = getdoc(value) or '' if doc: push(self.indent(doc)) need_blank_after_doc = 1 for attr, tag in [('fget', '<get>'), ('fset', '<se...
f8f12fab983e23c47b04805b925825e478e1d72d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8f12fab983e23c47b04805b925825e478e1d72d/pydoc.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...
ab65a3544f2daa48d46e1b1d4ffcb49bd7fda2ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ab65a3544f2daa48d46e1b1d4ffcb49bd7fda2ca/urllib2.py
r, w, x = select.select([self.fileno()], [], [], timeout)
elapsed = time() - time_start if elapsed >= timeout: break s_args = ([self.fileno()], [], [], timeout-elapsed) r, w, x = select.select(*s_args)
def expect(self, list, timeout=None): """Read until one from a list of a regular expressions matches.
87b54290e1e5035a8889ce67234e665607eafaac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/87b54290e1e5035a8889ce67234e665607eafaac/telnetlib.py
def get_inidata (self): # Return data describing the installation.
a380756dcfb4773cf79985c7c14e76d4a393db79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a380756dcfb4773cf79985c7c14e76d4a393db79/bdist_wininst.py
(string.capitalize(name), data)) lines.append("%s=%s" % (name, repr(data)[1:-1]))
(string.capitalize(name), escape(data))) lines.append("%s=%s" % (name, escape(data)))
def get_inidata (self): # Return data describing the installation.
a380756dcfb4773cf79985c7c14e76d4a393db79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a380756dcfb4773cf79985c7c14e76d4a393db79/bdist_wininst.py
lines.append("info=%s" % repr(info)[1:-1])
lines.append("info=%s" % escape(info))
def get_inidata (self): # Return data describing the installation.
a380756dcfb4773cf79985c7c14e76d4a393db79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a380756dcfb4773cf79985c7c14e76d4a393db79/bdist_wininst.py
lines.append("title=%s" % repr(title)[1:-1])
lines.append("title=%s" % escape(title))
def get_inidata (self): # Return data describing the installation.
a380756dcfb4773cf79985c7c14e76d4a393db79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a380756dcfb4773cf79985c7c14e76d4a393db79/bdist_wininst.py
if chunks[0].strip() == '':
if chunks[0].strip() == '' and lines:
def _wrap_chunks(self, chunks): """_wrap_chunks(chunks : [string]) -> [string]
7906caf9137238e9a528a6d285896e15986a1ada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7906caf9137238e9a528a6d285896e15986a1ada/textwrap.py
def _init_posix(): import os import re import string import sys
def _init_posix(): import os import re import string import sys g = globals() version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") # load the installed config.h: define_rx = re.compile("#define ([A-Z][A-Z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][...
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
g = globals()
def get_config_h_filename(): return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "config.h")
def _init_posix(): import os import re import string import sys g = globals() version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") # load the installed config.h: define_rx = re.compile("#define ([A-Z][A-Z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][...
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config")
def get_makefile_filename(): return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "Makefile")
def _init_posix(): import os import re import string import sys g = globals() version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") # load the installed config.h: define_rx = re.compile("#define ([A-Z][A-Z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][...
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
def parse_config_h(fp, g=None): if g is None: g = {}
def _init_posix(): import os import re import string import sys g = globals() version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") # load the installed config.h: define_rx = re.compile("#define ([A-Z][A-Z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][...
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
fp = open(os.path.join(config_dir, "config.h"))
undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n")
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
def parse_makefile(fp, g=None): if g is None: g = {}
undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n")
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
fp = open(os.path.join(config_dir, "Makefile"))
undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n")
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
import os exec "_init_%s()" % os.name del os
def _init_posix(): g = globals() parse_config_h(open(get_config_h_filename()), g) parse_makefile(open(get_makefile_filename()), g) try: exec "_init_" + os.name except NameError: pass else: exec "_init_%s()" % os.name
undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n")
bd21d26a77f48eb9b9d3323d9dad40c3465fae7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd21d26a77f48eb9b9d3323d9dad40c3465fae7d/sysconfig.py
assert "'" not in action cmd = "kfmclient '%s' >/dev/null 2>&1" % action
cmd = "kfmclient %s >/dev/null 2>&1" % action
def _remote(self, action): assert "'" not in action cmd = "kfmclient '%s' >/dev/null 2>&1" % action rc = os.system(cmd) if rc: import time if self.basename == "konqueror": os.system(self.name + " --silent &") else: os.system(self.name + " -d &") time.sleep(PROCESS_CREATION_DELAY) rc = os.system(cmd) return not rc
7845bc5691ce3a0058ba53239d0300e6038d41eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7845bc5691ce3a0058ba53239d0300e6038d41eb/webbrowser.py
if code != 200:
if code not in (200, 206):
def http_response(self, request, response): code, msg, hdrs = response.code, response.msg, response.info()
705a59986a268fee998245046f7d5a73f34a84e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/705a59986a268fee998245046f7d5a73f34a84e4/urllib2.py
if r.status == 200:
if r.status in (200, 206):
def do_open(self, http_class, req): """Return an addinfourl object for the request, using http_class.
705a59986a268fee998245046f7d5a73f34a84e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/705a59986a268fee998245046f7d5a73f34a84e4/urllib2.py
def __init__(self, path=None, debug=0, excludes = [], replace_paths = []):
def __init__(self, path=None, debug=0, excludes=[], replace_paths=[]):
def __init__(self, path=None, debug=0, excludes = [], replace_paths = []): if path is None: path = sys.path self.path = path self.modules = {} self.badmodules = {} self.debug = debug self.indent = 0 self.excludes = excludes self.replace_paths = replace_paths self.processed_paths = [] # Used in debugging only
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
if parent: self.badmodules[fqname][parent.__name__] = None
def import_module(self, partname, fqname, parent): self.msgin(3, "import_module", partname, fqname, parent) try: m = self.modules[fqname] except KeyError: pass else: self.msgout(3, "import_module ->", m) return m if self.badmodules.has_key(fqname): self.msgout(3, "import_module -> None") if parent: self.badmodules[fqna...
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
lastname = None
fromlist = None
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.import_hook(name, m) except ImportError, msg: self.msg(2, "ImportError:", str(msg)) if not self.badmodules.has_key(name): self.badmodules[name] = {} self.badmodules[name][m.__name__] = None elif op == IMPORT_F...
if op == LOAD_CONST: fromlist = co.co_consts[oparg] elif op == IMPORT_NAME: assert fromlist is None or type(fromlist) is tuple
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
assert lastname is not None if not self.badmodules.has_key(lastname): try: self.import_hook(lastname, m, [name]) except ImportError, msg: self.msg(2, "ImportError:", str(msg)) fullname = lastname + "." + name if not self.badmodules.has_key(fullname): self.badmodules[fullname] = {} self.badmodules[fullname][m.__name__] ...
have_star = 0 if fromlist is not None: if "*" in fromlist: have_star = 1 fromlist = [f for f in fromlist if f != "*"] self._safe_import_hook(name, m, fromlist) if have_star: mm = None if m.__path__: mm = self.modules.get(m.__name__ + "." + name) if mm is None: mm = self.modules.get(name) if mm is not None: m.glob...
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
pass else: lastname = None
name = co.co_names[oparg] m.globalnames[name] = 1
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
keys = self.badmodules.keys() keys.sort() for key in keys: if key not in self.excludes: mods = self.badmodules[key].keys()
missing, maybe = self.any_missing_maybe() if missing: print print "Missing modules:" for name in missing: mods = self.badmodules[name].keys()
def report(self): print print " %-25s %s" % ("Name", "File") print " %-25s %s" % ("----", "----") # Print modules found keys = self.modules.keys() keys.sort() for key in keys: m = self.modules[key] if m.__path__: print "P", else: print "m", print "%-25s" % key, m.__file__ or ""
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
print "?", key, "from", ', '.join(mods)
print "?", name, "imported from", ', '.join(mods) if maybe: print print "Submodules thay appear to be missing, but could also be", print "global names in the parent package:" for name in maybe: mods = self.badmodules[name].keys() mods.sort() print "?", name, "imported from", ', '.join(mods)
def report(self): print print " %-25s %s" % ("Name", "File") print " %-25s %s" % ("----", "----") # Print modules found keys = self.modules.keys() keys.sort() for key in keys: m = self.modules[key] if m.__path__: print "P", else: print "m", print "%-25s" % key, m.__file__ or ""
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
keys = self.badmodules.keys()
"""Return a list of modules that appear to be missing. Use any_missing_maybe() if you want to know which modules are certain to be missing, and which *may* be missing. """ missing, maybe = self.any_missing_maybe() return missing + maybe def any_missing_maybe(self): """Return two lists, one with modules that are certai...
def any_missing(self): keys = self.badmodules.keys() missing = [] for key in keys: if key not in self.excludes: # Missing, and its not supposed to be missing.append(key) return missing
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
for key in keys: if key not in self.excludes: missing.append(key) return missing
maybe = [] for name in self.badmodules: if name in self.excludes: continue i = name.rfind(".") if i < 0: missing.append(name) continue subname = name[i+1:] pkgname = name[:i] pkg = self.modules.get(pkgname) if pkg is not None: if pkgname in self.badmodules[name]: missing.append(name) elif subname in pkg.globalnames: ...
def any_missing(self): keys = self.badmodules.keys() missing = [] for key in keys: if key not in self.excludes: # Missing, and its not supposed to be missing.append(key) return missing
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
for f,r in self.replace_paths:
for f, r in self.replace_paths:
def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f,r in self.replace_paths: if original_filename.startswith(f): new_filename = r+original_filename[len(f):] break
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
new_filename = r+original_filename[len(f):]
new_filename = r + original_filename[len(f):]
def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f,r in self.replace_paths: if original_filename.startswith(f): new_filename = r+original_filename[len(f):] break
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
if new_filename!=original_filename:
if new_filename != original_filename:
def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f,r in self.replace_paths: if original_filename.startswith(f): new_filename = r+original_filename[len(f):] break
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
test()
mf = test()
def test(): # Parse command line import getopt try: opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:") except getopt.error, msg: print msg return # Process options debug = 1 domods = 0 addpath = [] exclude = [] for o, a in opts: if o == '-d': debug = debug + 1 if o == '-m': domods = 1 if o == '-p': addpath = addpath ...
56cd69df686ebc6b86f0b35e7546d115043aeb2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56cd69df686ebc6b86f0b35e7546d115043aeb2e/modulefinder.py
objects = self.object_filenames(sources, 1, outdir)
objects = self.object_filenames(sources, 0, outdir)
def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra): """Process arguments and decide which source files to compile.
44fa2e069cf82e237d015a11c09b1f31f949dfea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44fa2e069cf82e237d015a11c09b1f31f949dfea/ccompiler.py
objects = self.object_filenames(sources, strip_dir=1,
objects = self.object_filenames(sources, strip_dir=0,
def _prep_compile(self, sources, output_dir, depends=None): """Decide which souce files must be recompiled.
44fa2e069cf82e237d015a11c09b1f31f949dfea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44fa2e069cf82e237d015a11c09b1f31f949dfea/ccompiler.py
" LettError, Erik van Blokland, for the \n" " Python for Windows graphic.\n" " http://www.letterror.com/\n" "\n"
def add_ui(db): x = y = 50 w = 370 h = 300 title = "[ProductName] Setup" # see "Dialog Style Bits" modal = 3 # visible | modal modeless = 1 # visible track_disk_space = 32 add_data(db, 'ActionText', uisample.ActionText) add_data(db, 'UIText', uisample.UIText) # Bitmaps if not os.path.exists(srcdir+r"\PC\pytho...
24e6d385d0bce963147366a287eb71aa00c5d308 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/24e6d385d0bce963147366a287eb71aa00c5d308/msi.py
folderbox = Listbox(right)
folderbox = Listbox(right, {'exportselection': 0})
def main(): global root, tk, top, mid, bot global folderbox, foldermenu, scanbox, scanmenu, viewer global folder, seq global mh, mhf # Parse command line options folder = 'inbox' seq = 'all' try: opts, args = getopt.getopt(sys.argv[1:], '') except getopt.error, msg: print msg sys.exit(2) for arg in args: if arg[:1] =...
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
def open_folder(*e):
def open_folder(e=None):
def open_folder(*e): global folder, mhf sel = folderbox.curselection() if len(sel) != 1: if len(sel) > 1: msg = "Please open one folder at a time" else: msg = "Please select a folder to open" dialog(root, "Can't Open Folder", msg, "", 0, "OK") return i = sel[0] folder = folderbox.get(i) mhf = mh.openfolder(folder) resc...
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
def open_message(*e):
def open_message(e=None):
def open_message(*e): global viewer sel = scanbox.curselection() if len(sel) != 1: if len(sel) > 1: msg = "Please open one message at a time" else: msg = "Please select a message to open" dialog(root, "Can't Open Message", msg, "", 0, "OK") return cursor = scanbox['cursor'] scanbox['cursor'] = 'watch' tk.call('update',...
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
def remove_message():
def remove_message(e=None):
def remove_message(): itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Remove", "Please select a message to remove", "", 0, "OK") return todo = [] for i in sel: line = scanbox.get(i) if scanparser.match(line) >= 0: todo.append(string.atoi(scanparser.group(1))) mhf.removemes...
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
def refile_message():
def refile_message(e=None):
def refile_message(): global lastrefile, tofolder itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Refile", "Please select a message to refile", "", 0, "OK") return foldersel = folderbox.curselection() if len(foldersel) != 1: if not foldersel: msg = "Please select a folder ...
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
print 'refile', todo, tofolder
def refile_message(): global lastrefile, tofolder itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Refile", "Please select a message to refile", "", 0, "OK") return foldersel = folderbox.curselection() if len(foldersel) != 1: if not foldersel: msg = "Please select a folder ...
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
print 'new folder'
def refile_message(): global lastrefile, tofolder itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Refile", "Please select a message to refile", "", 0, "OK") return foldersel = folderbox.curselection() if len(foldersel) != 1: if not foldersel: msg = "Please select a folder ...
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
print 'yview', `itop`
def fixfocus(near, itop): n = scanbox.size() for i in range(n): line = scanbox.get(`i`) if scanparser.match(line) >= 0: num = string.atoi(scanparser.group(1)) if num >= near: break else: i = 'end' scanbox.select_from(i) print 'yview', `itop` scanbox.yview(itop)
c7f2283240ca2f10f4af7064def582de8758b514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7f2283240ca2f10f4af7064def582de8758b514/mbox.py
try: winsound.PlaySound( '!"$%&/( winsound.SND_ALIAS | winsound.SND_NODEFAULT ) except RuntimeError: pass
self.assertRaises(RuntimeError, winsound.PlaySound, '!"$%&/( winsound.SND_ALIAS | winsound.SND_NODEFAULT)
def test_alias_nofallback(self): try: winsound.PlaySound( '!"$%&/(#+*', winsound.SND_ALIAS | winsound.SND_NODEFAULT ) except RuntimeError: pass
83552a8c7cb953e0324bd908230c6d9fd3bd803b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/83552a8c7cb953e0324bd908230c6d9fd3bd803b/test_winsound.py
makedirs(head, mode)
try: makedirs(head, mode) except OSError, e: if e.errno != EEXIST: raise
def makedirs(name, mode=0777): """makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. This is recursive. """ head, tail = path.split(name) if not tail: h...
41dc061fee2ec9e78e44fe78c06d1179a0d764e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41dc061fee2ec9e78e44fe78c06d1179a0d764e6/os.py
from errno import ENOENT, ENOTDIR
def _execvpe(file, args, env=None): from errno import ENOENT, ENOTDIR if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ head, tail = path.split(file) if head: func(file, *argrest) return if 'PATH' in env: envpath = env['PATH'] else: envpath = defpath PATH = env...
41dc061fee2ec9e78e44fe78c06d1179a0d764e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41dc061fee2ec9e78e44fe78c06d1179a0d764e6/os.py
refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kTemporaryFolderType, 0)
refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kTemporaryFolderType, 0)
def gettempdir(): global tempdir if tempdir is not None: return tempdir attempdirs = ['/usr/tmp', '/tmp', os.getcwd(), os.curdir] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0, '\\TEMP') elif os.name == 'mac': import macfs, MACFS try: refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACF...
7d1e18f431d98b1bf5b4e8796fd72d91be28c662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d1e18f431d98b1bf5b4e8796fd72d91be28c662/tempfile.py
def mktemp():
def mktemp(suffix=""):
def mktemp(): global counter dir = gettempdir() pre = gettempprefix() while 1: counter = counter + 1 file = os.path.join(dir, pre + `counter`) if not os.path.exists(file): return file
7d1e18f431d98b1bf5b4e8796fd72d91be28c662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d1e18f431d98b1bf5b4e8796fd72d91be28c662/tempfile.py
file = os.path.join(dir, pre + `counter`)
file = os.path.join(dir, pre + `counter` + suffix)
def mktemp(): global counter dir = gettempdir() pre = gettempprefix() while 1: counter = counter + 1 file = os.path.join(dir, pre + `counter`) if not os.path.exists(file): return file
7d1e18f431d98b1bf5b4e8796fd72d91be28c662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d1e18f431d98b1bf5b4e8796fd72d91be28c662/tempfile.py
self.file=file self.path=path
self.file = file self.path = path
def __init__(self, file, path):
7d1e18f431d98b1bf5b4e8796fd72d91be28c662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d1e18f431d98b1bf5b4e8796fd72d91be28c662/tempfile.py
file=self.__dict__['file'] a=getattr(file, name)
file = self.__dict__['file'] a = getattr(file, name)
def __getattr__(self, name):
7d1e18f431d98b1bf5b4e8796fd72d91be28c662 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d1e18f431d98b1bf5b4e8796fd72d91be28c662/tempfile.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("...
291473d210488a850769ada5d59e55297e91f885 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/291473d210488a850769ada5d59e55297e91f885/__init__.py
else: a.write(data) a.close()
a.bufsize() a.obufcount() a.obuffree() a.getptr() a.fileno() a.setparameters(rate, 8, nchannels, linuxaudiodev.AFMT_MU_LAW, 1) a.write(data) a.flush() a.close() def test_errors(): a = linuxaudiodev.open("w") size = 8 fmt = linuxaudiodev.AFMT_U8 rate = 8000 nchannels = 1 try: a.setparameters(-1, size, nchannels, fm...
def play_sound_file(path): fp = open(path, 'r') data = fp.read() fp.close() try: a = linuxaudiodev.open('w') except linuxaudiodev.error, msg: if msg[0] in (errno.EACCES, errno.ENODEV): raise TestSkipped, msg raise TestFailed, msg else: a.write(data) a.close()
9ff718ad3f1e744ff4bc54d074ba88f5a595c5b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9ff718ad3f1e744ff4bc54d074ba88f5a595c5b0/test_linuxaudiodev.py
def main():
def findtemplate(): """Locate the applet template along sys.path"""
def main(): # Find the template # (there's no point in proceeding if we can't find it) for p in sys.path: template = os.path.join(p, TEMPLATE) try: template, d1, d2 = macfs.ResolveAliasFile(template) break except (macfs.error, ValueError): continue else: die("Template %s not found on sys.path" % `TEMPLATE`) return te...
f3a1bbb32192c87d325051189c2cb5895f62fae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f3a1bbb32192c87d325051189c2cb5895f62fae4/BuildApplet.py
print "Processing", `filename`, "..."
if DEBUG: print "Processing", `filename`, "..."
def process(template, filename, output): print "Processing", `filename`, "..." # Read the source and compile it # (there's no point overwriting the destination if it has a syntax error) fp = open(filename) text = fp.read() fp.close() try: code = compile(text, filename, "exec") except (SyntaxError, EOFError): die("Sy...
f3a1bbb32192c87d325051189c2cb5895f62fae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f3a1bbb32192c87d325051189c2cb5895f62fae4/BuildApplet.py
print "Creating resource fork..."
if DEBUG: print "Creating resource fork..."
def process(template, filename, output): print "Processing", `filename`, "..." # Read the source and compile it # (there's no point overwriting the destination if it has a syntax error) fp = open(filename) text = fp.read() fp.close() try: code = compile(text, filename, "exec") except (SyntaxError, EOFError): die("Sy...
f3a1bbb32192c87d325051189c2cb5895f62fae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f3a1bbb32192c87d325051189c2cb5895f62fae4/BuildApplet.py
except MacOS.Error:
except (MacOS.Error, ValueError): print 'No resource file', rsrcname
def process(template, filename, output): print "Processing", `filename`, "..." # Read the source and compile it # (there's no point overwriting the destination if it has a syntax error) fp = open(filename) text = fp.read() fp.close() try: code = compile(text, filename, "exec") except (SyntaxError, EOFError): die("Sy...
f3a1bbb32192c87d325051189c2cb5895f62fae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f3a1bbb32192c87d325051189c2cb5895f62fae4/BuildApplet.py
print id, type, name, size, hex(attrs)
if DEBUG: print id, type, name, size, hex(attrs)
def copyres(input, output): ctor = None UseResFile(input) ntypes = Count1Types() for itype in range(1, 1+ntypes): type = Get1IndType(itype) nresources = Count1Resources(type) for ires in range(1, 1+nresources): res = Get1IndResource(type, ires) id, type, name = res.GetResInfo() lcname = string.lower(name) if (type, lcn...
f3a1bbb32192c87d325051189c2cb5895f62fae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f3a1bbb32192c87d325051189c2cb5895f62fae4/BuildApplet.py
print "Overwriting..."
if DEBUG: print "Overwriting..."
def copyres(input, output): ctor = None UseResFile(input) ntypes = Count1Types() for itype in range(1, 1+ntypes): type = Get1IndType(itype) nresources = Count1Resources(type) for ires in range(1, 1+nresources): res = Get1IndResource(type, ires) id, type, name = res.GetResInfo() lcname = string.lower(name) if (type, lcn...
f3a1bbb32192c87d325051189c2cb5895f62fae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f3a1bbb32192c87d325051189c2cb5895f62fae4/BuildApplet.py
print "New attrs =", hex(attrs)
if DEBUG: print "New attrs =", hex(attrs)
def copyres(input, output): ctor = None UseResFile(input) ntypes = Count1Types() for itype in range(1, 1+ntypes): type = Get1IndType(itype) nresources = Count1Resources(type) for ires in range(1, 1+nresources): res = Get1IndResource(type, ires) id, type, name = res.GetResInfo() lcname = string.lower(name) if (type, lcn...
f3a1bbb32192c87d325051189c2cb5895f62fae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f3a1bbb32192c87d325051189c2cb5895f62fae4/BuildApplet.py
def urlparse(url, scheme = '', allow_framents = 1): key = url, scheme, allow_framents
def urlparse(url, scheme = '', allow_fragments = 1): key = url, scheme, allow_fragments
def urlparse(url, scheme = '', allow_framents = 1): key = url, scheme, allow_framents try: return _parse_cache[key] except KeyError: pass if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() netloc = path = params = query = fragment = '' i = string.find(url, ':') if i > 0: for c in url[:i]: if c...
e47e7c496015d6bf1f8df6187e40ee660f575844 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e47e7c496015d6bf1f8df6187e40ee660f575844/urlparse.py
if allow_framents and scheme in uses_fragment:
if allow_fragments and scheme in uses_fragment:
def urlparse(url, scheme = '', allow_framents = 1): key = url, scheme, allow_framents try: return _parse_cache[key] except KeyError: pass if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() netloc = path = params = query = fragment = '' i = string.find(url, ':') if i > 0: for c in url[:i]: if c...
e47e7c496015d6bf1f8df6187e40ee660f575844 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e47e7c496015d6bf1f8df6187e40ee660f575844/urlparse.py
def urljoin(base, url, allow_framents = 1):
def urljoin(base, url, allow_fragments = 1):
def urljoin(base, url, allow_framents = 1): if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_framents) scheme, netloc, path, params, query, fragment = \ urlparse(url, bscheme, allow_framents) # XXX Unofficial hack: default netloc to bnetloc even if # schemes diffe...
e47e7c496015d6bf1f8df6187e40ee660f575844 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e47e7c496015d6bf1f8df6187e40ee660f575844/urlparse.py
urlparse(base, '', allow_framents)
urlparse(base, '', allow_fragments)
def urljoin(base, url, allow_framents = 1): if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_framents) scheme, netloc, path, params, query, fragment = \ urlparse(url, bscheme, allow_framents) # XXX Unofficial hack: default netloc to bnetloc even if # schemes diffe...
e47e7c496015d6bf1f8df6187e40ee660f575844 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e47e7c496015d6bf1f8df6187e40ee660f575844/urlparse.py
urlparse(url, bscheme, allow_framents)
urlparse(url, bscheme, allow_fragments)
def urljoin(base, url, allow_framents = 1): if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_framents) scheme, netloc, path, params, query, fragment = \ urlparse(url, bscheme, allow_framents) # XXX Unofficial hack: default netloc to bnetloc even if # schemes diffe...
e47e7c496015d6bf1f8df6187e40ee660f575844 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e47e7c496015d6bf1f8df6187e40ee660f575844/urlparse.py
"""translate(s,table [,deletechars]) -> string
"""translate(s,table [,deletions]) -> string
def translate(s, table, deletions=""): """translate(s,table [,deletechars]) -> string Return a copy of the string s, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. ...
f4fc7107b41f7cb767c743e1dccd958d4591caaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f4fc7107b41f7cb767c743e1dccd958d4591caaf/string.py
in the optional argument deletechars are removed, and the
in the optional argument deletions are removed, and the
def translate(s, table, deletions=""): """translate(s,table [,deletechars]) -> string Return a copy of the string s, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. ...
f4fc7107b41f7cb767c743e1dccd958d4591caaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f4fc7107b41f7cb767c743e1dccd958d4591caaf/string.py
translation table, which must be a string of length 256. """ return s.translate(table, deletions)
translation table, which must be a string of length 256. The deletions argument is not allowed for Unicode strings. """ if deletions: return s.translate(table, deletions) else: return s.translate(table + s[:0])
def translate(s, table, deletions=""): """translate(s,table [,deletechars]) -> string Return a copy of the string s, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. ...
f4fc7107b41f7cb767c743e1dccd958d4591caaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f4fc7107b41f7cb767c743e1dccd958d4591caaf/string.py
if not installDir: installDir = DEFAULT_INSTALLDIR
def __init__(self, flavorOrder=None, downloadDir=None, buildDir=None, installDir=None, pimpDatabase=None): if not flavorOrder: flavorOrder = DEFAULT_FLAVORORDER if not downloadDir: downloadDir = DEFAULT_DOWNLOADDIR if not buildDir: buildDir = DEFAULT_BUILDDIR if not installDir: installDir = DEFAULT_INSTALLDIR if not pi...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
return rv
return rv
def check(self): """Check that the preferences make sense: directories exist and are writable, the install directory is on sys.path, etc.""" rv = "" RWX_OK = os.R_OK|os.W_OK|os.X_OK if not os.path.exists(self.downloadDir): rv += "Warning: Download directory \"%s\" does not exist\n" % self.downloadDir elif not os.acces...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 child = popen2.Popen4(cmd) child.tochild.close() while 1: line = child.fromchild.readline() if not...
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 child = popen2.Popen4(cmd) child.tochild.close() while 1: line = child.fromchild.readline() if not...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py
if self._cmd(output, self._db.preferences.downloadDir,
if _cmd(output, self._db.preferences.downloadDir,
def downloadPackageOnly(self, output=None): """Download a single package, if needed. An MD5 signature is used to determine whether download is needed, and to test that we actually downloaded what we expected. If output is given it is a file-like object that will receive a log of what happens. If anything unforeseen h...
a57befcef5b0ba55fc6941f6703163ed733a3f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a57befcef5b0ba55fc6941f6703163ed733a3f07/pimp.py