rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
ok_sys_names = ('ps1', 'ps2', 'copyright', 'version',
ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', 'hexversion',
def default_path(self): return self.rexec.modules['sys'].path
0d2f5ec10d448fb0876b05f5a0fd91d8ff2b575e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0d2f5ec10d448fb0876b05f5a0fd91d8ff2b575e/rexec.py
if cache.has_key(path): return cache[path] cache[path] = ret = os.stat(path)
ret = cache.get(path, None) if ret is None: cache[path] = ret = _os.stat(path)
def stat(path): """Stat a file, possibly out of the cache.""" if cache.has_key(path): return cache[path] cache[path] = ret = os.stat(path) return ret
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
def reset(): """Reset the cache completely.""" global cache cache = {}
def reset(): """Reset the cache completely.""" global cache cache = {}
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
if cache.has_key(path):
try:
def forget(path): """Remove a given item from the cache, if it exists.""" if cache.has_key(path): del cache[path]
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
except KeyError: pass
def forget(path): """Remove a given item from the cache, if it exists.""" if cache.has_key(path): del cache[path]
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
n = len(prefix)
def forget_prefix(prefix): """Remove all pathnames with a given prefix.""" n = len(prefix) for path in cache.keys(): if path[:n] == prefix: del cache[path]
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
if path[:n] == prefix: del cache[path]
if path.startswith(prefix): forget(path)
def forget_prefix(prefix): """Remove all pathnames with a given prefix.""" n = len(prefix) for path in cache.keys(): if path[:n] == prefix: del cache[path]
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
"""Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1]
"""Forget a directory and all entries except for entries in subdirs.""" from os.path import split, join prefix = split(join(prefix, "xxx"))[0]
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:...
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix)
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:...
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
if path[:n] == prefix: rest = path[n:] if rest[-1:] == '/': rest = rest[:-1] if '/' not in rest: del cache[path]
if path.startswith(prefix) and split(path)[0] == prefix: forget(path)
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:...
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
Normally used with prefix = '/' after a chdir().""" n = len(prefix)
Normally used with prefix = '/' after a chdir(). """
def forget_except_prefix(prefix): """Remove all pathnames except with a given prefix. Normally used with prefix = '/' after a chdir().""" n = len(prefix) for path in cache.keys(): if path[:n] != prefix: del cache[path]
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
if path[:n] != prefix: del cache[path]
if not path.startswith(prefix): forget(path)
def forget_except_prefix(prefix): """Remove all pathnames except with a given prefix. Normally used with prefix = '/' after a chdir().""" n = len(prefix) for path in cache.keys(): if path[:n] != prefix: del cache[path]
691b5d030c27adb759c16e456c7f3e5a30c73adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/691b5d030c27adb759c16e456c7f3e5a30c73adc/statcache.py
weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] def date_time(self): """Return the current date and time formatted for a MIME header.""" year, month, day, hh, mm, ss, wd, y, z = time.gmtime(time.time...
def getSubject(self, record): """ Determine the subject for the email.
fa40495bcd0f09d23a4766459e53a77ff2849ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa40495bcd0f09d23a4766459e53a77ff2849ea5/handlers.py
self.date_time(), msg)
formatdate(), msg)
def emit(self, record): """ Emit a record.
fa40495bcd0f09d23a4766459e53a77ff2849ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa40495bcd0f09d23a4766459e53a77ff2849ea5/handlers.py
print 'XXX', (_function, (_object,), _parameters)
def callback_wrapper(self, _request, _reply): _parameters, _attributes = aetools.unpackevent(_request) _class = _attributes['evcl'].type _type = _attributes['evid'].type if self.ae_handlers.has_key((_class, _type)): _function = self.ae_handlers[(_class, _type)] elif self.ae_handlers.has_key((_class, '****')): _functio...
7bfe0b88bbf91207d8371b2fc56aaf67fa053369 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7bfe0b88bbf91207d8371b2fc56aaf67fa053369/MiniAEFrame.py
des = "_%s__%s" % (klass.__name__, name)
des = "1"
def adaptgetter(name, klass, getter): kind, des = getter if kind == 1: # AV happens when stepping from this line to next if des == "": des = "_%s__%s" % (klass.__name__, name) return lambda obj: getattr(obj, des)
a76a1687679135ea3214420500eebadd56ca90c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a76a1687679135ea3214420500eebadd56ca90c4/test_scope.py
print "20. eval with free variables"
print "20. eval and exec with free variables"
def adaptgetter(name, klass, getter): kind, des = getter if kind == 1: # AV happens when stepping from this line to next if des == "": des = "_%s__%s" % (klass.__name__, name) return lambda obj: getattr(obj, des)
a76a1687679135ea3214420500eebadd56ca90c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a76a1687679135ea3214420500eebadd56ca90c4/test_scope.py
return apply(pow, params)
return pow(*params)
def _dispatch(self, method, params): if method == 'pow': return apply(pow, params) elif method == 'add': return params[0] + params[1] else: raise 'bad method'
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
4. Subclass SimpleXMLRPCRequestHandler: class MathHandler(SimpleXMLRPCRequestHandler):
4. Subclass SimpleXMLRPCServer: class MathServer(SimpleXMLRPCServer):
def _dispatch(self, method, params): if method == 'pow': return apply(pow, params) elif method == 'add': return params[0] + params[1] else: raise 'bad method'
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
return apply(func, params) def log_message(self, format, *args): pass
return func(*params)
def _dispatch(self, method, params): try: # We are forcing the 'export_' prefix on methods that are # callable through XML-RPC to prevent potential security # problems func = getattr(self, 'export_' + method) except AttributeError: raise Exception('method "%s" is not supported' % method) else: return apply(func, params...
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
server = SimpleXMLRPCServer(("localhost", 8000), MathHandler)
server = MathServer(("localhost", 8000))
def export_add(self, x, y): return x + y
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
import types import os def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(a, 'b.c.d') => a.b.c.d Resolves a dotted attribute name to an object. Raises an AttributeError if any attribute in the chain starts with a '_'. """ for i in attr.split('.'): if i.startswith('_'): raise AttributeError( 'attem...
def export_add(self, x, y): return x + y
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
XML-RPC requests are dispatched to the _dispatch method, which may be overriden by subclasses. The default implementation attempts to dispatch XML-RPC calls to the functions or instance installed in the server.
def export_add(self, x, y): return x + y
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
which are forwarded to the _dispatch method for handling. """
which are forwarded to the server's _dispatch method for handling. """
def do_POST(self): """Handles the HTTP POST request.
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
params, method = xmlrpclib.loads(data) try: response = self._dispatch(method, params) response = (response,) except: response = xmlrpclib.dumps( xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)) ) else: response = xmlrpclib.dumps(response, methodresponse=1) except:
response = self.server._marshaled_dispatch( data, getattr(self, '_dispatch', None) ) except:
def do_POST(self): """Handles the HTTP POST request.
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
def _dispatch(self, method, params): """Dispatches the XML-RPC method. XML-RPC calls are forwarded to a registered function that matches the called XML-RPC method name. If no such function exists then the call is forwarded to the registered instance, if available. If the registered instance has a _dispatch method th...
def do_POST(self): """Handles the HTTP POST request.
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
def _resolve_dotted_attribute(obj, attr): """Resolves a dotted attribute name to an object. Raises an AttributeError if any attribute in the chain starts with a '_'. """ for i in attr.split('.'): if i.startswith('_'): raise AttributeError( 'attempt to access private attribute "%s"' % i ) else: obj = getattr(obj,i) re...
class SimpleXMLRPCServer(SocketServer.TCPServer, SimpleXMLRPCDispatcher):
def log_request(self, code='-', size='-'): """Selectively log an accepted request."""
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
to be installed to handle requests.
to be installed to handle requests. The default implementation attempts to dispatch XML-RPC calls to the functions or instance installed in the server. Override the _dispatch method inhereted from SimpleXMLRPCDispatcher to change this behavior.
def _resolve_dotted_attribute(obj, attr): """Resolves a dotted attribute name to an object. Raises an AttributeError if any attribute in the chain starts with a '_'. """ for i in attr.split('.'): if i.startswith('_'): raise AttributeError( 'attempt to access private attribute "%s"' % i ) else: obj = getattr(obj,i) ret...
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
self.funcs = {}
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.funcs = {} self.logRequests = logRequests self.instance = None SocketServer.TCPServer.__init__(self, addr, requestHandler)
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
self.instance = None
SimpleXMLRPCDispatcher.__init__(self)
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.funcs = {} self.logRequests = logRequests self.instance = None SocketServer.TCPServer.__init__(self, addr, requestHandler)
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
def register_instance(self, instance): """Registers an instance to respond to XML-RPC requests. Only one instance can be installed at a time. If the registered instance has a _dispatch method then that method will be called with the name of the XML-RPC method and it's parameters as a tuple e.g. instance._dispatch('a...
class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): """Simple handler for XML-RPC data passed through CGI.""" def __init__(self): SimpleXMLRPCDispatcher.__init__(self) def handle_xmlrpc(self, request_text): """Handle a single XML-RPC request""" response = self._marshaled_dispatch(request_text) print 'Content-Ty...
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.funcs = {} self.logRequests = logRequests self.instance = None SocketServer.TCPServer.__init__(self, addr, requestHandler)
296497a20942d024558fc4b2a9158f4567167ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/296497a20942d024558fc4b2a9158f4567167ac9/SimpleXMLRPCServer.py
def do_clear_break(self, arg): if not arg: self.do_clear("") return arg = string.strip(arg) args = string.split(arg) if len(args) < 2: print '*** Specify file and line number.' return try: line = int(args[1]) except: print '*** line number must be an integer.' return result =self.clear_break(args[0], line) if result:...
def do_clear(self, arg): # Three possibilities, tried in this order: # clear -> clear all breaks, ask for confirmation # clear file:lineno -> clear all breaks at file:lineno # clear bpno bpno ... -> clear breakpoints by number if not arg: try: reply = raw_input('Clear all breaks? ') except EOFError: reply = 'no' reply ...
6b7f13436232c276ca48a2cb5601e3d66be404d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b7f13436232c276ca48a2cb5601e3d66be404d8/pdb.py
return apply(Open, (), options).show()
return Open(**options).show()
def askopenfilename(**options): "Ask for a filename to open" return apply(Open, (), options).show()
1cc71b5984818fb34614228a4f49c9b9e0583cb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cc71b5984818fb34614228a4f49c9b9e0583cb6/tkFileDialog.py
return apply(SaveAs, (), options).show()
return SaveAs(**options).show()
def asksaveasfilename(**options): "Ask for a filename to save as" return apply(SaveAs, (), options).show()
1cc71b5984818fb34614228a4f49c9b9e0583cb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cc71b5984818fb34614228a4f49c9b9e0583cb6/tkFileDialog.py
filename = apply(Open, (), options).show()
filename = Open(**options).show()
def askopenfile(mode = "r", **options): "Ask for a filename to open, and returned the opened file" filename = apply(Open, (), options).show() if filename: return open(filename, mode) return None
1cc71b5984818fb34614228a4f49c9b9e0583cb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cc71b5984818fb34614228a4f49c9b9e0583cb6/tkFileDialog.py
filename = apply(SaveAs, (), options).show()
filename = SaveAs(**options).show()
def asksaveasfile(mode = "w", **options): "Ask for a filename to save as, and returned the opened file" filename = apply(SaveAs, (), options).show() if filename: return open(filename, mode) return None
1cc71b5984818fb34614228a4f49c9b9e0583cb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cc71b5984818fb34614228a4f49c9b9e0583cb6/tkFileDialog.py
- reuse_address
- allow_reuse_address
def handle_error(self, request, client_address): """Handle an error gracefully. May be overridden.
12a588f341cc644bc348f9d0d34e2f163e5fc0dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/12a588f341cc644bc348f9d0d34e2f163e5fc0dd/SocketServer.py
Technically, only a <mailbox> is allowed. In addition, email addresses without a domain are permitted. Addresses will not be modified if they are already quoted (actually if they begin with '<' and end with '>'.""" if re.match('(?s)\A<.*>\Z', addr):
Should be able to handle anything rfc822.parseaddr can handle.""" m=None try: m=rfc822.parseaddr(addr)[1] except AttributeError: pass if not m:
def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Technically, only a <mailbox> is allowed. In addition, email addresses without a domain are permitted. Addresses will not be modified if they are already quoted (actually if they begin with '<' and end with '>'.""" if re.match('(?s)\A<...
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
localpart = None domain = '' try: at = string.rindex(addr, '@') localpart = addr[:at] domain = addr[at:] except ValueError: localpart = addr pat = re.compile(r'([<>()\[\]\\,;:@\"\001-\037\177])') return '<%s%s>' % (pat.sub(r'\\\1', localpart), domain)
else: return "<%s>" % m
def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Technically, only a <mailbox> is allowed. In addition, email addresses without a domain are permitted. Addresses will not be modified if they are already quoted (actually if they begin with '<' and end with '>'.""" if re.match('(?s)\A<...
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
Double leading '.', and change Unix newline '\n' into
Double leading '.', and change Unix newline '\n', or Mac '\r' into
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data))
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
re.sub(r'\r?\n', CRLF, data))
re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data))
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
"""This class manages a connection to an SMTP or ESMTP server."""
"""This class manages a connection to an SMTP or ESMTP server. SMTP Objects: SMTP objects have the following attributes: helo_resp This is the message given by the server in responce to the most recent HELO command. ehlo_resp This is the message given by the server in responce to the most recent EHLO command. This is ...
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data))
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
esmtp_features = []
does_esmtp = 0
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data))
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
def verify(self, address): """ SMTP 'verify' command. Checks for address validity. """ self.putcmd("vrfy", address) return self.getreply()
def verify(self, address): """ SMTP 'verify' command. Checks for address validity. """ self.putcmd("vrfy", address) return self.getreply()
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
that suffix will be stripped off and the number interpreted as the port number to use.
and there is no port specified, that suffix will be stripped off and the number interpreted as the port number to use.
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
self.sock.send(str)
try: self.sock.send(str) except socket.error: raise SMTPServerDisconnected
def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', `str` if self.sock: self.sock.send(str) else: raise SMTPServerDisconnected
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
def getreply(self, linehook=None):
def getreply(self):
def getreply(self, linehook=None): """Get a reply from the server. Returns a tuple consisting of: - server response code (e.g. '250', or such, if all goes well) Note: returns -1 if it can't read response code. - server response string corresponding to response code (note : multiline responses converted to a single, mu...
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
elif linehook: linehook(line)
def getreply(self, linehook=None): """Get a reply from the server. Returns a tuple consisting of: - server response code (e.g. '250', or such, if all goes well) Note: returns -1 if it can't read response code. - server response string corresponding to response code (note : multiline responses converted to a single, mu...
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
defaults to the FQDN of the local host """
defaults to the FQDN of the local host. """
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(self.ehlo_hook) self.ehlo_resp=msg return code
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
(code,msg)=self.getreply(self.ehlo_hook)
(code,msg)=self.getreply() if code == -1 and len(msg) == 0: raise SMTPServerDisconnected
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(self.ehlo_hook) self.ehlo_resp=msg return code
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
def ehlo_hook(self, line): if line[4] in string.uppercase+string.digits: self.esmtp_features.append(string.lower(string.strip(line)[4:])) def has_option(self, opt): """Does the server support a given SMTP option?""" return opt in self.esmtp_features
def has_extn(self, opt): """Does the server support a given SMTP service extension?""" return self.esmtp_features.has_key(string.lower(opt))
def ehlo_hook(self, line): # Interpret EHLO response lines if line[4] in string.uppercase+string.digits: self.esmtp_features.append(string.lower(string.strip(line)[4:]))
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
if options: options = " " + string.joinfields(options, ' ') else: options = '' self.putcmd("mail", "from:" + quoteaddr(sender) + options)
optionlist = '' if options and self.does_esmtp: optionlist = string.join(options, ' ') self.putcmd("mail", "FROM:%s %s" % (quoteaddr(sender) ,optionlist))
def mail(self,sender,options=[]): """ SMTP 'mail' command. Begins mail xfer session. """ if options: options = " " + string.joinfields(options, ' ') else: options = '' self.putcmd("mail", "from:" + quoteaddr(sender) + options) return self.getreply()
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
def rcpt(self,recip):
def rcpt(self,recip,options=[]):
def rcpt(self,recip): """ SMTP 'rcpt' command. Indicates 1 recipient for this mail. """ self.putcmd("rcpt","to:%s" % quoteaddr(recip)) return self.getreply()
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
self.putcmd("rcpt","to:%s" % quoteaddr(recip))
optionlist = '' if options and self.does_esmtp: optionlist = string.join(options, ' ') self.putcmd("rcpt","TO:%s %s" % (quoteaddr(recip),optionlist))
def rcpt(self,recip): """ SMTP 'rcpt' command. Indicates 1 recipient for this mail. """ self.putcmd("rcpt","to:%s" % quoteaddr(recip)) return self.getreply()
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
def sendmail(self,from_addr,to_addrs,msg,options=[]):
def sendmail(self,from_addr,to_addrs,msg,mail_options=[],rcpt_options=[]):
def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime)
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
- encoding : list of ESMTP options (such as 8bitmime)
- mail_options : list of ESMTP options (such as 8bitmime) for the mail command - rcpt_options : List of ESMTP options (such as DSN commands) for all the rcpt commands
def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime)
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
size and each of the specified options will be passed to it (if the option is in the feature set the server advertises). If EHLO fails, HELO will be tried and ESMTP options suppressed.
size and each of the specified options will be passed to it. If EHLO fails, HELO will be tried and ESMTP options suppressed.
def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime)
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
if self.esmtp_features: self.esmtp_features.append('7bit')
def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime)
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
if 'size' in self.esmtp_features: esmtp_opts.append("size=" + `len(msg)`) for option in options: if option in self.esmtp_features:
if self.does_esmtp: if self.has_extn('size'): esmtp_opts.append("size=" + `len(msg)`) for option in mail_options:
def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime)
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py
(code,resp)=self.rcpt(each)
(code,resp)=self.rcpt(each, rcpt_options)
def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime)
2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.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...
c0a91d68d80b1d0925d371ac5860d958063f24c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c0a91d68d80b1d0925d371ac5860d958063f24c4/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...
c0a91d68d80b1d0925d371ac5860d958063f24c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c0a91d68d80b1d0925d371ac5860d958063f24c4/os.py
rm(filename + '.dir') rm(filename + '.dat') rm(filename + '.bak')
def test_dumbdbm_read(self): f = dumbdbm.open(self._fname, 'r') self.read_helper(f) f.close() def test_dumbdbm_keys(self): f = dumbdbm.open(self._fname) keys = self.keys_helper(f) f.close() def read_helper(self, f): keys = self.keys_helper(f) for key in self._dict: self.assertEqual(self._dict[key], f[key]) def keys_...
def rm(fn): try: os.unlink(fn) except os.error: pass
96222f9d9d953cf0b86bc98188ecba5f03f21c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96222f9d9d953cf0b86bc98188ecba5f03f21c64/test_dumbdbm.py
print 'Start element:\n\t', name, attrs
print 'Start element:\n\t', name, attrs
def StartElementHandler(self, name, attrs):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'End element:\n\t', name
print 'End element:\n\t', name
def EndElementHandler(self, name):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'PI:\n\t', target, data
print 'PI:\n\t', target, data
def ProcessingInstructionHandler(self, target, data):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'NS decl:\n\t', prefix, uri
print 'NS decl:\n\t', prefix, uri
def StartNamespaceDeclHandler(self, prefix, uri):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'End of NS decl:\n\t', prefix
print 'End of NS decl:\n\t', prefix
def EndNamespaceDeclHandler(self, prefix):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'Start of CDATA section'
print 'Start of CDATA section'
def StartCdataSectionHandler(self):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'End of CDATA section'
print 'End of CDATA section'
def EndCdataSectionHandler(self):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'Comment:\n\t', repr(text)
print 'Comment:\n\t', repr(text)
def CommentHandler(self, text):
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
print 'Notation declared:', args
print 'Notation declared:', args
def NotationDeclHandler(self, *args): name, base, sysid, pubid = args
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
'CharacterDataHandler', 'ProcessingInstructionHandler', 'UnparsedEntityDeclHandler', 'NotationDeclHandler', 'StartNamespaceDeclHandler', 'EndNamespaceDeclHandler', 'CommentHandler', 'StartCdataSectionHandler', 'EndCdataSectionHandler',
'CharacterDataHandler', 'ProcessingInstructionHandler', 'UnparsedEntityDeclHandler', 'NotationDeclHandler', 'StartNamespaceDeclHandler', 'EndNamespaceDeclHandler', 'CommentHandler', 'StartCdataSectionHandler', 'EndCdataSectionHandler',
def DefaultHandlerExpand(self, userData): pass
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
'ExternalEntityRefHandler'
'ExternalEntityRefHandler'
def DefaultHandlerExpand(self, userData): pass
b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7b7c8b86da0abbf3e1f9479a65bd9b3904e1eaa/test_pyexpat.py
kControlProgressBarIndeterminateTag = 'inde'
def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262): """Display a QUESTION string which can be answered with Yes or No. Return 1 when the user clicks the Yes button. Return 0 when the user clicks the No button. Return -1 when the user clicks the Cancel button. When the user presses Retur...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
def __init__(self, title="Working...", maxval=100, label="", id=263):
def __init__(self, title="Working...", maxval=0, label="", id=263):
def __init__(self, title="Working...", maxval=100, label="", id=263): self.w = None self.d = None self.maxval = maxval self.curval = -1 self.d = GetNewDialog(id, -1) self.w = self.d.GetDialogWindow() self.label(label) self._update(0) self.d.AutoSizeDialog() self.title(title) self.w.ShowWindow() self.d.DrawDialog()
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
self.maxval = maxval self.curval = -1
def __init__(self, title="Working...", maxval=100, label="", id=263): self.w = None self.d = None self.maxval = maxval self.curval = -1 self.d = GetNewDialog(id, -1) self.w = self.d.GetDialogWindow() self.label(label) self._update(0) self.d.AutoSizeDialog() self.title(title) self.w.ShowWindow() self.d.DrawDialog()
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
self._update(0)
self.title(title) self.set(0, maxval)
def __init__(self, title="Working...", maxval=100, label="", id=263): self.w = None self.d = None self.maxval = maxval self.curval = -1 self.d = GetNewDialog(id, -1) self.w = self.d.GetDialogWindow() self.label(label) self._update(0) self.d.AutoSizeDialog() self.title(title) self.w.ShowWindow() self.d.DrawDialog()
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
self.title(title)
def __init__(self, title="Working...", maxval=100, label="", id=263): self.w = None self.d = None self.maxval = maxval self.curval = -1 self.d = GetNewDialog(id, -1) self.w = self.d.GetDialogWindow() self.label(label) self._update(0) self.d.AutoSizeDialog() self.title(title) self.w.ShowWindow() self.d.DrawDialog()
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
SetDialogItemText(text_h, self._label)
SetDialogItemText(text_h, self._label)
def label( self, *newstr ): """label(text) - Set text in progress box""" self.w.BringToFront() if newstr: self._label = lf2cr(newstr[0]) text_h = self.d.GetDialogItemAsControl(2) SetDialogItemText(text_h, self._label)
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
if maxval == 0: value = 0 maxval = 1 if maxval > 32767: value = int(value/(maxval/32767.0)) maxval = 32767 progbar = self.d.GetDialogItemAsControl(3) progbar.SetControlMaximum(maxval) progbar.SetControlValue(value)
if maxval == 0: Ctl.IdleControls(self.w) else: if maxval > 32767: value = int(value/(maxval/32767.0)) maxval = 32767 progbar = self.d.GetDialogItemAsControl(3) progbar.SetControlMaximum(maxval) progbar.SetControlValue(value)
def _update(self, value): maxval = self.maxval if maxval == 0: # XXXX Quick fix. Should probably display an unknown duration value = 0 maxval = 1 if maxval > 32767: value = int(value/(maxval/32767.0)) maxval = 32767 progbar = self.d.GetDialogItemAsControl(3) progbar.SetControlMaximum(maxval) progbar.SetControlValue(val...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
def _update(self, value): maxval = self.maxval if maxval == 0: # XXXX Quick fix. Should probably display an unknown duration value = 0 maxval = 1 if maxval > 32767: value = int(value/(maxval/32767.0)) maxval = 32767 progbar = self.d.GetDialogItemAsControl(3) progbar.SetControlMaximum(maxval) progbar.SetControlValue(val...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
if ready :
if ready :
def _update(self, value): maxval = self.maxval if maxval == 0: # XXXX Quick fix. Should probably display an unknown duration value = 0 maxval = 1 if maxval > 32767: value = int(value/(maxval/32767.0)) maxval = 32767 progbar = self.d.GetDialogItemAsControl(3) progbar.SetControlMaximum(maxval) progbar.SetControlValue(val...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
if value < 0: value = 0 if value > self.maxval: value = self.maxval
bar = self.d.GetDialogItemAsControl(3) if max <= 0: bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x01') else: bar.SetControlData(0,kControlProgressBarIndeterminateTag,'\x00') if value < 0: value = 0 elif value > self.maxval: value = self.maxval
def set(self, value, max=None): """set(value) - Set progress bar position""" if max != None: self.maxval = max if value < 0: value = 0 if value > self.maxval: value = self.maxval self.curval = value self._update(value)
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
text = ( "Working Hard...", "Hardly Working..." ,
text = ( "Working Hard...", "Hardly Working..." ,
def test(): import time, sys Message("Testing EasyDialogs.") optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'), ('flags=', 'Valued option'), ('f:', 'Short valued option')) commandlist = (('start', 'Start something'), ('stop', 'Stop something')) argv = GetArgv(optionlist=optionlist, commandlist=comm...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
bar = ProgressBar("Progress, progress...", 100)
bar = ProgressBar("Progress, progress...", 0, label="Ramping up...")
def test(): import time, sys Message("Testing EasyDialogs.") optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'), ('flags=', 'Valued option'), ('f:', 'Short valued option')) commandlist = (('start', 'Start something'), ('stop', 'Stop something')) argv = GetArgv(optionlist=optionlist, commandlist=comm...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
for i in range(100):
for i in xrange(20): bar.inc() time.sleep(0.05) bar.set(0,100) for i in xrange(100):
def test(): import time, sys Message("Testing EasyDialogs.") optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'), ('flags=', 'Valued option'), ('f:', 'Short valued option')) commandlist = (('start', 'Start something'), ('stop', 'Stop something')) argv = GetArgv(optionlist=optionlist, commandlist=comm...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
time.sleep(0.1)
time.sleep(0.05)
def test(): import time, sys Message("Testing EasyDialogs.") optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'), ('flags=', 'Valued option'), ('f:', 'Short valued option')) commandlist = (('start', 'Start something'), ('stop', 'Stop something')) argv = GetArgv(optionlist=optionlist, commandlist=comm...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
time.sleep(0.3)
time.sleep(1.0)
def test(): import time, sys Message("Testing EasyDialogs.") optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'), ('flags=', 'Valued option'), ('f:', 'Short valued option')) commandlist = (('start', 'Start something'), ('stop', 'Stop something')) argv = GetArgv(optionlist=optionlist, commandlist=comm...
b48dea14d8bf7cc4ae844d70574494af7a698ddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b48dea14d8bf7cc4ae844d70574494af7a698ddb/EasyDialogs.py
"install-base or install-platbase supplied, but " + \ "installation scheme is incomplete"
("install-base or install-platbase supplied, but " "installation scheme is incomplete")
def finalize_unix (self):
0e3d62f34dbd113de991760f567eb5f192ddb4d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0e3d62f34dbd113de991760f567eb5f192ddb4d6/install.py
"'extra_path' option must be a list, tuple, or " + \ "comma-separated string with 1 or 2 elements"
("'extra_path' option must be a list, tuple, or " "comma-separated string with 1 or 2 elements")
def handle_extra_path (self):
0e3d62f34dbd113de991760f567eb5f192ddb4d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0e3d62f34dbd113de991760f567eb5f192ddb4d6/install.py
self.warn(("modules installed to '%s', which is not in " + "Python's module search path (sys.path) -- " + "you'll have to change the search path yourself") % self.install_lib)
log.debug(("modules installed to '%s', which is not in " "Python's module search path (sys.path) -- " "you'll have to change the search path yourself"), self.install_lib)
def run (self):
0e3d62f34dbd113de991760f567eb5f192ddb4d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0e3d62f34dbd113de991760f567eb5f192ddb4d6/install.py
def get_outputs (self): # This command doesn't have any outputs of its own, so just # get the outputs of all its sub-commands. outputs = [] for cmd_name in self.get_sub_commands(): cmd = self.get_finalized_command(cmd_name) # Add the contents of cmd.get_outputs(), ensuring # that outputs doesn't contain duplicate entri...
0fbe916ac41ec57011b302c7eb7849c72baa952d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0fbe916ac41ec57011b302c7eb7849c72baa952d/install.py
data, width, height, bytesperpixel = jpeg.decompress(data)
data, width, height, bytesperpixel = jpeg.decompress(img)
def jpeggrey2grey(img, width, height): import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 1: raise RuntimeError, 'not grayscale jpeg' return data
14dc90ec596bd9f41b3a73817adf5a55826a463c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14dc90ec596bd9f41b3a73817adf5a55826a463c/imgconv.py
data, width, height, bytesperpixel = jpeg.decompress(data)
data, width, height, bytesperpixel = jpeg.decompress(img)
def jpeg2rgb(img, width, height): import cl, CL import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 4: raise RuntimeError, 'not rgb jpeg' return data
14dc90ec596bd9f41b3a73817adf5a55826a463c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14dc90ec596bd9f41b3a73817adf5a55826a463c/imgconv.py
('grey', 'jpeggrey',grey2jpeggrey, NOT_LOSSY), \
('grey', 'jpeggrey',grey2jpeggrey, LOSSY), \
def jpeg2rgb(img, width, height): import cl, CL import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 4: raise RuntimeError, 'not rgb jpeg' return data
14dc90ec596bd9f41b3a73817adf5a55826a463c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14dc90ec596bd9f41b3a73817adf5a55826a463c/imgconv.py
('rgb', 'jpeg', rgb2jpeg, NOT_LOSSY), \
('rgb', 'jpeg', rgb2jpeg, LOSSY), \
def jpeg2rgb(img, width, height): import cl, CL import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 4: raise RuntimeError, 'not rgb jpeg' return data
14dc90ec596bd9f41b3a73817adf5a55826a463c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14dc90ec596bd9f41b3a73817adf5a55826a463c/imgconv.py
def constant_red_generator(numchips, rgbtuple): red = rgbtuple[0]
def constant_cyan_generator(numchips, rgbtuple): red, green, blue = rgbtuple
def constant_red_generator(numchips, rgbtuple): red = rgbtuple[0] seq = constant(numchips) return map(None, [red] * numchips, seq, seq)
e10878d5f8603091dc00ff8dc60580c3215dc39a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e10878d5f8603091dc00ff8dc60580c3215dc39a/PyncheWidget.py
return map(None, [red] * numchips, seq, seq)
return map(None, seq, [green] * numchips, [blue] * numchips)
def constant_red_generator(numchips, rgbtuple): red = rgbtuple[0] seq = constant(numchips) return map(None, [red] * numchips, seq, seq)
e10878d5f8603091dc00ff8dc60580c3215dc39a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e10878d5f8603091dc00ff8dc60580c3215dc39a/PyncheWidget.py
def constant_green_generator(numchips, rgbtuple): green = rgbtuple[1]
def constant_magenta_generator(numchips, rgbtuple): red, green, blue = rgbtuple
def constant_green_generator(numchips, rgbtuple): green = rgbtuple[1] seq = constant(numchips) return map(None, seq, [green] * numchips, seq)
e10878d5f8603091dc00ff8dc60580c3215dc39a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e10878d5f8603091dc00ff8dc60580c3215dc39a/PyncheWidget.py