rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
return self._longcmd('LIST %s' % which)
return self._shortcmd('LIST %s' % which)
def list(self, which=None): """Request listing, return result. Result is in form ['response', ['mesg_num octets', ...]].
f6ae743cb53a2953c7fb063963ec48029206c8b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f6ae743cb53a2953c7fb063963ec48029206c8b0/poplib.py
def __init__(self, out=None):
def __init__(self, out=None, encoding="iso-8859-1"):
def __init__(self, out=None): if out is None: import sys out = sys.stdout handler.ContentHandler.__init__(self) self._out = out
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
self._out.write('<?xml version="1.0" encoding="iso-8859-1"?>\n')
self._out.write('<?xml version="1.0" encoding="%s"?>\n' % self._encoding)
def startDocument(self): self._out.write('<?xml version="1.0" encoding="iso-8859-1"?>\n')
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
pass
self._ns_contexts.append(self._current_context.copy()) self._current_context[uri] = prefix
def startPrefixMapping(self, prefix, uri): pass
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
pass
del self._current_context[-1]
def endPrefixMapping(self, prefix): pass
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname)
def startElement(self, name, attrs): if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname) self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>')
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
def startElement(self, name, attrs): if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname) self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>')
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
def endElement(self, name): # FIXME: not namespace friendly yet self._out.write('</%s>' % name)
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
def endElement(self, name, qname): self._cont_handler.endElement(name, qname)
def endElement(self, name): self._cont_handler.endElement(name) def startElementNS(self, name, qname, attrs): self._cont_handler.startElement(name, attrs) def endElementNS(self, name, qname): self._cont_handler.endElementNS(name, qname)
def endElement(self, name, qname): self._cont_handler.endElement(name, qname)
c5cec51b95dadf0740c0c10260ae5011a4bb3ea5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c5cec51b95dadf0740c0c10260ae5011a4bb3ea5/saxutils.py
if cfg_target != cur_target:
elif map(int, cfg_target.split('.')) > map(int, cur_target.split('.')):
def _init_posix(): """Initialize the module as appropriate for POSIX systems.""" g = {} # load the installed Makefile: try: filename = get_makefile_filename() parse_makefile(filename, g) except IOError, msg: my_msg = "invalid Python installation: unable to open %s" % filename if hasattr(msg, "strerror"): my_msg = my_ms...
59075eb264becaa8279f81a90846e8c248033c32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59075eb264becaa8279f81a90846e8c248033c32/sysconfig.py
if len(result) > 1:
if use_all or len(result) > 1:
def group(self, *groups):
531097502cc549a8ec5bbe29c90e7b8850cbff24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/531097502cc549a8ec5bbe29c90e7b8850cbff24/re.py
self.assertRaises(TypeError, list, chain(N(s)))
self.assertRaises(TypeError, chain, N(s))
def test_chain(self): for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(chain(g(s))), list(g(s))) self.assertEqual(list(chain(g(s), g(s))), list(g(s))+list(g(s))) self.assertRaises(TypeError, chain, X(s)) self.assertRaises(TypeError, list, chain(N(s...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, cycle(N(s)))
self.assertRaises(TypeError, cycle, N(s))
def test_cycle(self): for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): tgtlen = len(s) * 3 expected = list(g(s))*3 actual = list(islice(cycle(g(s)), tgtlen)) self.assertEqual(actual, expected) self.assertRaises(TypeError, cycle, X(s)) self.assertRaises(TypeError, list, ...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, groupby(N(s)))
self.assertRaises(TypeError, groupby, N(s))
def test_groupby(self): for s in (range(10), range(0), range(1000), (7,11), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual([k for k, sb in groupby(g(s))], list(g(s))) self.assertRaises(TypeError, groupby, X(s)) self.assertRaises(TypeError, list, groupby(N(s))) self.assertRaises(ZeroDivisionError, ...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, ifilter(isEven, N(s)))
self.assertRaises(TypeError, ifilter, isEven, N(s))
def test_ifilter(self): for s in (range(10), range(0), range(1000), (7,11), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(ifilter(isEven, g(s))), filter(isEven, g(s))) self.assertRaises(TypeError, ifilter, isEven, X(s)) self.assertRaises(TypeError, list, ifilter(isEven, N(s))) self.assertRai...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, ifilterfalse(isEven, N(s)))
self.assertRaises(TypeError, ifilterfalse, isEven, N(s))
def test_ifilterfalse(self): for s in (range(10), range(0), range(1000), (7,11), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(ifilterfalse(isEven, g(s))), filter(isOdd, g(s))) self.assertRaises(TypeError, ifilterfalse, isEven, X(s)) self.assertRaises(TypeError, list, ifilterfalse(isEven, N(...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, izip(N(s)))
self.assertRaises(TypeError, izip, N(s))
def test_izip(self): for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(izip(g(s))), zip(g(s))) self.assertEqual(list(izip(g(s), g(s))), zip(g(s), g(s))) self.assertRaises(TypeError, izip, X(s)) self.assertRaises(TypeError, list, izip(N(s))) self.ass...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, imap(onearg, N(s)))
self.assertRaises(TypeError, imap, onearg, N(s))
def test_imap(self): for s in (range(10), range(0), range(100), (7,11), xrange(20,50,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(imap(onearg, g(s))), map(onearg, g(s))) self.assertEqual(list(imap(operator.pow, g(s), g(s))), map(operator.pow, g(s), g(s))) self.assertRaises(TypeError, imap, onearg, X(s)) sel...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, islice(N(s), 10))
self.assertRaises(TypeError, islice, N(s), 10)
def test_islice(self): for s in ("12345", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(islice(g(s),1,None,2)), list(g(s))[1::2]) self.assertRaises(TypeError, islice, X(s), 10) self.assertRaises(TypeError, list, islice(N(s), 10)) self.assertRaises(ZeroDivisionEr...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, starmap(operator.pow, N(ss)))
self.assertRaises(TypeError, starmap, operator.pow, N(ss))
def test_starmap(self): for s in (range(10), range(0), range(100), (7,11), xrange(20,50,5)): for g in (G, I, Ig, S, L, R): ss = zip(s, s) self.assertEqual(list(starmap(operator.pow, g(ss))), map(operator.pow, g(s), g(s))) self.assertRaises(TypeError, starmap, operator.pow, X(ss)) self.assertRaises(TypeError, list, star...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, takewhile(isEven, N(s)))
self.assertRaises(TypeError, takewhile, isEven, N(s))
def test_takewhile(self): for s in (range(10), range(0), range(1000), (7,11), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): tgt = [] for elem in g(s): if not isEven(elem): break tgt.append(elem) self.assertEqual(list(takewhile(isEven, g(s))), tgt) self.assertRaises(TypeError, takewhile, isEven, X(s)) self.assertR...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, dropwhile(isOdd, N(s)))
self.assertRaises(TypeError, dropwhile, isOdd, N(s))
def test_dropwhile(self): for s in (range(10), range(0), range(1000), (7,11), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): tgt = [] for elem in g(s): if not tgt and isOdd(elem): continue tgt.append(elem) self.assertEqual(list(dropwhile(isOdd, g(s))), tgt) self.assertRaises(TypeError, dropwhile, isOdd, X(s)) self...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.py
self.assertRaises(TypeError, list, tee(N(s))[0])
self.assertRaises(TypeError, tee, N(s))
def test_tee(self): for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): it1, it2 = tee(g(s)) self.assertEqual(list(it1), list(g(s))) self.assertEqual(list(it2), list(g(s))) self.assertRaises(TypeError, tee, X(s)) self.assertRaises(TypeError, list, tee(N(s))[0]) self.assert...
8690c4ed3fa1f1889459249c7e50e11c2052b340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8690c4ed3fa1f1889459249c7e50e11c2052b340/test_itertools.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'
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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'
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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...
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/SimpleXMLRPCServer.py
server = SimpleXMLRPCServer(("localhost", 8000), MathHandler)
server = MathServer(("localhost", 8000))
def export_add(self, x, y): return x + y
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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.
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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.
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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.
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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."""
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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...
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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)
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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)
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/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)
d69663d3009b6718ed3fa27dec800d15c7d4babb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d69663d3009b6718ed3fa27dec800d15c7d4babb/SimpleXMLRPCServer.py
dir = f[0]
dir = convert_path(f[0])
def run (self): self.mkpath(self.install_dir) for f in self.data_files: if type(f) == StringType: # it's a simple file, so copy it if self.warn_dir: self.warn("setup script did not provide a directory for " "'%s' -- installing right in '%s'" % (f, self.install_dir)) (out, _) = self.copy_file(f, self.install_dir) self.o...
a221b2a7a961e611bd89988693c4372fb522e7bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a221b2a7a961e611bd89988693c4372fb522e7bf/install_data.py
mod = imp.new_module(fullname) sys.modules[fullname] = mod
mod = sys.modules.setdefault(fullname,imp.new_module(fullname))
def load_module(self, fullname): ispkg, code = self.modules[fullname] mod = imp.new_module(fullname) sys.modules[fullname] = mod mod.__file__ = "<%s>" % self.__class__.__name__ mod.__loader__ = self if ispkg: mod.__path__ = self._get__path__() exec code in mod.__dict__ return mod
7ec642a4d2ee98dfc0b67431255046374abc4ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ec642a4d2ee98dfc0b67431255046374abc4ed7/test_importhooks.py
Output("PyObject_HEAD_INIT(&PyType_Type)")
Output("PyObject_HEAD_INIT(NULL)")
def outputTypeObject(self): sf = self.static and "staticforward " Output() Output("%sPyTypeObject %s = {", sf, self.typename) IndentLevel() Output("PyObject_HEAD_INIT(&PyType_Type)") Output("0, /*ob_size*/") Output("\"%s\", /*tp_name*/", self.name) Output("sizeof(%s), /*tp_basicsize*/", self.objecttype) Output("0, /*tp...
1062e706e5778d17b590414529c9e0191e24bea0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1062e706e5778d17b590414529c9e0191e24bea0/bgenObjectDefinition.py
return None
return self.pimpprefs.check()
def setuppimp(self, url): self.pimpprefs = pimp.PimpPreferences() self.pimpdb = pimp.PimpDatabase(self.pimpprefs) self.pimpinstaller = pimp.PimpInstaller(self.pimpdb) if not url: url = self.pimpprefs.pimpDatabase try: self.pimpdb.appendURL(url) except IOError, arg: return "Cannot open %s: %s" % (url, arg) return None
d5532affd8da87c88c3ea5cc7277b5fa24bff0df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d5532affd8da87c88c3ea5cc7277b5fa24bff0df/PackageManager.py
def __hasattr__(self, attr): "Delegate attribute access to the interpreter object" return hasattr(self.tk, attr) def __delattr__(self, attr): "Delegate attribute access to the interpreter object" return delattr(self.tk, attr)
def __hasattr__(self, attr): "Delegate attribute access to the interpreter object" return hasattr(self.tk, attr)
49a4b68b8b5dde8773247c4a2c8677a9455d8558 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/49a4b68b8b5dde8773247c4a2c8677a9455d8558/Tkinter.py
def __init__(self, path=None, debug=0, excludes = [], replace_paths = []):
def __init__(self, path=None, debug=0, excludes=[], replace_paths=[]):
def __init__(self, path=None, debug=0, excludes = [], replace_paths = []): if path is None: path = sys.path self.path = path self.modules = {} self.badmodules = {} self.debug = debug self.indent = 0 self.excludes = excludes self.replace_paths = replace_paths self.processed_paths = [] # Used in debugging only
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
if parent: self.badmodules[fqname][parent.__name__] = None
def import_module(self, partname, fqname, parent): self.msgin(3, "import_module", partname, fqname, parent) try: m = self.modules[fqname] except KeyError: pass else: self.msgout(3, "import_module ->", m) return m if self.badmodules.has_key(fqname): self.msgout(3, "import_module -> None") if parent: self.badmodules[fqna...
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
lastname = None
fromlist = None
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.import_hook(name, m) except ImportError, msg: self.msg(2, "ImportError:", str(msg)) if not self.badmodules.has_key(name): self.badmodules[name] = {} self.badmodules[name][m.__name__] = None elif op == IMPORT_F...
if op == LOAD_CONST: fromlist = co.co_consts[oparg] elif op == IMPORT_NAME: assert fromlist is None or type(fromlist) is tuple
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
assert lastname is not None if not self.badmodules.has_key(lastname): try: self.import_hook(lastname, m, [name]) except ImportError, msg: self.msg(2, "ImportError:", str(msg)) fullname = lastname + "." + name if not self.badmodules.has_key(fullname): self.badmodules[fullname] = {} self.badmodules[fullname][m.__name__] ...
have_star = 0 if fromlist is not None: if "*" in fromlist: have_star = 1 fromlist = [f for f in fromlist if f != "*"] self._safe_import_hook(name, m, fromlist) if have_star: mm = None if m.__path__: mm = self.modules.get(m.__name__ + "." + name) if mm is None: mm = self.modules.get(name) if mm is not None: m.glob...
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
pass else: lastname = None
name = co.co_names[oparg] m.globalnames[name] = 1
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
keys = self.badmodules.keys() keys.sort() for key in keys: if key not in self.excludes: mods = self.badmodules[key].keys()
missing, maybe = self.any_missing_maybe() if missing: print print "Missing modules:" for name in missing: mods = self.badmodules[name].keys()
def report(self): print print " %-25s %s" % ("Name", "File") print " %-25s %s" % ("----", "----") # Print modules found keys = self.modules.keys() keys.sort() for key in keys: m = self.modules[key] if m.__path__: print "P", else: print "m", print "%-25s" % key, m.__file__ or ""
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
print "?", key, "from", ', '.join(mods)
print "?", name, "imported from", ', '.join(mods) if maybe: print print "Submodules thay appear to be missing, but could also be", print "global names in the parent package:" for name in maybe: mods = self.badmodules[name].keys() mods.sort() print "?", name, "imported from", ', '.join(mods)
def report(self): print print " %-25s %s" % ("Name", "File") print " %-25s %s" % ("----", "----") # Print modules found keys = self.modules.keys() keys.sort() for key in keys: m = self.modules[key] if m.__path__: print "P", else: print "m", print "%-25s" % key, m.__file__ or ""
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
keys = self.badmodules.keys()
"""Return a list of modules that appear to be missing. Use any_missing_maybe() if you want to know which modules are certain to be missing, and which *may* be missing. """ missing, maybe = self.any_missing_maybe() return missing + maybe def any_missing_maybe(self): """Return two lists, one with modules that are certai...
def any_missing(self): keys = self.badmodules.keys() missing = [] for key in keys: if key not in self.excludes: # Missing, and its not supposed to be missing.append(key) return missing
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
for key in keys: if key not in self.excludes: missing.append(key) return missing
maybe = [] for name in self.badmodules: if name in self.excludes: continue i = name.rfind(".") if i < 0: missing.append(name) continue subname = name[i+1:] pkgname = name[:i] pkg = self.modules.get(pkgname) if pkg is not None: if pkgname in self.badmodules[name]: missing.append(name) elif subname in pkg.globalnames: ...
def any_missing(self): keys = self.badmodules.keys() missing = [] for key in keys: if key not in self.excludes: # Missing, and its not supposed to be missing.append(key) return missing
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
for f,r in self.replace_paths:
for f, r in self.replace_paths:
def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f,r in self.replace_paths: if original_filename.startswith(f): new_filename = r+original_filename[len(f):] break
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
new_filename = r+original_filename[len(f):]
new_filename = r + original_filename[len(f):]
def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f,r in self.replace_paths: if original_filename.startswith(f): new_filename = r+original_filename[len(f):] break
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
if new_filename!=original_filename:
if new_filename != original_filename:
def replace_paths_in_code(self, co): new_filename = original_filename = os.path.normpath(co.co_filename) for f,r in self.replace_paths: if original_filename.startswith(f): new_filename = r+original_filename[len(f):] break
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
test()
mf = test()
def test(): # Parse command line import getopt try: opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:") except getopt.error, msg: print msg return # Process options debug = 1 domods = 0 addpath = [] exclude = [] for o, a in opts: if o == '-d': debug = debug + 1 if o == '-m': domods = 1 if o == '-p': addpath = addpath ...
e29310a2b3e50958b00c0e92b142992599cf7ef1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e29310a2b3e50958b00c0e92b142992599cf7ef1/modulefinder.py
del(self)
def delete(self): self.tk.call(self.stylename, 'delete') del(self)
4208d4f7574bef6cfd78e242a83aedd12442c812 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4208d4f7574bef6cfd78e242a83aedd12442c812/Tix.py
self.addr = sock.getpeername()
try: self.addr = sock.getpeername() except socket.error: pass
def __init__ (self, sock=None, map=None): if sock: self.set_socket (sock, map) # I think it should inherit this anyway self.socket.setblocking (0) self.connected = 1 self.addr = sock.getpeername() else: self.socket = None
2a05bc72d61377772ed988507bd67961bcbf35a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a05bc72d61377772ed988507bd67961bcbf35a0/asyncore.py
if cl.super:
if hasattr(cl, 'super') and cl.super:
def listclasses(self): dir, file = os.path.split(self.file) name, ext = os.path.splitext(file) if os.path.normcase(ext) != ".py": return [] try: dict = pyclbr.readmodule_ex(name, [dir] + sys.path) except ImportError, msg: return [] items = [] self.classes = {} for key, cl in dict.items(): if cl.module == name: s = key ...
6550051691d604c728ed56e4acf90dc6535981f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6550051691d604c728ed56e4acf90dc6535981f9/ClassBrowser.py
def input(files=(), inplace=0, backup=""):
def input(files=None, inplace=0, backup=""):
def input(files=(), inplace=0, backup=""): global _state if _state and _state._file: raise RuntimeError, "input() already active" _state = FileInput(files, inplace, backup) return _state
2516b39dd35a3e0d815e25ee652cea6c90cc5b28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2516b39dd35a3e0d815e25ee652cea6c90cc5b28/fileinput.py
def __init__(self, files=(), inplace=0, backup=""):
def __init__(self, files=None, inplace=0, backup=""):
def __init__(self, files=(), inplace=0, backup=""): if type(files) == type(''): files = (files,) else: files = tuple(files) if not files: files = tuple(sys.argv[1:]) if not files: files = ('-',) self._files = files self._inplace = inplace self._backup = backup self._savestdout = None self._output = None self._filename ...
2516b39dd35a3e0d815e25ee652cea6c90cc5b28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2516b39dd35a3e0d815e25ee652cea6c90cc5b28/fileinput.py
files = tuple(files)
if files is None: files = sys.argv[1:]
def __init__(self, files=(), inplace=0, backup=""): if type(files) == type(''): files = (files,) else: files = tuple(files) if not files: files = tuple(sys.argv[1:]) if not files: files = ('-',) self._files = files self._inplace = inplace self._backup = backup self._savestdout = None self._output = None self._filename ...
2516b39dd35a3e0d815e25ee652cea6c90cc5b28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2516b39dd35a3e0d815e25ee652cea6c90cc5b28/fileinput.py
files = tuple(sys.argv[1:]) if not files: files = ('-',)
files = ('-',) else: files = tuple(files)
def __init__(self, files=(), inplace=0, backup=""): if type(files) == type(''): files = (files,) else: files = tuple(files) if not files: files = tuple(sys.argv[1:]) if not files: files = ('-',) self._files = files self._inplace = inplace self._backup = backup self._savestdout = None self._output = None self._filename ...
2516b39dd35a3e0d815e25ee652cea6c90cc5b28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2516b39dd35a3e0d815e25ee652cea6c90cc5b28/fileinput.py
r, w, x = select.select([self.fileno()], [], [], timeout)
elapsed = time() - time_start if elapsed >= timeout: break s_args = ([self.fileno()], [], [], timeout-elapsed) r, w, x = select.select(*s_args)
def expect(self, list, timeout=None): """Read until one from a list of a regular expressions matches.
ede77f5373e38ce1befc02858dcbcff8214c061b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ede77f5373e38ce1befc02858dcbcff8214c061b/telnetlib.py
def unix_getpass(prompt='Password: '):
def unix_getpass(prompt='Password: ', stream=None):
def unix_getpass(prompt='Password: '): """Prompt for a password, with echo turned off. Restore terminal settings at end. """ try: fd = sys.stdin.fileno() except: return default_getpass(prompt) old = termios.tcgetattr(fd) # a copy to save new = old[:] new[3] = new[3] & ~termios.ECHO # 3 == 'lflags' try: termios....
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
passwd = _raw_input(prompt)
passwd = _raw_input(prompt, stream)
def unix_getpass(prompt='Password: '): """Prompt for a password, with echo turned off. Restore terminal settings at end. """ try: fd = sys.stdin.fileno() except: return default_getpass(prompt) old = termios.tcgetattr(fd) # a copy to save new = old[:] new[3] = new[3] & ~termios.ECHO # 3 == 'lflags' try: termios....
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
sys.stdout.write('\n')
stream.write('\n')
def unix_getpass(prompt='Password: '): """Prompt for a password, with echo turned off. Restore terminal settings at end. """ try: fd = sys.stdin.fileno() except: return default_getpass(prompt) old = termios.tcgetattr(fd) # a copy to save new = old[:] new[3] = new[3] & ~termios.ECHO # 3 == 'lflags' try: termios....
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
def win_getpass(prompt='Password: '):
def win_getpass(prompt='Password: ', stream=None):
def win_getpass(prompt='Password: '): """Prompt for password with echo off, using Windows getch().""" if sys.stdin is not sys.__stdin__: return default_getpass(prompt) import msvcrt for c in prompt: msvcrt.putch(c) pw = "" while 1: c = msvcrt.getch() if c == '\r' or c == '\n': break if c == '\003': raise KeyboardInterr...
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
return default_getpass(prompt)
return default_getpass(prompt, stream)
def win_getpass(prompt='Password: '): """Prompt for password with echo off, using Windows getch().""" if sys.stdin is not sys.__stdin__: return default_getpass(prompt) import msvcrt for c in prompt: msvcrt.putch(c) pw = "" while 1: c = msvcrt.getch() if c == '\r' or c == '\n': break if c == '\003': raise KeyboardInterr...
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
def default_getpass(prompt='Password: '): print "Warning: Problem with getpass. Passwords may be echoed." return _raw_input(prompt)
def default_getpass(prompt='Password: ', stream=None): print >>sys.stderr, "Warning: Problem with getpass. Passwords may be echoed." return _raw_input(prompt, stream)
def default_getpass(prompt='Password: '): print "Warning: Problem with getpass. Passwords may be echoed." return _raw_input(prompt)
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
def _raw_input(prompt=""):
def _raw_input(prompt="", stream=None):
def _raw_input(prompt=""): # A raw_input() replacement that doesn't save the string in the # GNU readline history. prompt = str(prompt) if prompt: sys.stdout.write(prompt) line = sys.stdin.readline() if not line: raise EOFError if line[-1] == '\n': line = line[:-1] return line
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
sys.stdout.write(prompt)
stream.write(prompt)
def _raw_input(prompt=""): # A raw_input() replacement that doesn't save the string in the # GNU readline history. prompt = str(prompt) if prompt: sys.stdout.write(prompt) line = sys.stdin.readline() if not line: raise EOFError if line[-1] == '\n': line = line[:-1] return line
338ef7d2bd3c2ef507d7ef1edce42492dae28db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/338ef7d2bd3c2ef507d7ef1edce42492dae28db0/getpass.py
(pid, status) = os.waitpid(pid, 0)
try: (pid, status) = os.waitpid(pid, 0) except OSError, exc: import errno if exc.errno == errno.EINTR: continue raise DistutilsExecError, \ "command '%s' failed: %s" % (cmd[0], exc[-1])
def _spawn_posix (cmd, search_path=1, verbose=0, dry_run=0): log.info(string.join(cmd, ' ')) if dry_run: return exec_fn = search_path and os.execvp or os.execv pid = os.fork() if pid == 0: # in the child try: #print "cmd[0] =", cmd[0] #print "cmd =", cmd exec_fn(cmd[0], cmd) except OSError, e:...
904de5b7343994a7fcb2941ce094ab60da68afed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/904de5b7343994a7fcb2941ce094ab60da68afed/spawn.py
vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kSharedLibrariesFolderType, 0) fss = macfs.FSSpec((vrefnum, dirid, fname))
vrefnum, dirid = macfs.FindFolder(MACFS.kLocalDomain, MACFS.kSharedLibrariesFolderType, 1)
def getextensiondirfile(fname): import macfs import MACFS try: vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kSharedLibrariesFolderType, 0) fss = macfs.FSSpec((vrefnum, dirid, fname)) except macfs.error: return None return fss.as_pathname()
d11f93c475e2f4151eb60c5973bb36c6131d4921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d11f93c475e2f4151eb60c5973bb36c6131d4921/ConfigurePython.py
return None
try: vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kSharedLibrariesFolderType, 1) except macfs.error: return None fss = macfs.FSSpec((vrefnum, dirid, fname))
def getextensiondirfile(fname): import macfs import MACFS try: vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kSharedLibrariesFolderType, 0) fss = macfs.FSSpec((vrefnum, dirid, fname)) except macfs.error: return None return fss.as_pathname()
d11f93c475e2f4151eb60c5973bb36c6131d4921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d11f93c475e2f4151eb60c5973bb36c6131d4921/ConfigurePython.py
if oldcwd != newcwd:
if verbose: print "Not running as applet: Skipping check for preference file correctness." elif oldcwd != newcwd: sys.path.insert(0, os.path.join(oldcwd, ':Mac:Lib'))
def main(): verbose = 0 try: h = Res.GetResource('DLOG', SPLASH_COPYCORE) del h except Res.Error: verbose = 1 print "Not running as applet: verbose on" oldcwd = os.getcwd() os.chdir(sys.prefix) newcwd = os.getcwd() if oldcwd != newcwd: import Dlg rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None) if rv == ALERT_NOTPYTH...
d11f93c475e2f4151eb60c5973bb36c6131d4921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d11f93c475e2f4151eb60c5973bb36c6131d4921/ConfigurePython.py
def __init__(self, name=""): """Construct a TarInfo object. name is the optional name of the member. """
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
self.prefix = ""
def __init__(self, name=""): """Construct a TarInfo object. name is the optional name of the member. """
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
tarinfo.prefix = buf[345:500]
prefix = buf[345:500].rstrip(NUL) if prefix and not tarinfo.issparse(): tarinfo.name = prefix + "/" + tarinfo.name
def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise ValueError("empty header")
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
"""Return a tar header block as a 512 byte string. """
"""Return a tar header as a string of 512 byte blocks. """ buf = "" type = self.type prefix = "" if self.name.endswith("/"): type = DIRTYPE name = normpath(self.name) if type == DIRTYPE: name += "/" linkname = self.linkname if linkname: linkname = normpath(linkname) if posix: if self.size > MAXSIZE_MEMBER: raise...
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
stn(self.name, 100),
stn(name, 100),
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
self.type,
type,
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
stn(self.prefix, 155)
stn(prefix, 155)
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
buf = struct.pack("%ds" % BLOCKSIZE, "".join(parts))
buf += struct.pack("%ds" % BLOCKSIZE, "".join(parts))
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
buf = buf[:148] + "%06o\0" % chksum + buf[155:]
buf = buf[:-364] + "%06o\0" % chksum + buf[-357:]
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
tarinfo.name = normpath(tarinfo.name) if tarinfo.isdir(): tarinfo.name += "/" if tarinfo.linkname: tarinfo.linkname = normpath(tarinfo.linkname) if tarinfo.size > MAXSIZE_MEMBER: if self.posix: raise ValueError("file is too large (>= 8 GB)") else: self._dbg(2, "tarfile: Created GNU tar largefile header") if len(ta...
tarinfo = copy.copy(tarinfo) buf = tarinfo.tobuf(self.posix) self.fileobj.write(buf) self.offset += len(buf)
def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
tarinfo.name = normpath(os.path.join(tarinfo.prefix.rstrip(NUL), tarinfo.name))
def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
tarinfo.prefix = ""
def proc_sparse(self, tarinfo): """Process a GNU sparse header plus extra headers. """ buf = tarinfo.buf sp = _ringbuffer() pos = 386 lastpos = 0L realpos = 0L # There are 4 possible sparse structs in the # first header. for i in xrange(4): try: offset = nti(buf[pos:pos + 12]) numbytes = nti(buf[pos + 12:pos + 24]) exc...
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
def _create_gnulong(self, name, type): """Write a GNU longname/longlink member to the TarFile. It consists of an extended tar header, with the length of the longname as size, followed by data blocks, which contain the longname as a null terminated string. """ name += NUL tarinfo = TarInfo() tarinfo.name = "././@LongL...
def __iter__(self): """Provide an iterator object. """ if self._loaded: return iter(self.members) else: return TarIter(self)
3354f285b958bbe8fa99b0091fcd4335251dec71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3354f285b958bbe8fa99b0091fcd4335251dec71/tarfile.py
print "\n<PRE>Cookies:", cookies, "</PRE>"
def get_cookie(self):
eae7d0ecf32cd8e43fe61a4df6978c91886a278e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eae7d0ecf32cd8e43fe61a4df6978c91886a278e/faqmain.py
t>>11, (t>>5)&0x3F, t&0x1F * 2 )
t>>11, (t>>5)&0x3F, (t&0x1F) * 2 )
def _GetContents(self): "Read in the table of contents for the zip file" fp = self.fp fp.seek(-22, 2) # Start of end-of-archive record filesize = fp.tell() + 22 # Get file size endrec = fp.read(22) # Archive must not end with a comment! if endrec[0:4] != stringEndArchive or endrec[-2:] != "\000\000": raise BadZipfile,...
414ca6666ccbf5ac2caac0f60c07b686d03cda49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/414ca6666ccbf5ac2caac0f60c07b686d03cda49/zipfile.py
def __init__(self, files=[], dir=os.curdir, allfiles=None, warn=None, debug_print=None): # use standard warning and debug functions, if no other given if warn is None: warn = self.__warn if debug_print is None: debug_print = self.__debug_print self.warn = warn self.debug_print = debug_print self.files = files self.dir ...
c98927a059c458065ca3311a55f70b323f75c467 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c98927a059c458065ca3311a55f70b323f75c467/filelist.py
sys.stderr.write ("warning: template: %s\n" % msg)
sys.stderr.write ("warning: %s\n" % msg)
def __warn (self, msg): sys.stderr.write ("warning: template: %s\n" % msg)
c98927a059c458065ca3311a55f70b323f75c467 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c98927a059c458065ca3311a55f70b323f75c467/filelist.py
def process_line(self, line): words = string.split (line) action = words[0] if action in ('include','exclude', 'global-include','global-exclude'): if len (words) < 2:
def process_line (self, line): words = string.split (line) action = words[0] if action in ('include','exclude', 'global-include','global-exclude'): if len (words) < 2: self.warn \ ("invalid template line: " + "'%s' expects <pattern1> <pattern2> ..." % action) return pattern_list = map(convert_path, words[1:]) eli...
def process_line(self, line):
c98927a059c458065ca3311a55f70b323f75c467 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c98927a059c458065ca3311a55f70b323f75c467/filelist.py
("invalid template line: " + "'%s' expects <pattern1> <pattern2> ..." % action) return pattern_list = map(convert_path, words[1:]) elif action in ('recursive-include','recursive-exclude'): if len (words) < 3:
(("no previously-included files matching '%s' " + "found anywhere in distribution") % pattern) elif action == 'recursive-include': self.debug_print("recursive-include %s %s" % (dir, string.join(pattern_list))) for pattern in pattern_list: if not self.select_pattern (pattern, prefix=dir): self.warn (("no files found ma...
def process_line(self, line):
c98927a059c458065ca3311a55f70b323f75c467 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c98927a059c458065ca3311a55f70b323f75c467/filelist.py
("invalid template line: " + "'%s' expects <dir> <pattern1> <pattern2> ..." % action) return dir = convert_path(words[1]) pattern_list = map (convert_path, words[2:]) elif action in ('graft','prune'): if len (words) != 2: self.warn \ ("invalid template line: " + "'%s' expects a single <dir_pattern>" % action) return ...
(("no previously-included files matching '%s' " + "found under directory '%s'") % (pattern, dir)) elif action == 'graft': self.debug_print("graft " + dir_pattern) if not self.select_pattern(None, prefix=dir_pattern): self.warn ("no directories found matching '%s'" % dir_pattern) elif action == 'prune': self.debug_pri...
def process_line(self, line):
c98927a059c458065ca3311a55f70b323f75c467 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c98927a059c458065ca3311a55f70b323f75c467/filelist.py
def process_line(self, line):
c98927a059c458065ca3311a55f70b323f75c467 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c98927a059c458065ca3311a55f70b323f75c467/filelist.py
codecs.StreamWriter.__init__(self,strict,errors)
codecs.StreamWriter.__init__(self,stream,errors)
def __init__(self,stream,errors='strict',mapping=None):
fd6608bcea685073efffe779d7f4261dd8e512d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd6608bcea685073efffe779d7f4261dd8e512d4/charmap.py
print "*** skipping leakage tests ***"
if verbose: print "*** skipping leakage tests ***"
def test_lineterminator(self): class mydialect(csv.Dialect): delimiter = ";" escapechar = '\\' doublequote = False skipinitialspace = True lineterminator = '\r\n' quoting = csv.QUOTE_NONE d = mydialect()
e3d1df0646977d9576d4d760facd03285cb015b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3d1df0646977d9576d4d760facd03285cb015b5/test_csv.py
"Handle a notation declaration event."
"Handle a notation declaration event."
def notationDecl(self, name, publicId, systemId):
84da8aa7e2f1bdaf8692dbfd9981430c84278038 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84da8aa7e2f1bdaf8692dbfd9981430c84278038/handler.py