rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
from twisted.names.authority import FileAuthority
def _lookup(self, name, cls, type, timeout=None): if not self.soa or not self.records: return defer.fail(failure.Failure(dns.DomainError(name))) from twisted.names.authority import FileAuthority return FileAuthority.__dict__['_lookup'](self, name, cls, type, timeout)
8a6ba26200eddc58d19a4a428f151409d819b585 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8a6ba26200eddc58d19a4a428f151409d819b585/secondary.py
def _(*args, **kwargs):
def enclosingScope(warnings, warningz): exec """def %s(*args, **kwargs): for warning in warningz: warnings.filterwarnings('ignore', *warning) try: ret = f(*args, **kwargs) finally:
def _(*args, **kwargs): for warning in warningz: warnings.filterwarnings('ignore', *warning) try: ret = f(*args, **kwargs) finally: for warning in warningz: warnings.filterwarnings('default', *warning) return ret
58bc9589f7ce5c61cc3ce4c29820a8c1120aace6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/58bc9589f7ce5c61cc3ce4c29820a8c1120aace6/util.py
warnings.filterwarnings('ignore', *warning) try: ret = f(*args, **kwargs) finally: for warning in warningz: warnings.filterwarnings('default', *warning) return ret try: return new.function(_.func_code, _.func_globals, f.func_name, inspect.getargspec(_), _.func_closure) except TypeError: return new.function(_.func_code,...
warnings.filterwarnings('default', *warning) return ret """ % (f.func_name,) in locals() return locals()[f.func_name] return enclosingScope(warnings, warningz)
def _(*args, **kwargs): for warning in warningz: warnings.filterwarnings('ignore', *warning) try: ret = f(*args, **kwargs) finally: for warning in warningz: warnings.filterwarnings('default', *warning) return ret
58bc9589f7ce5c61cc3ce4c29820a8c1120aace6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/58bc9589f7ce5c61cc3ce4c29820a8c1120aace6/util.py
(os.write, self.fd, 0)])
(os.write, self.fd, data)])
def writeChunk(self, offset, data): return self.server._runAsUser([(os.lseek, self.fd, offset, 0), (os.write, self.fd, 0)])
0ab13ada8a45ad7bbe15632c22d8deb2daece392 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0ab13ada8a45ad7bbe15632c22d8deb2daece392/filetransfer.py
def registerAdapter(adapterClass, origClass, interfaceClass):
def registerAdapter(adapterClass, origClass, *interfaceClasses):
def registerAdapter(adapterClass, origClass, interfaceClass): """Register an adapter class. An adapter class is expected to implement the given interface, by adapting instances of paramter 'origClass'. An adapter class's __init__ method should accept one parameter, an instance of 'origClass'. """ if adapterRegistry.ha...
3e2d62bace8f4775ead23ef736309a0e08f49caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e2d62bace8f4775ead23ef736309a0e08f49caf/components.py
if adapterRegistry.has_key((origClass, interfaceClass)): raise ValueError( "an adapter (%s) was already registered." % ( adapterRegistry[(origClass, interfaceClass)]
assert interfaceClasses, "You need to pass an Interface" for interfaceClass in interfaceClasses: if adapterRegistry.has_key((origClass, interfaceClass)): raise ValueError( "an adapter (%s) was already registered." % ( adapterRegistry[(origClass, interfaceClass)] )
def registerAdapter(adapterClass, origClass, interfaceClass): """Register an adapter class. An adapter class is expected to implement the given interface, by adapting instances of paramter 'origClass'. An adapter class's __init__ method should accept one parameter, an instance of 'origClass'. """ if adapterRegistry.ha...
3e2d62bace8f4775ead23ef736309a0e08f49caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e2d62bace8f4775ead23ef736309a0e08f49caf/components.py
) if not implements(adapterClass, interfaceClass): raise ValueError, "%s instances don't implement interface %s" % (adapterClass, interfaceClass) if not issubclass(interfaceClass, Interface): raise ValueError, "interface %s doesn't inherit from %s" % (interfaceClass, Interface) for i in superInterfaces(interfaceCla...
if not implements(adapterClass, interfaceClass): raise ValueError, "%s instances don't implement interface %s" % (adapterClass, interfaceClass) if not issubclass(interfaceClass, Interface): raise ValueError, "interface %s doesn't inherit from %s" % (interfaceClass, Interface) for i in superInterfaces(interfaceClass...
def registerAdapter(adapterClass, origClass, interfaceClass): """Register an adapter class. An adapter class is expected to implement the given interface, by adapting instances of paramter 'origClass'. An adapter class's __init__ method should accept one parameter, an instance of 'origClass'. """ if adapterRegistry.ha...
3e2d62bace8f4775ead23ef736309a0e08f49caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e2d62bace8f4775ead23ef736309a0e08f49caf/components.py
class _default: pass def getAdapter(obj, interfaceClass, default=_default,
class _Nothing: pass def getAdapter(obj, interfaceClass, default=_Nothing,
def getAdapterClassWithInheritance(klass, interfaceClass, default): """Return registered adapter for a given class and interface. """ adapterClass = adapterRegistry.get((klass, interfaceClass), _Nothing) if adapterClass is _Nothing: for baseClass in reflect.allYourBase(klass): adapterClass = adapterRegistry.get((baseCl...
3e2d62bace8f4775ead23ef736309a0e08f49caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e2d62bace8f4775ead23ef736309a0e08f49caf/components.py
if default is _default:
if default is _Nothing:
def getAdapter(obj, interfaceClass, default=_default, adapterClassLocator=None): """Return an object that implements the given interface. The result will be a wrapper around the object passed as a paramter, or the parameter itself if it already implements the interface. If no adapter can be found, the 'default' parame...
3e2d62bace8f4775ead23ef736309a0e08f49caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e2d62bace8f4775ead23ef736309a0e08f49caf/components.py
class _Nothing: pass
def getAdapter(obj, interfaceClass, default=_default, adapterClassLocator=None): """Return an object that implements the given interface. The result will be a wrapper around the object passed as a paramter, or the parameter itself if it already implements the interface. If no adapter can be found, the 'default' parame...
3e2d62bace8f4775ead23ef736309a0e08f49caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e2d62bace8f4775ead23ef736309a0e08f49caf/components.py
options["typein"])
self["typein"])
def postOptions(self): if self['in'] is None: self.opt_help() raise usage.UsageError("You must specify the input filename.") if self["typein"] == "guess": try: self["typein"] = app.guessType(self["in"]) except KeyError: raise usage.UsageError("Could not guess type for '%s'" % options["typein"])
b2200cba2258cb2fc41b8c370a3129ac7b6dd206 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b2200cba2258cb2fc41b8c370a3129ac7b6dd206/tapconvert.py
import zope
self.__original=original attrs=[]
def __init__(self, original, interfaces=None): import zope if interfaces is None: interfaces = zope.interface.providedBy(original) for interface in interfaces: for name in interface.names(): attr = interface[name] if zope.interface.interfaces.IMethod.providedBy(attr): setattr(self, name, _functionWrapper(original, nam...
749403e84eca087d99022ef3cb45d36a859a9aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/749403e84eca087d99022ef3cb45d36a859a9aa3/iproxy.py
interfaces = zope.interface.providedBy(original)
interfaces = providedBy(original)
def __init__(self, original, interfaces=None): import zope if interfaces is None: interfaces = zope.interface.providedBy(original) for interface in interfaces: for name in interface.names(): attr = interface[name] if zope.interface.interfaces.IMethod.providedBy(attr): setattr(self, name, _functionWrapper(original, nam...
749403e84eca087d99022ef3cb45d36a859a9aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/749403e84eca087d99022ef3cb45d36a859a9aa3/iproxy.py
if zope.interface.interfaces.IMethod.providedBy(attr):
if zinterfaces.IMethod.providedBy(attr):
def __init__(self, original, interfaces=None): import zope if interfaces is None: interfaces = zope.interface.providedBy(original) for interface in interfaces: for name in interface.names(): attr = interface[name] if zope.interface.interfaces.IMethod.providedBy(attr): setattr(self, name, _functionWrapper(original, nam...
749403e84eca087d99022ef3cb45d36a859a9aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/749403e84eca087d99022ef3cb45d36a859a9aa3/iproxy.py
raise TypeError("Cannot handle non-function attributes yet")
raise TypeError("Unknown kind of attribute.") self.__attrs=attrs self.__setattr__=self.__setattr def __getattr__(self, name): if name not in self.__attrs: raise AttributeError("%s object has no attribute '%s'" %( getClass(self.__original).__name__, name)) return getattr(self.__original, name) def __setattr(self, name...
def __init__(self, original, interfaces=None): import zope if interfaces is None: interfaces = zope.interface.providedBy(original) for interface in interfaces: for name in interface.names(): attr = interface[name] if zope.interface.interfaces.IMethod.providedBy(attr): setattr(self, name, _functionWrapper(original, nam...
749403e84eca087d99022ef3cb45d36a859a9aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/749403e84eca087d99022ef3cb45d36a859a9aa3/iproxy.py
if k not in kwargs:
if k not in optional:
def _callthrough(*pos, **kw): argcount = len(pos) kwcount = len(kw) if len(positional) > 0 and positional[0] == 'self': # FIXME, hack. # 'self' shouldn't be in the interface declarations, but is. argcount=argcount+1 if len(positional) > 0 or kwargs is not None or varargs is not None: if varargs is None and argcount > ...
749403e84eca087d99022ef3cb45d36a859a9aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/749403e84eca087d99022ef3cb45d36a859a9aa3/iproxy.py
for n in positional[:arglen]:
for n in positional[:argcount]:
def _callthrough(*pos, **kw): argcount = len(pos) kwcount = len(kw) if len(positional) > 0 and positional[0] == 'self': # FIXME, hack. # 'self' shouldn't be in the interface declarations, but is. argcount=argcount+1 if len(positional) > 0 or kwargs is not None or varargs is not None: if varargs is None and argcount > ...
749403e84eca087d99022ef3cb45d36a859a9aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/749403e84eca087d99022ef3cb45d36a859a9aa3/iproxy.py
open(os.path.expanduser('~/.ssh/known_hosts'),'a').write('localhost '+publicRSA)
open('kh_test','w').write('localhost '+publicRSA)
def setUp(self): open('rsa_test','w').write(privateRSA) open('rsa_test.pub','w').write(publicRSA) open('dsa_test.pub','w').write(publicDSA) open('dsa_test','w').write(privateDSA) os.chmod('dsa_test', 33152) os.chmod('rsa_test', 33152) open(os.path.expanduser('~/.ssh/known_hosts'),'a').write('localhost '+publicRSA)
29fe89f694e36d64b59ac77d0f9069d36baf0824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/29fe89f694e36d64b59ac77d0f9069d36baf0824/test_conch.py
for f in ['rsa_test','rsa_test.pub','dsa_test','dsa_test.pub']:
for f in ['rsa_test','rsa_test.pub','dsa_test','dsa_test.pub', 'kh_test']:
def tearDown(self): for f in ['rsa_test','rsa_test.pub','dsa_test','dsa_test.pub']: os.remove(f) lines = open(os.path.expanduser('~/.ssh/known_hosts'),'r').readlines() try: lines.remove('localhost ' + publicRSA) except ValueError: lines.remove('localhost ' + publicRSA + '\n') open(os.path.expanduser('~/.ssh/known_hosts...
29fe89f694e36d64b59ac77d0f9069d36baf0824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/29fe89f694e36d64b59ac77d0f9069d36baf0824/test_conch.py
lines = open(os.path.expanduser('~/.ssh/known_hosts'),'r').readlines() try: lines.remove('localhost ' + publicRSA) except ValueError: lines.remove('localhost ' + publicRSA + '\n') open(os.path.expanduser('~/.ssh/known_hosts'), 'w').writelines(lines)
def tearDown(self): for f in ['rsa_test','rsa_test.pub','dsa_test','dsa_test.pub']: os.remove(f) lines = open(os.path.expanduser('~/.ssh/known_hosts'),'r').readlines() try: lines.remove('localhost ' + publicRSA) except ValueError: lines.remove('localhost ' + publicRSA + '\n') open(os.path.expanduser('~/.ssh/known_hosts...
29fe89f694e36d64b59ac77d0f9069d36baf0824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/29fe89f694e36d64b59ac77d0f9069d36baf0824/test_conch.py
self.transport.write('+OK %s\r\n' % message)
self.sendLine('+OK ' + str(message))
def successResponse(self, message=''): self.transport.write('+OK %s\r\n' % message)
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write('-ERR %s\r\n' % message)
self.sendLine('-ERR ' + str(message))
def failResponse(self, message=''): self.transport.write('-ERR %s\r\n' % message)
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
def lineReceived(self, line): try: return apply(self.processCommand, tuple(string.split(line))) except (ValueError, AttributeError, POP3Error, TypeError), e: self.failResponse('bad protocol or server: %s: %s' % (e.__class__.__name__, e))
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
return apply(getattr(self, 'do_'+command), args)
f = getattr(self, 'do_' + command, None) if f: return apply(getattr(self, 'do_'+command), args) raise POP3Error("Unknown protocol command: " + command)
def processCommand(self, command, *args): command = string.upper(command) if self.mbox is None and command != 'APOP': raise POP3Error("not authenticated yet: cannot do %s" % command) return apply(getattr(self, 'do_'+command), args)
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write('%d %d\r\n' % (i, message))
self.sendLine('%d %d' % (i, message))
def do_LIST(self, i=None): messages = self.mbox.listMessages() total = reduce(operator.add, messages, 0) self.successResponse(len(messages)) i = 1 for message in messages: if message: self.transport.write('%d %d\r\n' % (i, message)) i = i+1 self.transport.write('.\r\n')
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write('.\r\n')
self.sendLine('.')
def do_LIST(self, i=None): messages = self.mbox.listMessages() total = reduce(operator.add, messages, 0) self.successResponse(len(messages)) i = 1 for message in messages: if message: self.transport.write('%d %d\r\n' % (i, message)) i = i+1 self.transport.write('.\r\n')
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write('%d %s\r\n' % (i+1, self.mbox.getUidl(i))) self.transport.write('.\r\n')
self.sendLine('%d %s' % (i+1, self.mbox.getUidl(i))) self.sendLine('.')
def do_UIDL(self, i=None): messages = self.mbox.listMessages() self.successResponse() for i in range(len(messages)): if messages[i]: self.transport.write('%d %s\r\n' % (i+1, self.mbox.getUidl(i))) self.transport.write('.\r\n')
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write(line[:size]+'\r\n')
self.sendLine(line[:size])
def do_TOP(self, i, size): resp, fp = self.getMessageFile(i) if not fp: return size = max(int(size), resp) self.successResponse(size) while size: line = fp.readline() if not line: break if line[-1] == '\n': line = line[:-1] if line[:1] == '.': line = '.'+line self.transport.write(line[:size]+'\r\n') size = size-len(lin...
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.sendLine('.')
def do_TOP(self, i, size): resp, fp = self.getMessageFile(i) if not fp: return size = max(int(size), resp) self.successResponse(size) while size: line = fp.readline() if not line: break if line[-1] == '\n': line = line[:-1] if line[:1] == '.': line = '.'+line self.transport.write(line[:size]+'\r\n') size = size-len(lin...
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write(line+'\r\n') self.transport.write('.\r\n')
self.sendLine(line) self.sendLine('.')
def do_RETR(self, i): resp, fp = self.getMessageFile(i) if not fp: return self.successResponse(resp) while 1: line = fp.readline() if not line: break if line[-1] == '\n': line = line[:-1] if line[:1] == '.': line = '.'+line self.transport.write(line+'\r\n') self.transport.write('.\r\n')
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write('%s %s\r\n' % (command, params))
self.sendLine('%s %s' % (command, params))
def sendShort(self, command, params): self.transport.write('%s %s\r\n' % (command, params)) self.command = command self.mode = SHORT
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
self.transport.write('%s %s\r\n' % (command, params))
self.sendLine('%s %s' % (command, params))
def sendLong(self, command, params): self.transport.write('%s %s\r\n' % (command, params)) self.command = command self.mode = FIRST_LONG
fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py
return socket.inet_ntoa(struct.pack("<l", i))
return socket.inet_ntoa(struct.pack("@l", i))
def getOutgoingInterface(self): i = self.socket.getsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF) # is this cross-platform? return socket.inet_ntoa(struct.pack("<l", i))
e08b4150ce438021c7b07045d3e05291016a7c1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e08b4150ce438021c7b07045d3e05291016a7c1e/udp.py
isinstance(self.result, failure.Failure) and self.result.frames):
isinstance(self.result, failure.Failure)): log.msg("Unhandled error in Deferred:")
def __del__(self): """Print tracebacks and die. If the *last* (and I do mean *last*) callback leaves me in an error state, print a traceback (if said errback is a Failure). """ if (self.called and self.isError and isinstance(self.result, failure.Failure) and self.result.frames): log.err(self.result)
f034de37098035588b12199aa35f6e20280345e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f034de37098035588b12199aa35f6e20280345e4/defer.py
Throws: a CannotListenError, as defined in twisted.internet.error, if it
@raise CannotListenError: as defined in twisted.internet.error, if it
def listenTCP(self, port, factory, backlog=5, interface=''): """Connects a given protocol factory to the given numeric TCP/IP port.
97e07c1876e6ccb6aa36e03f4d9706ee6e059380 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/97e07c1876e6ccb6aa36e03f4d9706ee6e059380/interfaces.py
Returns an object implementing IConnector. This connector will call various callbacks on the factory when a connection is made, failed, or lost - see ClientFactory docs for details.
@returns: An object implementing IConnector. This connector will call various callbacks on the factory when a connection is made, failed, or lost - see ClientFactory docs for details.
def connectTCP(self, host, port, factory, timeout=30, bindAddress=None): """Connect a TCP client.
97e07c1876e6ccb6aa36e03f4d9706ee6e059380 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/97e07c1876e6ccb6aa36e03f4d9706ee6e059380/interfaces.py
def setdesc(self,desc): obj.description=desc def forgetit(self): pass
def setdesc(desc, obj=obj): obj.description = desc def forgetit(): pass
def setdesc(self,desc): obj.description=desc
81140ac7c9a559e240f2fcc140f2dbe0f200fc0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/81140ac7c9a559e240f2fcc140f2dbe0f200fc0e/player.py
reactor.callLater(0, protocol.lineReceived, response)
reactor.callLater(0.1, protocol.lineReceived, response)
def writeResponses(self, protocol, responses): for response in responses: reactor.callLater(0, protocol.lineReceived, response)
de6f0ece34210741bccbfd5d3a6311e05ecea749 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/de6f0ece34210741bccbfd5d3a6311e05ecea749/test_ftp.py
cmdline = ' '.join([_cmdLineQuote(a) for a in args[1:]])
cmdline = ' '.join([_cmdLineQuote(a) for a in args])
def __init__(self, reactor, protocol, command, args, environment, path): self.reactor = reactor self.protocol = protocol
ab1177e2a77ff9ff1bb629f272a1454466b30640 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ab1177e2a77ff9ff1bb629f272a1454466b30640/win32eventreactor.py
log.msg(iface=ITrialDebug, reporter="reporter option: %s, returning %r" % (opt, nany))
def getReporter(self): """return the class of the selected reporter @param config: a usage.Options instance after parsing options """ if not hasattr(self, 'optToQual'): self._loadReporters() for opt, qual in self.optToQual.iteritems(): if self[opt]: nany = reflect.namedAny(qual) log.msg(iface=ITrialDebug, reporter="rep...
cbcc6b2fc82d0648fbf3b511c93c041d71b3b8cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cbcc6b2fc82d0648fbf3b511c93c041d71b3b8cb/trial.py
log.msg(iface=ITrialDebug, reporter="config['reporter']: %s" % (config['reporter'],))
def _getReporter(config): log.msg(iface=ITrialDebug, reporter="config['reporter']: %s" % (config['reporter'],)) if config['reporter'] is not None: reporterKlass = config['reporter'] else: reporterKlass = config.getReporter() log.msg(iface=ITrialDebug, reporter="using reporter class: %r" % (reporterKlass,)) reporter = r...
cbcc6b2fc82d0648fbf3b511c93c041d71b3b8cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cbcc6b2fc82d0648fbf3b511c93c041d71b3b8cb/trial.py
log.msg(iface=ITrialDebug, reporter="using reporter class: %r" % (reporterKlass,))
def _getReporter(config): log.msg(iface=ITrialDebug, reporter="config['reporter']: %s" % (config['reporter'],)) if config['reporter'] is not None: reporterKlass = config['reporter'] else: reporterKlass = config.getReporter() log.msg(iface=ITrialDebug, reporter="using reporter class: %r" % (reporterKlass,)) reporter = r...
cbcc6b2fc82d0648fbf3b511c93c041d71b3b8cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cbcc6b2fc82d0648fbf3b511c93c041d71b3b8cb/trial.py
assert (path.dirname(setup.__file__) == path.dirname(path.dirname(twisted.__file__)) ), "%s is not Twisted setup.py" % (setup,) self.packageNames = setup.setup_args['packages']
remove = len(os.path.dirname(os.path.dirname(twisted.__file__)))+1 def visit(dirlist, directory, files): if '__init__.py' in files: d = directory[remove:].replace('/','.') dirlist.append(d) self.packageNames = [] os.path.walk(os.path.dirname(twisted.__file__), visit, self.packageNames)
def setUp(self): assert (path.dirname(setup.__file__) == path.dirname(path.dirname(twisted.__file__)) ), "%s is not Twisted setup.py" % (setup,) self.packageNames = setup.setup_args['packages']
41395aa41af276090df371d459344f08e121fba2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/41395aa41af276090df371d459344f08e121fba2/test_doc.py
del package
def testPackages(self): """Looking for docstrings in all packages.""" docless = [] for packageName in self.packageNames: try: package = reflect.namedModule(packageName) except Exception, e: # This is testing doc coverage, not importability. # (Really, I don't want to deal with the fact that I don't # have pyserial ins...
41395aa41af276090df371d459344f08e121fba2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/41395aa41af276090df371d459344f08e121fba2/test_doc.py
self._append(Failure())
self._buffer.append(Failure())
def _process(self): """ pull values from the iterable and add them to the buffer """ try: self._iterable = iter(self._iterable) except: self._append(Failure()) else: try: while 1: self._buffer.append(self._iterable.next()) except StopIteration: pass except: self._append(Failure()) self._stop = 1
6dea9c8aa51573693da7fc94c124b0fba9dc7b06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6dea9c8aa51573693da7fc94c124b0fba9dc7b06/flow.py
if os.path.isfile(fn) and not os.path.samefile(fn, retFile):
samefile = getattr(os.path, 'samefile', lambda x, y: x == y) if os.path.isfile(fn) and not samefile(fn, retFile):
def filenameToModule(fn): if not os.path.exists(fn): raise ValueError("%r doesn't exist" % (fn,)) try: ret = reflect.namedAny(reflect.filenameToModuleName(fn)) except (ValueError, AttributeError): # Couldn't find module. The file 'fn' is not in PYTHONPATH return _importFromFile(fn) # ensure that the loaded module matc...
aa39c07343f9878780fba187fbfac54645ca4bd2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/aa39c07343f9878780fba187fbfac54645ca4bd2/runner.py
def __setitem__(self, key, value):
def add(self, key):
def __setitem__(self, key, value): if self.map.has_key(key): self.keys[self.map[key]] = value else: self.keys.append(key) self.map[key] = len(self.keys) - 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
self.keys[self.map[key]] = value
return
def __setitem__(self, key, value): if self.map.has_key(key): self.keys[self.map[key]] = value else: self.keys.append(key) self.map[key] = len(self.keys) - 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
self.dirtyRows = OrderedDict() self.insertedRows = OrderedDict() self.deletedRows = OrderedDict()
self.dirtyRows = OrderedSet() self.insertedRows = OrderedSet() self.deletedRows = OrderedSet()
def __init__(self, log, journaledService, reflector): self.reflector = reflector self.dirtyRows = OrderedDict() self.insertedRows = OrderedDict() self.deletedRows = OrderedDict() self.syncing = 0 base.Journal.__init__(self, log, journaledService)
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
self.insertedRows[obj] = 1
self.insertedRows.add(obj)
def updateRow(self, obj): """Mark on object for updating when sync()ing.""" if self.insertedRows.has_key(obj): self.insertedRows[obj] = 1 else: self.dirtyRows[obj] = 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
self.dirtyRows[obj] = 1
self.dirtyRows.add(obj)
def updateRow(self, obj): """Mark on object for updating when sync()ing.""" if self.insertedRows.has_key(obj): self.insertedRows[obj] = 1 else: self.dirtyRows[obj] = 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
self.dirtyRows[obj] = 1
self.dirtyRows.add(obj)
def insertRow(self, obj): """Mark on object for inserting when sync()ing.""" if self.deletedRows.has_key(obj): del self.deletedRows[obj] self.dirtyRows[obj] = 1 else: self.insertedRows[obj] = 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
self.insertedRows[obj] = 1
self.insertedRows.add(obj)
def insertRow(self, obj): """Mark on object for inserting when sync()ing.""" if self.deletedRows.has_key(obj): del self.deletedRows[obj] self.dirtyRows[obj] = 1 else: self.insertedRows[obj] = 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
self.deletedRows[obj] = 1
self.deletedRows.add(obj)
def deleteRow(self, obj): """Mark on object for deleting when sync()ing.""" if self.insertedRows.has_key(obj): del self.insertedRows[obj] return if self.dirtyRows.has_key(obj): del self.dirtyRows[obj] self.deletedRows[obj] = 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
def __init__(self, path="/"): self.path = path self.metamode = "mp3" self.databuffer = ""
f7135a2918b3d018f599459d44ae113bbc294985 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f7135a2918b3d018f599459d44ae113bbc294985/shoutcast.py
def handleResponsePart(self, data):
self.got_metadata = True def handleEndHeaders(self): if self.got_metadata: self.handleResponsePart = self.handleResponsePart_with_metadata else: self.handleResponsePart = self.gotMP3Data def handleResponsePart_with_metadata(self, data):
def handleHeader(self, key, value): if key.lower() == 'icy-metaint': self.metaint = int(value)
f7135a2918b3d018f599459d44ae113bbc294985 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f7135a2918b3d018f599459d44ae113bbc294985/shoutcast.py
"""Called with a list of (key, value) pairs of metadata.
"""Called with a list of (key, value) pairs of metadata, if metadata is available on the server.
def gotMetaData(self, metadata): """Called with a list of (key, value) pairs of metadata.
f7135a2918b3d018f599459d44ae113bbc294985 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f7135a2918b3d018f599459d44ae113bbc294985/shoutcast.py
file('omg', 'a').write(repr(bytes) + '\n') self.lastWrite = bytes lines = bytes.splitlines() if len(lines) == 1: self.transport.write(lines[0]) else: lastLine = lines.pop() for L in lines: self.transport.write(L)
if bytes: self.lastWrite = bytes lines = bytes.splitlines() if len(lines) == 1: self.transport.write(lines[0]) else: lastLine = lines.pop() for L in lines: self.transport.write(L) self.nextLine() self.transport.write(lastLine) if bytes.endswith('\n'):
def write(self, bytes): file('omg', 'a').write(repr(bytes) + '\n') self.lastWrite = bytes lines = bytes.splitlines() if len(lines) == 1: self.transport.write(lines[0]) else: lastLine = lines.pop() for L in lines: self.transport.write(L) self.nextLine() self.transport.write(lastLine) if bytes.endswith('\n'): self.nextLi...
58aa5e036664ab1d27bfaf8e3420f727da3e49f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/58aa5e036664ab1d27bfaf8e3420f727da3e49f5/insults.py
self.transport.write(lastLine) if bytes.endswith('\n'): self.nextLine()
def write(self, bytes): file('omg', 'a').write(repr(bytes) + '\n') self.lastWrite = bytes lines = bytes.splitlines() if len(lines) == 1: self.transport.write(lines[0]) else: lastLine = lines.pop() for L in lines: self.transport.write(L) self.nextLine() self.transport.write(lastLine) if bytes.endswith('\n'): self.nextLi...
58aa5e036664ab1d27bfaf8e3420f727da3e49f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/58aa5e036664ab1d27bfaf8e3420f727da3e49f5/insults.py
self._cbPasswordMatch, credentials.username)
self._cbPasswordMatch, str(credentials.username))
def requestAvatarId(self, credentials): if credentials.username in self.users: return defer.maybeDeferred( credentials.checkPassword, self.users[credentials.username]).addCallback( self._cbPasswordMatch, credentials.username) else: return defer.fail(error.UnauthorizedLogin())
b4ac49dc5cb42efab698ccfca190816f2d3e27c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b4ac49dc5cb42efab698ccfca190816f2d3e27c6/checkers.py
raise KeyError(u)
raise KeyError(username)
def getUser(self, username): if not self.caseSensitive: username = username.lower()
b4ac49dc5cb42efab698ccfca190816f2d3e27c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b4ac49dc5cb42efab698ccfca190816f2d3e27c6/checkers.py
""" def startMessage(self, recipients): """Create and return IMessages for delivery to each given recipient DEPRECATED. Implement validateTo() correctly. @type recipients: C{list} of C{Address} @param recipients: The addresses for which to create IMessages. @rtype: C{list} @return: The IMessage objects.
def validateFrom(self, helo, origin): """ Validate the address from which the message originates. @type helo: C{(str, str)} @param helo: The argument to the HELO command and the client's IP address.
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
def __getattr__(self,attr): attrmap = { 'name' : 'local', 'domain' : 'domain' } if attr in attrmap: warnings.warn("User.%s is deprecated, use User.dest.%s instead" % (attr, attrmap[attr]), category=DeprecationWarning, stacklevel=2) return getattr(self.dest, attrmap[attr]) else: raise AttributeError, ("'%s' object has n...
def __getattr__(self,attr): attrmap = { 'name' : 'local', 'domain' : 'domain' } if attr in attrmap: warnings.warn("User.%s is deprecated, use User.dest.%s instead" % (attr, attrmap[attr]), category=DeprecationWarning, stacklevel=2) return getattr(self.dest, attrmap[attr]) else: raise AttributeError, ("'%s' object has n...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
self._user_to = []
def __init__(self, delivery=None): self.mode = COMMAND self._from = None self._helo = None self._to = [] self._user_to = [] self.delivery = delivery
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
self._user_to = []
def do_HELO(self, rest): peer = self.transport.getPeer()[1] self._helo = (rest, peer) self._from = None self._to = [] self._user_to = [] self.sendCode(250, '%s Hello %s, nice to meet you' % (self.host, peer))
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
self._user_to = []
def do_MAIL(self, rest): if self._from: self.sendCode(503,"Only one sender per message, please") return # Clear old recipient list self._to = [] self._user_to = [] m = self.mail_re.match(rest) if not m: self.sendCode(501, "Syntax error") return
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
try: defer.maybeDeferred(self.validateFrom, self._helo, addr ).addCallbacks(self._cbFromValidate, self._ebFromValidate) except TypeError: if self.validateFrom.func_code.co_argcount == 5: warnings.warn( 'File "%s", line %d, in %s\n' ' %s.validateFrom call syntax has changed!\n' ' Please update your code!' % (self.val...
defer.maybeDeferred(self.validateFrom, self._helo, addr ).addCallbacks(self._cbFromValidate, self._ebFromValidate )
def do_MAIL(self, rest): if self._from: self.sendCode(503,"Only one sender per message, please") return # Clear old recipient list self._to = [] self._user_to = [] m = self.mail_re.match(rest) if not m: self.sendCode(501, "Syntax error") return
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
if from_ is None: warnings.warn( "Returning None from validateFrom is deprecated. " "Raise smtp.SMTPBadSender instead", DeprecationWarning ) self.sendCode(550, 'Cannot receive for specified address')
def _cbFromValidate(self, from_, code=250, msg='Sender address accepted'): if from_ is None: warnings.warn( "Returning None from validateFrom is deprecated. " "Raise smtp.SMTPBadSender instead", DeprecationWarning ) self.sendCode(550, 'Cannot receive for specified address') self._from = from_ self.sendCode(code, msg)
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
try: d = defer.maybeDeferred(self.validateTo, user) d.addCallbacks( self._cbToValidate, self._ebToValidate, callbackArgs=(user,) ) except TypeError: if self.validateTo.func_code.co_argcount == 4: warnings.warn( 'File "%s", line %d, in %s\n' ' %s.validateTo call syntax has changed!\n' ' Please update your code!' % (se...
d = defer.maybeDeferred(self.validateTo, user) d.addCallbacks( self._cbToValidate, self._ebToValidate, callbackArgs=(user,) )
def do_RCPT(self, rest): if not self._from: self.sendCode(503, "Must have sender before recipient") return m = self.rcpt_re.match(rest) if not m: self.sendCode(501, "Syntax error") return
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
if to is None: warnings.warn( "Returning None from validateTo is deprecated. " "Raise smtp.SMTPBadRcpt instead.", DeprecationWarning ) self.sendCode(550, 'Cannot receive for specified address') elif isinstance(to, User): warnings.warn( "Returning a User from validateTo is deprecated. " "Return an IMessage factory ins...
self._to.append((user, to))
def _cbToValidate(self, to, user=None, code=250, msg='Recipient address accepted'): if user is None: user = to if to is None: warnings.warn( "Returning None from validateTo is deprecated. " "Raise smtp.SMTPBadRcpt instead.", DeprecationWarning ) self.sendCode(550, 'Cannot receive for specified address') elif isinstanc...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
if failure.check(SMTPBadRcpt): self.sendCode(failure.value.code, failure.value.resp) elif failure.check(SMTPServerError):
if failure.check(SMTPBadRcpt, SMTPServerError):
def _ebToValidate(self, failure): if failure.check(SMTPBadRcpt): self.sendCode(failure.value.code, failure.value.resp) elif failure.check(SMTPServerError): self.sendCode(failure.value.code, failure.value.resp) else: log.err(failure) self.sendCode( 451, 'Requested action aborted: local error in processing' )
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
if self._from is None or (not self._to and not self._user_to):
if self._from is None or (not self._to):
def do_DATA(self, rest): if self._from is None or (not self._to and not self._user_to): self.sendCode(503, 'Must have valid receiver and originator') return assert self.delivery self.mode = DATA helo, origin, user_recipients = self._helo, self._from, self._user_to recipients = self._to self._from = None self._to = [] ...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
helo, origin, user_recipients = self._helo, self._from, self._user_to
helo, origin = self._helo, self._from
def do_DATA(self, rest): if self._from is None or (not self._to and not self._user_to): self.sendCode(503, 'Must have valid receiver and originator') return assert self.delivery self.mode = DATA helo, origin, user_recipients = self._helo, self._from, self._user_to recipients = self._to self._from = None self._to = [] ...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
self._user_to = []
def do_DATA(self, rest): if self._from is None or (not self._to and not self._user_to): self.sendCode(503, 'Must have valid receiver and originator') return assert self.delivery self.mode = DATA helo, origin, user_recipients = self._helo, self._from, self._user_to recipients = self._to self._from = None self._to = [] ...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
if user_recipients: try: self.__messages = self.startMessage(user_recipients) except SMTPServerError, e: self.sendCode(e.code, e.resp) self.mode = COMMAND return rcvdhdr = self.delivery.receivedHeader( helo, origin, map(str, user_recipients)) else: try: self.__messages = [f() for (u, f) in recipients] except SMTPServer...
try: self.__messages = [f() for (u, f) in recipients] except SMTPServerError, e: self.sendCode(e.code, e.resp) self.mode = COMMAND return except: log.err() self.sendCode(550, "Internal server error") self.mode = COMMAND return rcvdhdr = self.delivery.receivedHeader( helo, origin, [u for (u, f) in recipients])
def do_DATA(self, rest): if self._from is None or (not self._to and not self._user_to): self.sendCode(503, 'Must have valid receiver and originator') return assert self.delivery self.mode = DATA helo, origin, user_recipients = self._helo, self._from, self._user_to recipients = self._to self._from = None self._to = [] ...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
log.msg(fmt % (origin, map(str, [u for (u, f) in recipients] or user_recipients)))
log.msg(fmt % (origin, [str(u) for (u, f) in recipients]))
def do_DATA(self, rest): if self._from is None or (not self._to and not self._user_to): self.sendCode(503, 'Must have valid receiver and originator') return assert self.delivery self.mode = DATA helo, origin, user_recipients = self._helo, self._from, self._user_to recipients = self._to self._from = None self._to = [] ...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
self._user_to = []
def do_RSET(self, rest): self._from = None self._to = [] self._user_to = [] self.sendCode(250, 'I remember nothing.')
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
else: self.sendCode(451, 'Requested action aborted: error in processing')
elif reason.check(SMTPAddressError): self.sendCode(reason.value.code, reason.value.resp) else: self.sendCode(451, 'Requested action aborted: local error in processing')
def _ebAuthenticated(self, reason): self.challenge = None if reason.check(cred.error.UnauthorizedLogin): self.sendCode(535, 'Authentication failed') else: self.sendCode(451, 'Requested action aborted: error in processing') log.err(reason)
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
try: self.sentMail(code, resp, len(self.successAddresses), self.toAddressesResult, self.log) except TypeError: if self.sentMail.func_code.co_argcount == 2: warnings.warn( 'File "%s", line %d, in %s\n' ' %s.sentMail call syntax has changed!\n' ' Please update your code!' % (self.sentMail.func_code.co_filename, self.se...
self.sentMail(code, resp, len(self.successAddresses), self.toAddressesResult, self.log)
def smtpState_msgSent(self, code, resp): if self._from is not None: # If there was a pending message try: self.sentMail(code, resp, len(self.successAddresses), self.toAddressesResult, self.log) except TypeError: if self.sentMail.func_code.co_argcount == 2: warnings.warn( 'File "%s", line %d, in %s\n' ' %s.sentMail cal...
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
self._user_to = []
def do_EHLO(self, rest): peer = self.transport.getPeer()[1] self._helo = (rest, peer) self._from = None self._to = [] self._user_to = [] ext = self.extensions() self.sendCode( 250, '%s\n%s Hello %s, nice to meet you' % ( self.listExtensions(), self.host, peer ) )
1170bde3fe634dd3cc7b050c30af0e5f44a01304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1170bde3fe634dd3cc7b050c30af0e5f44a01304/smtp.py
ttyGID = os.stat(self.ptyTuple[2])[5] os.chown(self.ptyTuple[2], uid, ttyGID)
if self.ptyTuple: ttyGID = os.stat(self.ptyTuple[2])[5] os.chown(self.ptyTuple[2], uid, ttyGID)
def request_exec(self, data): command = common.getNS(data)[0] user = self.conn.transport.authenticatedUser uid, gid = user.getUserGroupID() homeDir = user.getHomeDir() shell = user.getShell() or '/bin/sh' command = [shell, '-c', command] peerHP = tuple(self.conn.transport.transport.getPeer()[1:]) hostP = (self.conn.tra...
d36421c1507019c5d38d438a6c7de8f8de12082f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d36421c1507019c5d38d438a6c7de8f8de12082f/session.py
if hasattr(self, 'pty'):
if self.pty is not None:
def dataReceived(self, data): if not hasattr(self, 'client'): #self.conn.sendClose(self) self.buf += data return if hasattr(self, 'pty'): import tty attr = tty.tcgetattr(self.pty.fileno())[3] if not attr & tty.ECHO and attr & tty.ICANON: # no echo self.conn.transport.sendIgnore('\x00' * (8+len(data))) self.client.dataR...
d36421c1507019c5d38d438a6c7de8f8de12082f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d36421c1507019c5d38d438a6c7de8f8de12082f/session.py
ttyGID = os.stat(self.ptyTuple[2])[5] os.chown(self.ptyTuple[2], 0, ttyGID)
ttyGID = os.stat(self.ptyTuple[2])[5] os.chown(self.ptyTuple[2], 0, ttyGID)
def closed(self): import os if self.pty: import signal self.pty.loseConnection() self.pty.signalProcess('HUP') ttyGID = os.stat(self.ptyTuple[2])[5] os.chown(self.ptyTuple[2], 0, ttyGID) try: del self.client except AttributeError: pass # we didn't have a client channel.SSHChannel.closed(self)
d36421c1507019c5d38d438a6c7de8f8de12082f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d36421c1507019c5d38d438a6c7de8f8de12082f/session.py
"""we got a global request. pretty much, this is just used by the client
""" We got a global request. pretty much, this is just used by the client
def gotGlobalRequest(self, requestType, data): """we got a global request. pretty much, this is just used by the client to request that we forward a port from the server to the client. returns either: 1: request accepted 1, <data>: request accepted with request specific data 0: request denied """ return 0
1d60580e1bbd13b8e0033a128f0d6e1149f57888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1d60580e1bbd13b8e0033a128f0d6e1149f57888/connection.py
1: request accepted 1, <data>: request accepted with request specific data 0: request denied
- 1: request accepted - 1, <data>: request accepted with request specific data - 0: request denied
def gotGlobalRequest(self, requestType, data): """we got a global request. pretty much, this is just used by the client to request that we forward a port from the server to the client. returns either: 1: request accepted 1, <data>: request accepted with request specific data 0: request denied """ return 0
1d60580e1bbd13b8e0033a128f0d6e1149f57888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1d60580e1bbd13b8e0033a128f0d6e1149f57888/connection.py
del sys.modules[modname]
del sys.modules['twisted.trial.test.importErrors']
def testImportError(self): self.failIfImportErrors = False # Add a module that fails to import if modname in sys.modules: # Previous tests might leave this hanging around in Python < 2.4. del sys.modules[modname] self.suite.addModule('twisted.trial.test.importErrors') self.suite.run()
1ec5dc43cd8c593ffdfe932f45f26fe75f89774e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1ec5dc43cd8c593ffdfe932f45f26fe75f89774e/test_adapters.py
("content-encoding", self.contentType()),
("content-encoding", self.contentEncoding()),
def setHeaders(response): for (header, value) in ( ("content-length", self.contentLength()), ("content-type", self.contentType()), ("content-encoding", self.contentType()), ): if value is not None: response.headers.setHeader(header, value)
ece0c354a23e3f6025e539f710dd775b92d0bc29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ece0c354a23e3f6025e539f710dd775b92d0bc29/resource.py
This callback will be called with one method, this instance.
This callback will be called with one argument, this instance.
def notifyOnDisconnect(self, callback): """Register a callback to be called if our broker gets disconnected.
1a93ab3e183ef6bc5d75ed809d92737628e44232 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1a93ab3e183ef6bc5d75ed809d92737628e44232/pb.py
"""Register a callback to be called if our broker gets disconnected."""
"""Remove a callback that was registered with notifyOnDisconnect."""
def dontNotifyOnDisconnect(self, callback): """Register a callback to be called if our broker gets disconnected.""" self.disconnectCallbacks.remove(callback) if not self.disconnectCallbacks: self.broker.dontNotifyOnDisconnect(self._disconnected)
1a93ab3e183ef6bc5d75ed809d92737628e44232 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1a93ab3e183ef6bc5d75ed809d92737628e44232/pb.py
Argument.__init__(self, name, default=None, shortDesc=None, longDesc=None, hints=None, allowNone=1)
Argument.__init__(self, name, default=default, shortDesc=shortDesc, longDesc=longDesc, hints=hints, allowNone=allowNone)
def __init__(self, name, default=None, shortDesc=None, longDesc=None, hints=None, allowNone=1, min=0, max=None): Argument.__init__(self, name, default=None, shortDesc=None, longDesc=None, hints=None, allowNone=1) self.min = min self.max = max
f55bf3d5d9835d62ba819009dad26a774e4afca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f55bf3d5d9835d62ba819009dad26a774e4afca2/formmethod.py
request.write(oldwidgets.formatFailure(fail))
request.write(webutil.formatFailure(fail))
def renderFailure(fail, request): if not fail: fail = failure.Failure() log.err(fail) request.write(oldwidgets.formatFailure(fail)) #request.finish()
906a3af1c11e7690021c0c63635b41aeba5ded97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/906a3af1c11e7690021c0c63635b41aeba5ded97/utils.py
(self.namespace, self.streamHost)
(self.namespace, self.streamHost.encode('utf-8'))
def connectionMade(self): # Generate stream header if self.version == 1.0: sh = "<stream:stream xmlns='%s' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>" % \ (self.namespace) else: sh = "<stream:stream xmlns='%s' xmlns:stream='http://etherx.jabber.org/streams' to='%s'>" % \ (self.namespace, self.stream...
2a737275b1bc157854737ee461a48813687b3b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2a737275b1bc157854737ee461a48813687b3b5b/xmlstream.py
if not isinstance(view, widgets.DefaultWidget):
if model is not peek(self.viewStack).model and not isinstance(view, widgets.DefaultWidget):
def handleNode(self, request, node): submodelName = node.attributes.get('model') if submodelName is None: submodelName = "" model = self.getNodeModel(request, node, submodelName) view = self.getNodeView(request, node, submodelName, model) controller = self.getNodeController(request, node, submodelName, model) if view o...
e2ae3b2bbe05b00083c146eb3aadc008570e6b47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e2ae3b2bbe05b00083c146eb3aadc008570e6b47/view.py
curId = id(view) theId = "woven_id_" + str(curId)
theId = "woven_id_%d" % id(view)
def handleNode(self, request, node): submodelName = node.attributes.get('model') if submodelName is None: submodelName = "" model = self.getNodeModel(request, node, submodelName) view = self.getNodeView(request, node, submodelName, model) controller = self.getNodeController(request, node, submodelName, model) if view o...
e2ae3b2bbe05b00083c146eb3aadc008570e6b47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e2ae3b2bbe05b00083c146eb3aadc008570e6b47/view.py
readAndDiscard(self, truncater)
readAndDiscard(truncater)
def notifyClosed(self, truncater): if self.closed: # we are closed, have first half really close truncater.postTruncater = None truncater.close() elif self.sentInitialSegment: # We are trying to read, read up first half readAndDiscard(self, truncater) else: # Idle, store closed info. self.truncaterClosed = truncater
5f826dfef2c6bdf5b68303e02ea9b35a1f8abf4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5f826dfef2c6bdf5b68303e02ea9b35a1f8abf4a/stream.py
'BufferedStream', 'readStream', 'ProcessStreamer']
'BufferedStream', 'readStream', 'ProcessStreamer', 'readIntoFile']
def split(self, offset): off = offset - len(self.data) pre, post = self.stream.split(max(0, off)) pre = BufferedStream(pre) post = BufferedStream(post) if off < 0: pre.data = self.data[:-off] post.data = self.data[-off:] else: pre.data = self.data return pre, post
5f826dfef2c6bdf5b68303e02ea9b35a1f8abf4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5f826dfef2c6bdf5b68303e02ea9b35a1f8abf4a/stream.py
raise AssertionError, (msg or '%s != %s' % (first, second))
raise AssertionError, (msg or '%r != %r' % (first, second))
def failUnlessEqual(self, first, second, msg=None): if not first == second: raise AssertionError, (msg or '%s != %s' % (first, second))
d29359681df08f1fc76cd6fca861bae9102ed8c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d29359681df08f1fc76cd6fca861bae9102ed8c0/unittest.py
raise AssertionError, (msg or '%s == %s' % (first, second))
raise AssertionError, (msg or '%r == %r' % (first, second))
def failIfEqual(self, first, second, msg=None): if not first != second: raise AssertionError, (msg or '%s == %s' % (first, second))
d29359681df08f1fc76cd6fca861bae9102ed8c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d29359681df08f1fc76cd6fca861bae9102ed8c0/unittest.py
l = traceback.extract_tb(tb, limit) return ['%s:%s:%s\n' % x[:-1] for x in l]
l = extract_tb(tb, limit) return ['%s:%s:%s\n' % (filename, lineno, method) for filename, lineno, method, _ in l]
def emacs_format_exception(eType, eValue, tb, limit=None): """Compact traceback formatting, parseable by emacs compile-mode. """ # TODO: hide trial frames like plain_format_exception l = traceback.extract_tb(tb, limit) return ['%s:%s:%s\n' % x[:-1] for x in l]
63f87e7c91d0c84da440f07605d57b639add5878 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/63f87e7c91d0c84da440f07605d57b639add5878/util.py
self._exception = exception
self._exception = e
def _doAction(self, function, *args, **kwargs): """Run the action whose result we are. Should only be called by the scheduler.""" try: result = apply(function, args, kwargs) except Exception, e: self._exception = exception else: self._result = result self._finished = 1
e52f79b5d91db7de5130c3c3c16f50208cc5df71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e52f79b5d91db7de5130c3c3c16f50208cc5df71/threadtask.py