rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if type(ob)==types.ClassType:
if type(ob) in (types.ClassType, types.TypeType):
def get_arg_text(ob): """Get a string describing the arguments for the given object""" argText = "" if ob is not None: argOffset = 0 if type(ob)==types.ClassType: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: argOffset = 1 elif type(ob)==types.M...
c6bacd5606cbf3f76ae7e116e425a61d291c68fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c6bacd5606cbf3f76ae7e116e425a61d291c68fc/CallTips.py
def checkSetMinor(self):
def test_checkSetMinor(self):
def checkSetMinor(self): au = MIMEAudio(self._audiodata, 'fish') self.assertEqual(im.get_type(), 'audio/fish')
422b10fc259f2f36afbaa2a00b51011d88fbfee3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/422b10fc259f2f36afbaa2a00b51011d88fbfee3/test_email.py
self.assertEqual(im.get_type(), 'audio/fish')
self.assertEqual(au.get_type(), 'audio/fish')
def checkSetMinor(self): au = MIMEAudio(self._audiodata, 'fish') self.assertEqual(im.get_type(), 'audio/fish')
422b10fc259f2f36afbaa2a00b51011d88fbfee3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/422b10fc259f2f36afbaa2a00b51011d88fbfee3/test_email.py
def checkSetMinor(self):
def test_checkSetMinor(self):
def checkSetMinor(self): im = MIMEImage(self._imgdata, 'fish') self.assertEqual(im.get_type(), 'image/fish')
422b10fc259f2f36afbaa2a00b51011d88fbfee3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/422b10fc259f2f36afbaa2a00b51011d88fbfee3/test_email.py
if hasattr(object, '__doc__') and object.__doc__: lines = string.split(string.expandtabs(object.__doc__), '\n')
try: doc = object.__doc__ except AttributeError: return None if not isinstance(doc, (str, unicode)): return None try: lines = string.split(string.expandtabs(doc), '\n') except UnicodeError: return None else:
def getdoc(object): """Get the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.""" if hasattr(object, '__doc__') and object.__doc__: lines ...
240083177368a929a4ab15098a94b0a6f71aeeed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/240083177368a929a4ab15098a94b0a6f71aeeed/inspect.py
This (mostly) supports the API for Cryptographic Hash Functions (PEP 247).
This supports the API for Cryptographic Hash Functions (PEP 247).
def _strxor(s1, s2): """Utility method. XOR the two strings s1 and s2 (must have same length). """ return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2))
1ccdff90bb1beb27ff9592fe7d02f80d32b78373 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ccdff90bb1beb27ff9592fe7d02f80d32b78373/hmac.py
self.digest_size = digestmod.digest_size
def __init__(self, key, msg = None, digestmod = None): """Create a new HMAC object.
1ccdff90bb1beb27ff9592fe7d02f80d32b78373 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ccdff90bb1beb27ff9592fe7d02f80d32b78373/hmac.py
return HMAC(self)
other = HMAC("") other.digestmod = self.digestmod other.inner = self.inner.copy() other.outer = self.outer.copy() return other
def copy(self): """Return a separate copy of this hashing object.
1ccdff90bb1beb27ff9592fe7d02f80d32b78373 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ccdff90bb1beb27ff9592fe7d02f80d32b78373/hmac.py
def test(): def md5test(key, data, digest): h = HMAC(key, data) assert(h.hexdigest().upper() == digest.upper()) md5test(chr(0x0b) * 16, "Hi There", "9294727A3638BB1C13F48EF8158BFC9D") md5test("Jefe", "what do ya want for nothing?", "750c783e6ab0b503eaa86e310a5db738") md5test(chr(0xAA)*16, chr(0xDD)*50, "56be34521d1...
def test(): def md5test(key, data, digest): h = HMAC(key, data) assert(h.hexdigest().upper() == digest.upper()) # Test vectors from the RFC md5test(chr(0x0b) * 16, "Hi There", "9294727A3638BB1C13F48EF8158BFC9D") md5test("Jefe", "what do ya want for nothing?", "750c783e6ab0b503eaa86e310a5db738") md5test(chr(0xAA)*16,...
1ccdff90bb1beb27ff9592fe7d02f80d32b78373 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ccdff90bb1beb27ff9592fe7d02f80d32b78373/hmac.py
def _show(title=None, message=None, icon=None, type=None, **options): if icon: options["icon"] = icon if type: options["type"] = type
def _show(title=None, message=None, _icon=None, _type=None, **options): if _icon and "icon" not in options: options["icon"] = _icon if _type and "type" not in options: options["type"] = _type
def _show(title=None, message=None, icon=None, type=None, **options): if icon: options["icon"] = icon if type: options["type"] = type if title: options["title"] = title if message: options["message"] = message res = Message(**options).show() # In some Tcl installations, Tcl converts yes/no into a boolean if isi...
6fb20aa92ce6497bf5c065ca34e2a9fdf02e300e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fb20aa92ce6497bf5c065ca34e2a9fdf02e300e/tkMessageBox.py
return Carbon.Files.ResolveAliasFile(fss, chain)
return Carbon.File.ResolveAliasFile(fss, chain)
def ResolveAliasFile(fss, chain=1): return Carbon.Files.ResolveAliasFile(fss, chain)
e77f58a2be1c70af4cf4dfdb2bca041876de5b49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e77f58a2be1c70af4cf4dfdb2bca041876de5b49/macfs.py
if __name__ == "__main__":
def test_main():
def get_file(): return __file__
5c1ba53f8ca219a22d964324abb76a055ad19feb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c1ba53f8ca219a22d964324abb76a055ad19feb/test_zipimport.py
if self.compiler.find_library_file(lib_dirs, 'db-3.1'):
if self.compiler.find_library_file(lib_dirs, 'db-3.2'): dblib = ['db-3.2'] elif self.compiler.find_library_file(lib_dirs, 'db-3.1'):
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' )
f5c76776023e925deac6391546bcb85cd0c2424c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5c76776023e925deac6391546bcb85cd0c2424c/setup.py
'$CC -Wl,-t -o /dev/null 2>&1 -l' + name
'$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name
def _findLib_gcc(name): expr = '[^\(\)\s]*lib%s\.[^\(\)\s]*' % name cmd = 'if type gcc &>/dev/null; then CC=gcc; else CC=cc; fi;' \ '$CC -Wl,-t -o /dev/null 2>&1 -l' + name try: fdout, outfile = tempfile.mkstemp() fd = os.popen(cmd) trace = fd.read() err = fd.close() finally: try: os.unlink(outfile) except OSError, e:...
2bdf29ec28fa5f5284d57672d63fdd8402030a92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2bdf29ec28fa5f5284d57672d63fdd8402030a92/util.py
tabnanny.reset_globals()
def tabnanny(self, filename): import tabnanny import tokenize tabnanny.reset_globals() f = open(filename, 'r') try: tokenize.tokenize(f.readline, tabnanny.tokeneater) except tokenize.TokenError, msg: self.errorbox("Token error", "Token error:\n%s" % str(msg)) return 0 except tabnanny.NannyNag, nag: # The error messages...
44b1e7d8403558e945f796fec897d7862c9cec8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/44b1e7d8403558e945f796fec897d7862c9cec8a/ScriptBinding.py
tokenize.tokenize(f.readline, tabnanny.tokeneater)
tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
def tabnanny(self, filename): import tabnanny import tokenize tabnanny.reset_globals() f = open(filename, 'r') try: tokenize.tokenize(f.readline, tabnanny.tokeneater) except tokenize.TokenError, msg: self.errorbox("Token error", "Token error:\n%s" % str(msg)) return 0 except tabnanny.NannyNag, nag: # The error messages...
44b1e7d8403558e945f796fec897d7862c9cec8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/44b1e7d8403558e945f796fec897d7862c9cec8a/ScriptBinding.py
if part: self._hit(part)
def hitter(ctl, part, self=self): if part: self._hit(part)
ad1654e03aca95f8d5cad75ad377c3b67cb73f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad1654e03aca95f8d5cad75ad377c3b67cb73f91/Wcontrols.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
4f7829e185db9250349917a27be557721b1752ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f7829e185db9250349917a27be557721b1752ed/modulefinder.py
def seek(self, pos, whence=0): if whence==1: self.pos = self.pos + pos if whence==2: self.pos = self.stop + pos else: self.pos = self.start + pos
def __init__(self, fp, factory=rfc822.Message): self.fp = fp self.seekp = 0 self.factory = factory
2b5ff073ab9c232307f82dfd1cab0589ef293df5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b5ff073ab9c232307f82dfd1cab0589ef293df5/mailbox.py
"""Return the creation time of a file, reported by os.stat()."""
"""Return the metadata change time of a file, reported by os.stat()."""
def getctime(filename): """Return the creation time of a file, reported by os.stat().""" return os.stat(filename).st_ctime
1cd6e4dc38c7f7de3b39d93cb503ee2058662bcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1cd6e4dc38c7f7de3b39d93cb503ee2058662bcd/posixpath.py
verify (D().meth(4) == "D(4)C(4)B(4)A(4)")
vereq(D().meth(4), "D(4)C(4)B(4)A(4)") class mysuper(super): def __init__(self, *args): return super(mysuper, self).__init__(*args) class E(D): def meth(self, a): return "E(%r)" % a + mysuper(E, self).meth(a) vereq(E().meth(5), "E(5)D(5)C(5)B(5)A(5)") class F(E): def meth(self, a): s = self.__super return "F(%r)[...
def meth(self, a): return "D(%r)" % a + super(D, self).meth(a)
5b443c6282e8ffd6873005b62c50e56fa149e277 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5b443c6282e8ffd6873005b62c50e56fa149e277/test_descr.py
raise SMTPServerDisconnected
raise SMTPServerDisconnected('Server not connected')
def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', `str` if self.sock: try: self.sock.send(str) except socket.error: raise SMTPServerDisconnected else: raise SMTPServerDisconnected
40233ea70a1e66e172e8524f3458fff8bd148b4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40233ea70a1e66e172e8524f3458fff8bd148b4c/smtplib.py
raise SMTPServerDisconnected
raise SMTPServerDisconnected('please run connect() first')
def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', `str` if self.sock: try: self.sock.send(str) except socket.error: raise SMTPServerDisconnected else: raise SMTPServerDisconnected
40233ea70a1e66e172e8524f3458fff8bd148b4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40233ea70a1e66e172e8524f3458fff8bd148b4c/smtplib.py
raise SMTPServerDisconnected
raise SMTPServerDisconnected("Server not connected")
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MT...
40233ea70a1e66e172e8524f3458fff8bd148b4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40233ea70a1e66e172e8524f3458fff8bd148b4c/smtplib.py
raise SMTPSenderRefused
raise SMTPSenderRefused('%s: %s' % (from_addr, resp))
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
40233ea70a1e66e172e8524f3458fff8bd148b4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40233ea70a1e66e172e8524f3458fff8bd148b4c/smtplib.py
raise SMTPRecipientsRefused
raise SMTPRecipientsRefused(string.join( map(lambda x:"%s: %s" % (x[0], x[1][1]), senderrs.items()), '; '))
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
40233ea70a1e66e172e8524f3458fff8bd148b4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40233ea70a1e66e172e8524f3458fff8bd148b4c/smtplib.py
raise SMTPDataError
raise SMTPDataError('data transmission error: %s' % code)
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
40233ea70a1e66e172e8524f3458fff8bd148b4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40233ea70a1e66e172e8524f3458fff8bd148b4c/smtplib.py
self.simpleElement("real", str(value))
self.simpleElement("real", repr(value))
def writeValue(self, value): if isinstance(value, (str, unicode)): self.simpleElement("string", value) elif isinstance(value, bool): # must switch for bool before int, as bool is a # subclass of int... if value: self.simpleElement("true") else: self.simpleElement("false") elif isinstance(value, int): self.simpleElement...
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
import base64
def fromBase64(cls, data): import base64 return cls(base64.decodestring(data))
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
import base64
def asBase64(self): import base64 return base64.encodestring(self.data)
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
"""Primitive date wrapper, uses time floats internally, is agnostic about time zones.
"""Primitive date wrapper, uses UTC datetime instances internally.
def __repr__(self): return "%s(%s)" % (self.__class__.__name__, repr(self.data))
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
if isinstance(date, str): from xml.utils.iso8601 import parse date = parse(date)
if isinstance(date, datetime.datetime): pass elif isinstance(date, (float, int)): date = datetime.datetime.fromtimestamp(date) elif isinstance(date, basestring): order = ('year', 'month', 'day', 'hour', 'minute', 'second') gd = _dateParser.match(date).groupdict() lst = [] for key in order: val = gd[key] if val is None:...
def __init__(self, date): if isinstance(date, str): from xml.utils.iso8601 import parse date = parse(date) self.date = date
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
from xml.utils.iso8601 import tostring return tostring(self.date)
d = self.date return '%04d-%02d-%02dT%02d:%02d:%02dZ' % ( d.year, d.month, d.day, d.second, d.minute, d.hour, )
def toString(self): from xml.utils.iso8601 import tostring return tostring(self.date)
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
elif isinstance(other, (int, float)): return cmp(self.date, other)
elif isinstance(other, (datetime.datetime, float, int, basestring)): return cmp(self.date, Date(other).date)
def __cmp__(self, other): if isinstance(other, self.__class__): return cmp(self.date, other.date) elif isinstance(other, (int, float)): return cmp(self.date, other) else: return cmp(id(self), id(other))
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
def parse(self, file):
def parse(self, fileobj):
def parse(self, file): from xml.parsers.expat import ParserCreate parser = ParserCreate() parser.StartElementHandler = self.handleBeginElement parser.EndElementHandler = self.handleEndElement parser.CharacterDataHandler = self.handleData parser.ParseFile(file) return self.root
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
parser.ParseFile(file)
parser.ParseFile(fileobj)
def parse(self, file): from xml.parsers.expat import ParserCreate parser = ParserCreate() parser.StartElementHandler = self.handleBeginElement parser.EndElementHandler = self.handleEndElement parser.CharacterDataHandler = self.handleData parser.ParseFile(file) return self.root
95387a18956b2ab60709a79aaa93cfddec8978d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95387a18956b2ab60709a79aaa93cfddec8978d9/plistlib.py
print __doc__ % globals()
def usage(status, msg=''): if msg: print msg print __doc__ % globals() sys.exit(status)
14e2cafe21eebd5f6c40c9c0a542ae14a4f21296 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/14e2cafe21eebd5f6c40c9c0a542ae14a4f21296/Main.py
break
if colordb: break
def main(): try: opts, args = getopt.getopt( sys.argv[1:], 'hd:', ['database=', 'help']) except getopt.error, msg: usage(1, msg) if len(args) == 0: initialcolor = 'grey50' elif len(args) == 1: initialcolor = args[0] else: usage(1) for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-d', '--databa...
14e2cafe21eebd5f6c40c9c0a542ae14a4f21296 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/14e2cafe21eebd5f6c40c9c0a542ae14a4f21296/Main.py
raise IOError('No color database file found')
usage(1, 'No color database file found, see the -d option.')
def main(): try: opts, args = getopt.getopt( sys.argv[1:], 'hd:', ['database=', 'help']) except getopt.error, msg: usage(1, msg) if len(args) == 0: initialcolor = 'grey50' elif len(args) == 1: initialcolor = args[0] else: usage(1) for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-d', '--databa...
14e2cafe21eebd5f6c40c9c0a542ae14a4f21296 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/14e2cafe21eebd5f6c40c9c0a542ae14a4f21296/Main.py
if dir not in dirs and os.path.isdir(dir):
normdir = os.path.normcase(dir) if normdir not in normdirs and os.path.isdir(dir):
def pathdirs(): """Convert sys.path into a list of absolute, existing, unique paths.""" dirs = [] for dir in sys.path: dir = os.path.abspath(dir or '.') if dir not in dirs and os.path.isdir(dir): dirs.append(dir) return dirs
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
def cleanid(text):
def stripid(text):
def cleanid(text): """Remove the hexadecimal id from a Python object representation.""" return re.sub(' at 0x[0-9a-f]{5,}>$', '>', text)
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
return re.sub(' at 0x[0-9a-f]{5,}>$', '>', text)
for pattern in [' at 0x[0-9a-f]{6,}>$', ' at [0-9A-F]{8,}>$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '>', text) return text
def cleanid(text): """Remove the hexadecimal id from a Python object representation.""" return re.sub(' at 0x[0-9a-f]{5,}>$', '>', text)
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
return self.escape(cram(cleanid(repr(x)), self.maxother))
return self.escape(cram(stripid(repr(x)), self.maxother))
def repr1(self, x, level): methodname = 'repr_' + join(split(type(x).__name__), '_') if hasattr(self, methodname): return getattr(self, methodname)(x, level) else: return self.escape(cram(cleanid(repr(x)), self.maxother))
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
return cram(cleanid(repr(x)), self.maxstring)
return cram(stripid(repr(x)), self.maxstring)
def repr_instance(self, x, level): try: return cram(cleanid(repr(x)), self.maxstring) except: return self.escape('<%s instance>' % x.__class__.__name__)
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
file = inspect.getsourcefile(object) filelink = '<a href="file:%s">%s</a>' % (file, file)
path = os.path.abspath(inspect.getfile(object)) filelink = '<a href="file:%s">%s</a>' % (path, path)
def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ result = '' head = '<br><big><big><strong>&nbsp;%s</strong></big></big>' % name try: file = inspect.getsourcefile(object) filelink = '<a href="file:%s">%s</a>' % (file, file) except TypeError: filelink = '(built-in...
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
info.append('version: %s' % self.escape(version))
info.append('version %s' % self.escape(version))
def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ result = '' head = '<br><big><big><strong>&nbsp;%s</strong></big></big>' % name try: file = inspect.getsourcefile(object) filelink = '<a href="file:%s">%s</a>' % (file, file) except TypeError: filelink = '(built-in...
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
return cram(cleanid(repr(x)), self.maxother)
return cram(stripid(repr(x)), self.maxother)
def repr1(self, x, level): methodname = 'repr_' + join(split(type(x).__name__), '_') if hasattr(self, methodname): return getattr(self, methodname)(x, level) else: return cram(cleanid(repr(x)), self.maxother)
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
return cram(cleanid(repr(x)), self.maxstring)
return cram(stripid(repr(x)), self.maxstring)
def repr_instance(self, x, level): try: return cram(cleanid(repr(x)), self.maxstring) except: return '<%s instance>' % x.__class__.__name__
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
if version[:11] == '$Revision$': version = version[11:-1]
if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1])
def docmodule(self, object): """Produce text documentation for a given module object.""" result = ''
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
if __name__ == '__main__':
def cli():
def server_activate(self): self.base.server_activate(self) if self.callback: self.callback()
1d384634bf8f9e6180839048207bfd3539bbbc51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d384634bf8f9e6180839048207bfd3539bbbc51/pydoc.py
result = interact(handler.load(), 'System-wide preferences')
options = handler.load() if options['noargs']: EasyDialogs.Message('Warning: system-wide sys.argv processing is off.\nIf you dropped an applet I have not seen it.') result = interact(options, 'System-wide preferences')
def edit_preferences(): handler = pythonprefs.PythonOptions() result = interact(handler.load(), 'System-wide preferences') if result: handler.save(result)
43fd1f75db89d38010dd118b98f0460e958b5b99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/43fd1f75db89d38010dd118b98f0460e958b5b99/EditPythonPrefs.py
index = ac_in_buffer.find (self.terminator)
index = self.ac_in_buffer.find(terminator)
def handle_read (self):
b5d1392d9236eae981796cb7ae15d8ecd5035ac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5d1392d9236eae981796cb7ae15d8ecd5035ac6/asynchat.py
SIGNATURE='MOSS'
def openfile(self, path, activate = 1): if activate: self.activate() self.OpenURL("file:///" + string.join(string.split(path,':'), '/'))
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
lowertext = string.lower(text)
lowertext = text.lower()
def sucktitle(path): f = open(path) text = f.read(1024) # assume the title is in the first 1024 bytes f.close() lowertext = string.lower(text) matcher = _titlepat.search(lowertext) if matcher: return matcher.group(1) return path
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
self.w.results = TwoLineList((-1, -1, 1, -14), nicehits, self.listhit)
self.w.results = W.TwoLineList((-1, -1, 1, -14), nicehits, self.listhit)
def __init__(self, hits): global _resultscounter hits = map(lambda (path, hits): (sucktitle(path), path, hits), hits) hits.sort() self.hits = hits nicehits = map( lambda (title, path, hits): title + '\r' + string.join( map(lambda (c, p): "%s (%d)" % (p, c), hits), ', '), hits) nicehits.sort() self.w = W.Window((440, 30...
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
self.browser = None
def __init__(self, hits): global _resultscounter hits = map(lambda (path, hits): (sucktitle(path), path, hits), hits) hits.sort() self.hits = hits nicehits = map( lambda (title, path, hits): title + '\r' + string.join( map(lambda (c, p): "%s (%d)" % (p, c), hits), ', '), hits) nicehits.sort() self.w = W.Window((440, 30...
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
if self.browser is None: self.browser = WebBrowser(SIGNATURE, start = 1) self.browser.openfile(self.hits[i][1])
path = self.hits[i][1] url = "file://" + "/".join(path.split(":")) webbrowser.open(url)
def listhit(self, isdbl = 1): if isdbl: for i in self.w.results.getselection(): if self.browser is None: self.browser = WebBrowser(SIGNATURE, start = 1) self.browser.openfile(self.hits[i][1])
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
self.w.searching = W.TextBox((4, 4, -4, 16), "DevDev:PyPyDoc 1.5.1:ext:parseTupleAndKeywords.html")
self.w.searching = W.TextBox((4, 4, -4, 16), "")
def __init__(self): self.w = W.Dialog((440, 64), "Searching\xc9") self.w.searching = W.TextBox((4, 4, -4, 16), "DevDev:PyPyDoc 1.5.1:ext:parseTupleAndKeywords.html") self.w.hits = W.TextBox((4, 24, -4, 16), "Hits: 0") self.w.canceltip = W.TextBox((4, 44, -4, 16), "Type cmd-period (.) to cancel.") self.w.open()
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
self.w.setdocfolderbutton = W.Button((10, -30, 80, 16), "Set doc folder", self.setdocpath)
self.w.setdocfolderbutton = W.Button((10, -30, 100, 16), "Set doc folder", self.setdocpath)
def __init__(self): prefs = MacPrefs.GetPrefs(W.getapplication().preffilepath) try: (docpath, kind, case, word, tut, lib, ref, ext, api) = prefs.docsearchengine except: (docpath, kind, case, word, tut, lib, ref, ext, api) = prefs.docsearchengine = \ ("", 0, 0, 0, 1, 1, 0, 0, 0) if docpath and not verifydocpath(docpath...
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
self.w.docfolder = W.TextBox((100, -28, -10, 16), docpath)
self.w.docfolder = W.TextBox((120, -28, -10, 16), docpath)
def __init__(self): prefs = MacPrefs.GetPrefs(W.getapplication().preffilepath) try: (docpath, kind, case, word, tut, lib, ref, ext, api) = prefs.docsearchengine except: (docpath, kind, case, word, tut, lib, ref, ext, api) = prefs.docsearchengine = \ ("", 0, 0, 0, 1, 1, 0, 0, 0) if docpath and not verifydocpath(docpath...
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
def search(self): hits = dosearch(self.docpath, self.w.searchtext.get(), self.getsettings()) if hits: Results(hits) elif hasattr(MacOS, 'SysBeep'): MacOS.SysBeep(0) #import PyBrowser #PyBrowser.Browser(hits)
cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py
Returns a list describing the signiture of the method. In the
Returns a list describing the signature of the method. In the
def system_methodSignature(self, method_name): """system.methodSignature('add') => [double, int, int]
b9b5f160ab7c17469c5ff297292275253e4f7570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b9b5f160ab7c17469c5ff297292275253e4f7570/SimpleXMLRPCServer.py
def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None):
def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None, quiet=0):
def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): dir: the directory to byte-compile maxlevels: maximum recursion level (default 10) ddir: if given, purported directory name (this is the directory name...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
print 'Listing', dir, '...'
if not quiet: print 'Listing', dir, '...'
def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): dir: the directory to byte-compile maxlevels: maximum recursion level (default 10) ddir: if given, purported directory name (this is the directory name...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
print 'Compiling', fullname, '...'
if not quiet: print 'Compiling', fullname, '...'
def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): dir: the directory to byte-compile maxlevels: maximum recursion level (default 10) ddir: if given, purported directory name (this is the directory name...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
if not compile_dir(fullname, maxlevels - 1, dfile, force, rx):
if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, quiet):
def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): dir: the directory to byte-compile maxlevels: maximum recursion level (default 10) ddir: if given, purported directory name (this is the directory name...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
def compile_path(skip_curdir=1, maxlevels=0, force=0):
def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0):
def compile_path(skip_curdir=1, maxlevels=0, force=0): """Byte-compile all module on sys.path. Arguments (all optional): skip_curdir: if true, skip current directory (default true) maxlevels: max recursion level (default 0) force: as for compile_dir() (default 0) """ success = 1 for dir in sys.path: if (not dir or...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
success = success and compile_dir(dir, maxlevels, None, force)
success = success and compile_dir(dir, maxlevels, None, force, quiet=quiet)
def compile_path(skip_curdir=1, maxlevels=0, force=0): """Byte-compile all module on sys.path. Arguments (all optional): skip_curdir: if true, skip current directory (default true) maxlevels: max recursion level (default 0) force: as for compile_dir() (default 0) """ success = 1 for dir in sys.path: if (not dir or...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
opts, args = getopt.getopt(sys.argv[1:], 'lfd:x:')
opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:')
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfd:x:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-d destdir] " \ "[-s regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-t...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
print "usage: python compileall.py [-l] [-f] [-d destdir] " \
print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfd:x:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-d destdir] " \ "[-s regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-t...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
if not compile_dir(dir, maxlevels, ddir, force, rx):
if not compile_dir(dir, maxlevels, ddir, force, rx, quiet):
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfd:x:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-d destdir] " \ "[-s regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-t...
5c137c225113764faae183034e7a85175a699ae2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5c137c225113764faae183034e7a85175a699ae2/compileall.py
verify(self.cbcalled == 1, "callback did not properly set 'cbcalled'") verify(ref() is None, "ref2 should be dead after deleting object reference")
self.assert_(self.cbcalled == 1, "callback did not properly set 'cbcalled'") self.assert_(ref() is None, "ref2 should be dead after deleting object reference")
def check_basic_callback(self, factory): self.cbcalled = 0 o = factory() ref = weakref.ref(o, self.callback) del o verify(self.cbcalled == 1, "callback did not properly set 'cbcalled'") verify(ref() is None, "ref2 should be dead after deleting object reference")
705088e65f67fa242802036ee129972b6d6fda63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/705088e65f67fa242802036ee129972b6d6fda63/test_weakref.py
except: pass
except OSError: pass
def nextfile(self): savestdout = self._savestdout self._savestdout = 0 if savestdout: sys.stdout = savestdout
cffac66393c2af89c6546ab081f9098633273a53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cffac66393c2af89c6546ab081f9098633273a53/fileinput.py
except:
except OSError:
def readline(self): try: line = self._buffer[self._bufindex] except IndexError: pass else: self._bufindex += 1 self._lineno += 1 self._filelineno += 1 return line if not self._file: if not self._files: return "" self._filename = self._files[0] self._files = self._files[1:] self._filelineno = 0 self._file = None self._i...
cffac66393c2af89c6546ab081f9098633273a53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cffac66393c2af89c6546ab081f9098633273a53/fileinput.py
except:
except OSError:
def readline(self): try: line = self._buffer[self._bufindex] except IndexError: pass else: self._bufindex += 1 self._lineno += 1 self._filelineno += 1 return line if not self._file: if not self._files: return "" self._filename = self._files[0] self._files = self._files[1:] self._filelineno = 0 self._file = None self._i...
cffac66393c2af89c6546ab081f9098633273a53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cffac66393c2af89c6546ab081f9098633273a53/fileinput.py
mainname = os.path.basename(self.mainprogram) self.files.append((self.mainprogram, pathjoin(resdir, mainname))) mainprogram = self.mainprogram
mainprogram = os.path.basename(self.mainprogram) self.files.append((self.mainprogram, pathjoin(resdir, mainprogram)))
def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execname = self.name else: execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.appe...
24884f76c6b59aa9cd716174907a02d5d172c2fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24884f76c6b59aa9cd716174907a02d5d172c2fc/bundlebuilder.py
mainwrapperpath = pathjoin(execdir, self.name)
bootstrappath = pathjoin(execdir, self.name)
def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execname = self.name else: execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.appe...
24884f76c6b59aa9cd716174907a02d5d172c2fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24884f76c6b59aa9cd716174907a02d5d172c2fc/bundlebuilder.py
open(mainwrapperpath, "w").write(BOOTSTRAP_SCRIPT % locals()) os.chmod(mainwrapperpath, 0775)
open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals()) os.chmod(bootstrappath, 0775)
def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execname = self.name else: execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.appe...
24884f76c6b59aa9cd716174907a02d5d172c2fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24884f76c6b59aa9cd716174907a02d5d172c2fc/bundlebuilder.py
ScrolledList.__init__(self, master, width=80)
if macosxSupport.runningAsOSXApp(): ScrolledList.__init__(self, master) else: ScrolledList.__init__(self, master, width=80)
def __init__(self, master, flist, gui): ScrolledList.__init__(self, master, width=80) self.flist = flist self.gui = gui self.stack = []
53f1a943eca54f4ce1af1071998b3d56f79cc00f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/53f1a943eca54f4ce1af1071998b3d56f79cc00f/Debugger.py
def test_warning(self): warnings.filterwarnings("error", category=RuntimeWarning, message="mktemp") self.assertRaises(RuntimeWarning, tempfile.mktemp, (), { 'dir': self.dir })
def test_warning(self): # mktemp issues a warning when used warnings.filterwarnings("error", category=RuntimeWarning, message="mktemp") self.assertRaises(RuntimeWarning, tempfile.mktemp, (), { 'dir': self.dir })
8bec48316b1ffb4ea153e78b9119d7e77b98f3eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8bec48316b1ffb4ea153e78b9119d7e77b98f3eb/test_tempfile.py
no elements are considered to be junk. For examples, pass
no elements are considered to be junk. For example, pass
def __init__(self, isjunk=None, a='', b=''): """Construct a SequenceMatcher.
f1da6287fc90a068da8487dc5564b35f194d74b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1da6287fc90a068da8487dc5564b35f194d74b9/difflib.py
default, an empty string. The elements of a must be hashable. See
default, an empty string. The elements of b must be hashable. See
def __init__(self, isjunk=None, a='', b=''): """Construct a SequenceMatcher.
f1da6287fc90a068da8487dc5564b35f194d74b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1da6287fc90a068da8487dc5564b35f194d74b9/difflib.py
raise ValueError("n must be > 0: %s" % `n`)
raise ValueError("n must be > 0: " + `n`)
def get_close_matches(word, possibilities, n=3, cutoff=0.6): """Use SequenceMatcher to return list of the best "good enough" matches. word is a sequence for which close matches are desired (typically a string). possibilities is a list of sequences against which to match word (typically a list of strings). Optional a...
f1da6287fc90a068da8487dc5564b35f194d74b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1da6287fc90a068da8487dc5564b35f194d74b9/difflib.py
raise ValueError("cutoff must be in [0.0, 1.0]: %s" % `cutoff`)
raise ValueError("cutoff must be in [0.0, 1.0]: " + `cutoff`)
def get_close_matches(word, possibilities, n=3, cutoff=0.6): """Use SequenceMatcher to return list of the best "good enough" matches. word is a sequence for which close matches are desired (typically a string). possibilities is a list of sequences against which to match word (typically a list of strings). Optional a...
f1da6287fc90a068da8487dc5564b35f194d74b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1da6287fc90a068da8487dc5564b35f194d74b9/difflib.py
def test_wide(self):
def test_width(self):
def test_wide(self): self.assertEqual(u''.width(), 0) self.assertEqual(u'abcd'.width(), 4) self.assertEqual(u'\u0187\u01c9'.width(), 2) self.assertEqual(u'\u2460\u2329'.width(), 3) self.assertEqual(u'\u2329\u2460'.width(), 3) self.assertEqual(u'\ud55c\uae00'.width(), 4) self.assertEqual(u'\ud55c\u2606\uae00'.width(), 5...
7bd860655f8343fe02439a457bc59f7cd7d9eda8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7bd860655f8343fe02439a457bc59f7cd7d9eda8/test_unicode.py
_monthnames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] _daynames = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
_monthnames = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec', 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'] _daynames = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']
def dump_address_pair(pair): """Dump a (name, address) pair in a canonicalized form.""" if pair[0]: return '"' + pair[0] + '" <' + pair[1] + '>' else: return pair[1]
db01ee0e22c348b642143dbb728517ca7e13f526 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/db01ee0e22c348b642143dbb728517ca7e13f526/rfc822.py
if data[0][-1] == ',' or data[0] in _daynames:
if data[0][-1] in (',', '.') or string.lower(data[0]) in _daynames:
def parsedate_tz(data): """Convert a date string to a time tuple. Accounts for military timezones. """ data = string.split(data) if data[0][-1] == ',' or data[0] in _daynames: # There's a dayname here. Skip it del data[0] if len(data) == 3: # RFC 850 date, deprecated stuff = string.split(data[0], '-') if len(stuff) ==...
db01ee0e22c348b642143dbb728517ca7e13f526 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/db01ee0e22c348b642143dbb728517ca7e13f526/rfc822.py
dd, mm, yy, tm, tz = mm, dd, tm, yy, tz
dd, mm = mm, string.lower(dd)
def parsedate_tz(data): """Convert a date string to a time tuple. Accounts for military timezones. """ data = string.split(data) if data[0][-1] == ',' or data[0] in _daynames: # There's a dayname here. Skip it del data[0] if len(data) == 3: # RFC 850 date, deprecated stuff = string.split(data[0], '-') if len(stuff) ==...
db01ee0e22c348b642143dbb728517ca7e13f526 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/db01ee0e22c348b642143dbb728517ca7e13f526/rfc822.py
if not self.__ensure_WMAvailable(): raise RuntimeError, "No window manager access, cannot send AppleEvent"
def sendevent(self, event): """Send a pre-created appleevent, await the reply and unpack it""" reply = event.AESend(self.send_flags, self.send_priority, self.send_timeout) parameters, attributes = unpackevent(reply, self._moduleName) return reply, parameters, attributes
397e9142096d5ccd2b4a63bc04d3b05b3c86cc48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397e9142096d5ccd2b4a63bc04d3b05b3c86cc48/aetools.py
"""Check the LaTex formatting in a sequence of lines.
"""Check the LaTeX formatting in a sequence of lines.
def checkit(source, opts, morecmds=[]): """Check the LaTex formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters ...
0fd525fd1c8e2b3374c7acda0facbdce9dfbb63e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0fd525fd1c8e2b3374c7acda0facbdce9dfbb63e/texcheck.py
Morecmds is a sequence of LaTex commands (without backslashes) that
Morecmds is a sequence of LaTeX commands (without backslashes) that
def checkit(source, opts, morecmds=[]): """Check the LaTex formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters ...
0fd525fd1c8e2b3374c7acda0facbdce9dfbb63e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0fd525fd1c8e2b3374c7acda0facbdce9dfbb63e/texcheck.py
print "Unmatched open delimiter '%s' on line %d", (symbol, lineno)
print "Unmatched open delimiter '%s' on line %d" % (symbol, lineno)
def checkit(source, opts, morecmds=[]): """Check the LaTex formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters ...
0fd525fd1c8e2b3374c7acda0facbdce9dfbb63e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0fd525fd1c8e2b3374c7acda0facbdce9dfbb63e/texcheck.py
for key in ('LDFLAGS', 'BASECFLAGS'):
for key in ('LDFLAGS', 'BASECFLAGS', 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
def get_config_vars(*args): """With no arguments, return a dictionary of all configuration variables relevant for the current platform. Generally this includes everything needed to build extensions and install both pure modules and extensions. On Unix, this means every variable defined in Python's installed Makefile;...
d610369e8b63930b5a7b1bdafebd3c64af6b4b28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d610369e8b63930b5a7b1bdafebd3c64af6b4b28/sysconfig.py
To understand what this class does, it helps to have a copy of RFC-822 in front of you.
To understand what this class does, it helps to have a copy of RFC 2822 in front of you.
def quote(str): """Add quotes around a string.""" return str.replace('\\', '\\\\').replace('"', '\\"')
1fb22bb24fd395a12a225b2418ea8d22d5b37610 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb22bb24fd395a12a225b2418ea8d22d5b37610/_parseaddr.py
ad = self.getaddress() if ad: return ad + self.getaddrlist() else: return []
result = [] while 1: ad = self.getaddress() if ad: result += ad else: break return result
def getaddrlist(self): """Parse all addresses.
1fb22bb24fd395a12a225b2418ea8d22d5b37610 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb22bb24fd395a12a225b2418ea8d22d5b37610/_parseaddr.py
expectaddrspec = 1
def getrouteaddr(self): """Parse a route address (Return-path value).
1fb22bb24fd395a12a225b2418ea8d22d5b37610 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb22bb24fd395a12a225b2418ea8d22d5b37610/_parseaddr.py
"""Parse an RFC-822 addr-spec."""
"""Parse an RFC 2822 addr-spec."""
def getaddrspec(self): """Parse an RFC-822 addr-spec.""" aslist = []
1fb22bb24fd395a12a225b2418ea8d22d5b37610 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb22bb24fd395a12a225b2418ea8d22d5b37610/_parseaddr.py
If `allowcomments' is non-zero, embedded RFC-822 comments are allowed within the parsed fragment.
If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed within the parsed fragment.
def getdelimited(self, beginchar, endchars, allowcomments = 1): """Parse a header fragment delimited by special characters.
1fb22bb24fd395a12a225b2418ea8d22d5b37610 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb22bb24fd395a12a225b2418ea8d22d5b37610/_parseaddr.py
"""Parse an RFC-822 domain-literal."""
"""Parse an RFC 2822 domain-literal."""
def getdomainliteral(self): """Parse an RFC-822 domain-literal.""" return '[%s]' % self.getdelimited('[', ']\r', 0)
1fb22bb24fd395a12a225b2418ea8d22d5b37610 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb22bb24fd395a12a225b2418ea8d22d5b37610/_parseaddr.py
def getatom(self): """Parse an RFC-822 atom."""
def getatom(self, atomends=None): """Parse an RFC 2822 atom. Optional atomends specifies a different set of end token delimiters (the default is to use self.atomends). This is used e.g. in getphraselist() since phrase endings must not include the `.' (which is legal in phrases)."""
def getatom(self): """Parse an RFC-822 atom.""" atomlist = ['']
1fb22bb24fd395a12a225b2418ea8d22d5b37610 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fb22bb24fd395a12a225b2418ea8d22d5b37610/_parseaddr.py