rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for r in ans:
for r in answers:
def extractRecord(resolver, name, answers, level = 10): if not level: return None for r in ans: if r.name == name and r.type == dns.A6: return socket.inet_ntop(socket.AF_INET6, r.payload.address) for r in ans: if r.name == name and r.type == dns.AAAA: return socket.inet_ntop(socket.AF_INET6, r.payload.address) for r in...
359eb45a0c627108e904c7886151fe1df7db7cf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/359eb45a0c627108e904c7886151fe1df7db7cf0/common.py
class CMulticastPort(cudp.UDPPortMixin, udp.MulticastPort):
class CMulticastPort(cudp.UDPPortMixin, _origMulticastPort):
def _bindSocket(self): _origUDPPort._bindSocket(self) cudp.UDPPortMixin.__init__(self, self)
07f0a26679d6c96bee264b34397ec463a08511ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07f0a26679d6c96bee264b34397ec463a08511ef/hooks.py
udp.MulticastPort.__init__(self, *args, **kwargs)
_origMulticastPort.__init__(self, *args, **kwargs) def _bindSocket(self): _origMulticastPort._bindSocket(self)
def __init__(self, *args, **kwargs): udp.MulticastPort.__init__(self, *args, **kwargs) cudp.UDPPortMixin.__init__(self, self)
07f0a26679d6c96bee264b34397ec463a08511ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07f0a26679d6c96bee264b34397ec463a08511ef/hooks.py
self._setRealAddress(self.addr[1])
self._setRealAddress(self.addr[0])
def resolveAddress(self): if abstract.isIPAddress(self.addr[0]): self._setRealAddress(self.addr[1]) else: main.resolver.resolve(self.addr[0], self._setRealAddress, self.failIfNotConnected)
7f371502e7921166e6f8ea743ff91563c6403adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7f371502e7921166e6f8ea743ff91563c6403adc/tcp.py
str = u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><title>Divmod Quotient</title><link href="/css" rel="stylesheet" /></head><body><img src="/images/anonymous-logo.png" id="anonym...
def testNamedChildren(self): tests = {"<foo><bar /><bar unf='1' /><bar>asdfadsf</bar>" "<bam/></foo>" : 3, '<foo>asdf</foo>' : 0, '<foo><bar><bar></bar></bar></foo>' : 1, } for t in tests.keys(): node = microdom.parseString(t).documentElement result = domhelpers.namedChildren(node, 'bar') self.assertEquals(len(result),...
71c92b310b7662fd033ac94b573283285d9a5ca8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/71c92b310b7662fd033ac94b573283285d9a5ca8/test_xml.py
otherwise it returns "name"
otherwise it returns "<string>"
def _getFPName(fp): """returns a file object's name attr if it has one, otherwise it returns "name" """ if hasattr(fp, 'name'): return fp.name return 'file' # stringIO objects have no .name attr
633aca2f0a955bb6023a7659468830e449509cb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/633aca2f0a955bb6023a7659468830e449509cb7/ftp.py
return 'file'
return getattr(fp, 'name', '<string>')
def _getFPName(fp): """returns a file object's name attr if it has one, otherwise it returns "name" """ if hasattr(fp, 'name'): return fp.name return 'file' # stringIO objects have no .name attr
633aca2f0a955bb6023a7659468830e449509cb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/633aca2f0a955bb6023a7659468830e449509cb7/ftp.py
def __init__(self): self.portal = None self.shell = None self.user = None self.peerHost = None self.dtpTxfrMode = None self.blocked = None self.dtpFactory = None self.dtpInstance = None self.dtpPort = None self.dtpInetPort = None self.dtpHostPort = None self.binary = True
portal = None shell = None user = None peerHost = None dtpTxfrMode = None blocked = None dtpFactory = None dtpInstance = None dtpPort = None dtpInetPort = None dtpHostPort = None binary = True
def cleanPath(path): # cleanup backslashes and multiple foreslashes log.debug("pre-cleaned path: %s" % path) if path: path = re.sub(r'[\\]{2,}?', '/', path) path = re.sub(r'[/]{2,}?','/', path) path = re.sub(r'[*]?', '', path) path = os.path.normpath(path) log.debug('cleaned path: %s' % path) return path
633aca2f0a955bb6023a7659468830e449509cb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/633aca2f0a955bb6023a7659468830e449509cb7/ftp.py
print 'YAY'
def _cbLogin(self, (i, a, l), message, host, port): print 'YAY' # It's stateless, matey. What a joke. self.register(message, host, port)
2cf54c71b0e6e0d1d35734cbb5ae7e6445286262 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2cf54c71b0e6e0d1d35734cbb5ae7e6445286262/sip.py
log.debug('DTPFacotry.buildProtocol')
log.debug('DTPFactory.buildProtocol')
def buildProtocol(self, addr): log.debug('DTPFacotry.buildProtocol') self.cancelTimeout() if self.pi.dtpInstance: # only create one instance return p = DTP() p.factory = self p.pi = self.pi self.pi.dtpInstance = p return p
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
def doStop(self): log.debug('dtpFactory.doStop') if self.numPorts > 0: protocol.Factory.doStop(self)
def stopFactory(self): log.debug('dtpFactory.stopFactory')
def doStop(self): log.debug('dtpFactory.doStop') if self.numPorts > 0: protocol.Factory.doStop(self) self.cancelTimeout()
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
self.doStop()
self.stopFactory()
def timeoutFactory(self): log.msg('timed out waiting for DTP connection') if self.deferred: d, self.deferred = self.deferred, None d.errback(defer.TimeoutError()) self.doStop()
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
if self.dtpFactory.deferred: d, self.dtpFactory.deferred = self.dtpFactory.deferred, None d.errback(FTPTimeoutError('cleaning up dtp!'))
def timeoutConnection(self): log.msg('FTP timed out') self.transport.loseConnection() if self.dtpFactory.deferred: d, self.dtpFactory.deferred = self.dtpFactory.deferred, None d.errback(FTPTimeoutError('cleaning up dtp!'))
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
self.setTimeout(self.timeOut) log.err(error)
log.msg(error) self.setTimeout(self.factory.timeOut)
def _ebDTP(self, error): self.setTimeout(self.timeOut) # restart timeOut clock after DTP returns log.err(error) r = error.trap(defer.TimeoutError, # this is called when DTP times out BogusClientError, # called if PI & DTP clients don't match FTPTimeoutError, # called when F...
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
self.dtpFactory.doStop()
self.dtpFactory.stopFactory()
def cleanupDTP(self): """call when DTP connection exits """ log.debug('cleanupDTP')
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
d.addCallback(lambda _: self.setTimeout(self.timeOut))
d.addCallback(lambda _: self.setTimeout(self.factory.timeOut))
def _doDTPCommand(self, cmd, *arg): self.setTimeout(None) # don't Time out when waiting for DTP Connection log.debug('FTP._doDTPCommand: self.blocked: %s' % self.blocked) if self.blocked is None: self.blocked = [] try: f = getattr(self.dtpInstance, "dtp_%s" % cmd, None) log.debug('running dtp function %s'...
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
@ivar timeOut: the protocol interpreter's idle timeout time in seconds
@ivar timeOut: the protocol interpreter's idle timeout time in seconds, default is 600 seconds
def ftp_QUIT(self, params=''): self.transport.loseConnection() log.debug("Client Quit")
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
def getUnixLongListString(self, path):
def getUnixLongListString(self, spath):
def getUnixLongListString(self, path): """generates the equivalent output of a unix ls -l path, but using python-native code.
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
cpath, spath = self.mapCPathToSPath(path) log.debug('cpath: %s, spath:%s' % (cpath, spath))
def getUnixLongListString(self, path): """generates the equivalent output of a unix ls -l path, but using python-native code.
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
sio = self.getUnixLongListString(path)
cpath, spath = self.mapCPathToSPath(path) log.debug('cpath: %s, spath:%s' % (cpath, spath)) sio = self.getUnixLongListString(spath)
def list(self, path): sio = self.getUnixLongListString(path) return (sio, len(sio.getvalue()))
4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py
def setUp(self): base.DelayedCall.debug = True
def stopFactory(self): if hasattr(self, "logFile"): if self.logFile != log.logfile: self.logFile.close() del self.logFile
396215bb126f96f96110941a2467284314fa2f88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/396215bb126f96f96110941a2467284314fa2f88/test_distrib.py
poidl = re.compile(r'"((?:\\"|.)*?)"(?: (<.*?>))?')
poidl = re.compile(r'(?:"((?:\"|.)*?)" |)<([^>]*)>')
def writeHeader(f, k, v): f.write(k.replace("\\", "\\\\").replace("\n", "\\n").replace(": ", ":\ ")) f.write(": ") f.write(v.replace("\n", "\n\t")) f.write("\n")
7e01273a9833fa7e55c1e96835ab5fa867041b2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7e01273a9833fa7e55c1e96835ab5fa867041b2c/mailsicle.py
oid = oidx[1:-1]
def loadOIDList(self, s): l = [] for descript, oidx in parseOIDList(s): oid = oidx[1:-1] l.append(self.loadNow(oid)) return l
7e01273a9833fa7e55c1e96835ab5fa867041b2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7e01273a9833fa7e55c1e96835ab5fa867041b2c/mailsicle.py
Integer.__init__(self, name, allowNone=1, default=default, shortDesc=shortDesc,
Integer.__init__(self, name, allowNone=allowNone, default=default, shortDesc=shortDesc,
def __init__(self, name, min, max, allowNone=1, default=None, shortDesc=None, longDesc=None, hints=None): self.min = min self.max = max Integer.__init__(self, name, allowNone=1, default=default, shortDesc=shortDesc, longDesc=longDesc, hints=hints)
4542c50708f11dffcc1befd785232535bedfada2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4542c50708f11dffcc1befd785232535bedfada2/formmethod.py
return ('UNIX', self.socket.getsockname())
return ('UNIX', repr(self.socket.getsockname()))
def getHost(self): return ('UNIX', self.socket.getsockname())
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
return ('UNIX', self.hostname)
return ('UNIX', repr(self.hostname))
def getPeer(self): return ('UNIX', self.hostname)
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
log.msg("%s starting on %r" % (self.factory.__class__, self.port))
log.msg("%s starting on %r" % (self.factory.__class__, repr(self.port)))
def startListening(self): """Create and bind my socket, and begin listening on it.
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
os.chmod(self.port, self.mode)
try: os.chmod(self.port, self.mode) except: pass
def startListening(self): """Create and bind my socket, and begin listening on it.
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
return ('UNIX', self.socket.getsockname())
return ('UNIX', repr(self.socket.getsockname()))
def getHost(self): """Returns a tuple of ('UNIX', fileName)
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
return ('UNIX', self.addr)
return ('UNIX', repr(self.addr))
def getPeer(self): return ('UNIX', self.addr)
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
log.msg("%s starting on %s"%(self.protocol.__class__, self.port))
log.msg("%s starting on %s"%(self.protocol.__class__, repr(self.port)))
def _bindSocket(self): log.msg("%s starting on %s"%(self.protocol.__class__, self.port)) try: skt = self.createInternetSocket() # XXX: haha misnamed method if self.port: skt.bind(self.port) except socket.error, le: raise error.CannotListenError, (None, self.port, le) if self.port: os.chmod(self.port, self.mode) self.co...
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
os.chmod(self.port, self.mode)
try: os.chmod(self.port, self.mode) except: pass
def _bindSocket(self): log.msg("%s starting on %s"%(self.protocol.__class__, self.port)) try: skt = self.createInternetSocket() # XXX: haha misnamed method if self.port: skt.bind(self.port) except socket.error, le: raise error.CannotListenError, (None, self.port, le) if self.port: os.chmod(self.port, self.mode) self.co...
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
return ('UNIX_DGRAM',)+self.socket.getsockname()
return ('UNIX_DGRAM',repr(self.socket.getsockname()))
def getHost(self): """ Returns a tuple of ('UNIX_DGRAM', address), indicating the servers address """ return ('UNIX_DGRAM',)+self.socket.getsockname()
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
if (no == ECONNREFUSED) or (platformType == "win32" and no == WSAECONNRESET):
if no == ECONNREFUSED:
def doRead(self): """Called when my socket is ready for reading.""" read = 0 while read < self.maxThroughput: try: data, addr = self.socket.recvfrom(self.maxPacketSize) read += len(data) self.protocol.datagramReceived(data) except socket.error, se: no = se.args[0] if no in (EAGAIN, EINTR, EWOULDBLOCK): return if (no ==...
b179b298195f5b78c8f637eca6973ab49e6d0b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b179b298195f5b78c8f637eca6973ab49e6d0b89/unix.py
def __init__(self, directory, smartHostIP, maxConnections=1,
def __init__(self, directory, smartHostAddr, maxConnections=1,
def __init__(self, directory, smartHostIP, maxConnections=1, maxMessagesPerConnection=10): '''initialize
27ade2f80864d50ca2da00553ff3b93709bdea6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/27ade2f80864d50ca2da00553ff3b93709bdea6f/relaymanager.py
self.smartHostIP = smartHostIP self.delayed = delayed
self.smartHostAddr = smartHostAddr
def __init__(self, directory, smartHostIP, maxConnections=1, maxMessagesPerConnection=10): '''initialize
27ade2f80864d50ca2da00553ff3b93709bdea6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/27ade2f80864d50ca2da00553ff3b93709bdea6f/relaymanager.py
notifyFailure = notifySuccess
def notifyFailure(self, relay, message): log.log("could not relay "+message) self.notifySuccess(relay, message)
def notifySuccess(self, relay, message): '''a relay sent a message successfully
27ade2f80864d50ca2da00553ff3b93709bdea6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/27ade2f80864d50ca2da00553ff3b93709bdea6f/relaymanager.py
transport = tcp.Client(smartHostIP, 25, protocol)
transport = tcp.Client(smartHostAddr[0], smartHostAddr[1], protocol)
def checkState(self): '''call me periodically to check I am still up to date
27ade2f80864d50ca2da00553ff3b93709bdea6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/27ade2f80864d50ca2da00553ff3b93709bdea6f/relaymanager.py
raise HTTPError(responsecode.FORBIDDEN, StatusResponse("Protected property %s may not be set." % (property.sname(),)))
raise HTTPError(StatusResponse(responsecode.FORBIDDEN, "Protected property %s may not be set." % (property.sname(),)))
def writeProperty(self, property, request): """ See L{IDAVResource.writeProperty}. """ assert isinstance(property, davxml.WebDAVElement)
c22af916840e89a9da62fb36308451ccc3133cb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c22af916840e89a9da62fb36308451ccc3133cb9/resource.py
raise HTTPError(responsecode.FORBIDDEN, StatusResponse("Live property %s cannot be deleted." % (property.sname(),)))
raise HTTPError(StatusResponse(responsecode.FORBIDDEN, "Live property %s cannot be deleted." % (property.sname(),)))
def removeProperty(self, property, request): """ See L{IDAVResource.removeProperty}. """ if type(property) is tuple: qname = property else: qname = property.qname()
c22af916840e89a9da62fb36308451ccc3133cb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c22af916840e89a9da62fb36308451ccc3133cb9/resource.py
print "EXIT", self
pass
def exit(self, request): """We are done handling the node to which this controller was attached. """ print "EXIT", self
5cbbe214b1daf141167d6d431bb84b1c890356c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5cbbe214b1daf141167d6d431bb84b1c890356c8/controller.py
self.assertEquals(c.index, 1000)
self.assertEquals(c.index, 1000, "threads lost a count")
def testCallInThread(self): c = Counter() for i in range(1000): reactor.callInThread(c.sync_add) oldIndex = 0 while c.index < 1000: assert oldIndex <= c.index oldIndex = c.index self.assertEquals(c.index, 1000)
78cd298454d3903f0e142fbd82571675ea4fc7ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/78cd298454d3903f0e142fbd82571675ea4fc7ae/test_threads.py
[(j[0], repr(j[1])) for j in v[3]], [(j[0], repr(j[1])) for j in v[4]]
[(j[0], reflect.safe_repr(j[1])) for j in v[3]], [(j[0], reflect.safe_repr(j[1])) for j in v[4]]
def __getstate__(self): """Avoid pickling objects in the traceback. """ if self.pickled: return self.__dict__ c = self.__dict__.copy() c['frames'] = [ [ v[0], v[1], v[2], [(j[0], repr(j[1])) for j in v[3]], [(j[0], repr(j[1])) for j in v[4]] ] for v in self.frames ]
76f0b6b1295d83e8162d8650fad62d43d0ddddc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/76f0b6b1295d83e8162d8650fad62d43d0ddddc5/failure.py
def __init__(self, text=None):
def __init__(self, text=None, public=0):
def __init__(self, text=None): self.text = text self.deferred = Deferred() self.ready = 1
10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b/ftp.py
ftpCommand.deferred.errback(Failure(ConnectionLost('FTP connection lost', error)))
ftpCommand.fail(Failure(ConnectionLost('FTP connection lost', error)))
def fail(self, error): """Disconnect, and also give an error to any queued deferreds.""" self.transport.loseConnection() while self.actionQueue: ftpCommand = self.popCommandQueue() ftpCommand.deferred.errback(Failure(ConnectionLost('FTP connection lost', error))) return error
10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b/ftp.py
self.queueStringCommand(command).addErrback(self.fail)
self.queueStringCommand(command, public=0).addErrback(self.fail)
def queueLogin(self): """Initialise the connection.
10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b/ftp.py
cmd = FTPCommand(command)
def buildProtocol(self, ignored): self.protocol.factory = self return self.protocol
10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b/ftp.py
cmd = FTPCommand(command)
def buildProtocol(self, ignored): self.protocol.factory = self return self.protocol
10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b/ftp.py
def queueStringCommand(self, command):
def queueStringCommand(self, command, public=1):
def queueStringCommand(self, command): """Queues a string to be issued as an FTP command Returns a Deferred that will be called when the response to the command has been received.""" ftpCommand = FTPCommand(command) self.queueCommand(ftpCommand) return ftpCommand.deferred
10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b/ftp.py
ftpCommand = FTPCommand(command)
ftpCommand = FTPCommand(command, public)
def queueStringCommand(self, command): """Queues a string to be issued as an FTP command Returns a Deferred that will be called when the response to the command has been received.""" ftpCommand = FTPCommand(command) self.queueCommand(ftpCommand) return ftpCommand.deferred
10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10f1a9e0ff16a1ec1371e9a9174eb2e0fcc81c0b/ftp.py
def connectionMade(self): # Twisted's SSL support is terribly broken. self.transport.loseConnection()
9b57404af3bbac1a578b886663c2068a2e94c9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9b57404af3bbac1a578b886663c2068a2e94c9fb/test_ssl.py
self.factory.connectionDisconnected.callback(None)
self.factory.connectionDisconnected.callback(reason)
def connectionLost(self, reason): self.factory.connectionDisconnected.callback(None)
9b57404af3bbac1a578b886663c2068a2e94c9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9b57404af3bbac1a578b886663c2068a2e94c9fb/test_ssl.py
class ImmediateDisconnectTestCase(unittest.TestCase, ContextGeneratingMixin): todo = "Logged SSL.Error - [('SSL routines', 'SSL23_READ', 'ssl handshake failure')]"
class ConnectionLostTestCase(unittest.TestCase, ContextGeneratingMixin):
def testOpenSSLBuffering(self): serverProto = self.serverProto = SingleLineServerProtocol() clientProto = self.clientProto = RecordingClientProtocol()
9b57404af3bbac1a578b886663c2068a2e94c9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9b57404af3bbac1a578b886663c2068a2e94c9fb/test_ssl.py
""" Initialize me against a database.
"""Initialize me against a database.
def __init__(self, dbpool, rowClasses): """ Initialize me against a database. """ adbapi.Augmentation.__init__(self, dbpool) reflector.Reflector.__init__(self, rowClasses)
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""construct all the SQL for database operations on <tableName> and populate the class <rowClass> with that info.
"""Construct all the SQL templates for database operations on <tableName> and populate the class <rowClass> with that info.
def _populateSchemaFor(self, rc): """construct all the SQL for database operations on <tableName> and populate the class <rowClass> with that info. """ attributes = ("rowColumns", "rowKeyColumns", "rowTableName" ) for att in attributes: if not hasattr(rc, att): raise DBError("RowClass %s must have class variable: %s" %...
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""(Internal) Build SQL to update a RowObject.
"""(Internal) Build SQL template to update a RowObject.
def buildUpdateSQL(self, tableInfo): """(Internal) Build SQL to update a RowObject.
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""(Internal) Build SQL to insert a new row.
"""(Internal) Build SQL template to insert a new row.
def buildInsertSQL(self, tableInfo): """(Internal) Build SQL to insert a new row.
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""Build the SQL to delete a row from the table.
"""Build the SQL template to delete a row from the table.
def buildDeleteSQL(self, tableInfo): """Build the SQL to delete a row from the table. """ sql = "DELETE FROM %s " % tableInfo.rowTableName # build where clause first = 1 sql = sql + " WHERE " for keyColumn, type in tableInfo.rowKeyColumns: if not first: sql = sql + " AND " sql = sql + " %s = %s " % (keyColumn, "%s") fi...
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""build SQL to update my current state.
"""Build SQL to update the contents of rowObject.
def updateRowSQL(self, rowObject): """build SQL to update my current state. """ args = [] tableInfo = self.schema[rowObject.rowTableName] # build update attributes for column, type in tableInfo.rowColumns: if not getKeyColumn(rowObject.__class__, column): args.append(self.quote_value(rowObject.findAttribute(column), ty...
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""update my contents to the database.
"""Update the contents of rowObject to the database.
def updateRow(self, rowObject): """update my contents to the database. """ sql = self.updateRowSQL(rowObject) rowObject.setDirty(0) return self.runOperation(sql)
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""build SQL to insert my current state.
"""Build SQL to insert the contents of rowObject.
def insertRowSQL(self, rowObject): """build SQL to insert my current state. """ args = [] tableInfo = self.schema[rowObject.rowTableName] # build values for column, type in tableInfo.rowColumns: args.append(self.quote_value(rowObject.findAttribute(column), type)) return self.getTableInfo(rowObject).insertSQL % tuple(ar...
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
args.append(self.quote_value(rowObject.findAttribute(column), type))
args.append(self.quote_value(rowObject.findAttribute(column),type))
def insertRowSQL(self, rowObject): """build SQL to insert my current state. """ args = [] tableInfo = self.schema[rowObject.rowTableName] # build values for column, type in tableInfo.rowColumns: args.append(self.quote_value(rowObject.findAttribute(column), type)) return self.getTableInfo(rowObject).insertSQL % tuple(ar...
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""insert a new row for this object instance.
"""Insert a new row for rowObject.
def insertRow(self, rowObject): """insert a new row for this object instance. """ rowObject.setDirty(0) sql = self.insertRowSQL(rowObject) return self.runOperation(sql)
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
"""build SQL to delete me from the db.
"""Build SQL to delete rowObject from the database.
def deleteRowSQL(self, rowObject): """build SQL to delete me from the db. """ args = [] tableInfo = self.schema[rowObject.rowTableName] # build where clause for keyColumn, type in tableInfo.rowKeyColumns: args.append(self.quote_value(rowObject.findAttribute(keyColumn), type))
713b02eeb66706f2a94c6f00253fc5664457b297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/713b02eeb66706f2a94c6f00253fc5664457b297/sqlreflector.py
suite.run(reporter) sys.exit(not reporter.allPassed())
if config['debug']: import pdb pdb.run("suite.run(reporter)", globals(), locals()) else: suite.run(reporter) sys.exit(not reporter.allPassed())
def run(): if len(sys.argv) == 1: sys.argv.append("--help") config = Options() try: config.parseOptions() except usage.error, ue: print "%s: %s" % (sys.argv[0], ue) os._exit(1) if config['reactor']: from twisted.python import reflect mod = 'twisted.internet.' + config['reactor'] print "Using %s reactor" % mod reflect...
d79b492b2f6908b098ec31dd217e086ec22c512f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d79b492b2f6908b098ec31dd217e086ec22c512f/trial.py
def sendLine(self, line): basic.LineReceiver.sendLine(self, line)
def sendLine(self, line): basic.LineReceiver.sendLine(self, line)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
def gotHead(self, error):
def getHeadFailed(self, error):
def gotHead(self, error): "Override for notification when fetchHead() action fails"
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
log.msg('%s: fetchGroups()' % self.ip)
"""fetchGroups(self) Request a list of all news groups from the server. gotAllGroups() is called on success, getGroupsFailed() on failure """
def fetchGroups(self): log.msg('%s: fetchGroups()' % self.ip) self.sendLine('LIST') self._newState(self._stateList, self.getAllGroupsFailed)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
log.msg('%s: fetchOverview()' % self.ip)
"""fetchOverview(self) Request the overview format from the server. gotOverview() is called on success, getOverviewFailed() on failure """
def fetchOverview(self): log.msg('%s: fetchOverview()' % self.ip) self.sendLine('LIST OVERVIEW.FMT') self._newState(self._stateOverview, self.getOverviewFailed)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
log.msg('%s: fetchSubscriptions()' % self.ip)
"""fetchSubscriptions() Request a list of the groups it is recommended a new user subscribe to. gotSubscriptions() is called on success, getSubscriptionsFailed() on failure """
def fetchSubscriptions(self): log.msg('%s: fetchSubscriptions()' % self.ip) self.sendLine('LIST SUBSCRIPTIONS') self._newState(self._stateSubscriptions, self.getSubscriptionsFailed)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
log.msg('%s: fetchGroup()' % self.ip) self.sendLine('GROUP %s' % group)
"""fetchGroup(self, groupName) Get group information for the specified group from the server. gotGroup() is called on success, getGroupFailed() on failure. """ self.sendLine('GROUP %s' % (group,))
def fetchGroup(self, group): log.msg('%s: fetchGroup()' % self.ip) self.sendLine('GROUP %s' % group) self._newState(None, self.getGroupFailed, self._headerGroup)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
def fetchHead(self, index): log.msg('%s: fetchHead(%s)' % (self.ip, index)) self.sendLine('HEAD %d' % index)
def fetchHead(self, index = ''): """fetchHead(self, index = '') Get the header for the specified article (or the currently selected article if index is '') from the server. gotHead() is called on success, getHeadFailed() on failure """ self.sendLine('HEAD %s' % (index,))
def fetchHead(self, index): log.msg('%s: fetchHead(%s)' % (self.ip, index)) self.sendLine('HEAD %d' % index) self._newState(self._stateHead, self.getHeadFailed)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
def fetchBody(self, index): log.msg('%s: fetchBody(%s)' % (self.ip, index)) self.sendLine('BODY %d' % index)
def fetchBody(self, index = ''): """fetchBody(self, index = '') Get the body for the specified article (or the currently selected article if index is '') from the server. gotBody() is called on success, getBodyFailed() on failure """ self.sendLine('BODY %s' % (index,))
def fetchBody(self, index): log.msg('%s: fetchBody(%s)' % (self.ip, index)) self.sendLine('BODY %d' % index) self._newState(self._stateBody, self.getBodyFailed)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
def fetchArticle(self, index): log.msg('%s: fetchArticle(%s)' % (self.ip, index)) self.sendLine('ARTICLE %d' % index)
def fetchArticle(self, index = ''): """fetchArticle(self, index = '') Get the complete article with the specified index (or the currently selected article if index is '') from the server. gotArticle() is called on success, getArticleFailed() on failure """ self.sendLine('ARTICLE %s' % (index,))
def fetchArticle(self, index): log.msg('%s: fetchArticle(%s)' % (self.ip, index)) self.sendLine('ARTICLE %d' % index) self._newState(self._stateArticle, self.getArticleFailed)
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
log.msg('%s: postArticle()')
"""postArticle(self, text) Attempt to post an article with the specified text to the server. 'text' must consist of both head and body data, as specified by RFC 850. If the article is posted successfully, postedOk() is called, otherwise postFailed() is called. """
def postArticle(self, text): log.msg('%s: postArticle()') self.sendLine('POST') self._newState(None, self.postFailed, self._headerPost) self._postText = text
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
self._postText = text
self._postText.append(text)
def postArticle(self, text): log.msg('%s: postArticle()') self.sendLine('POST') self._newState(None, self.postFailed, self._headerPost) self._postText = text
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
log.msg('%s: fetchXHeader()') if message is not None:
"""fetchXHeader(self, header, low = None, high = None, id = None) Request a specific header from the server for an article or range of articles. If 'id' is not None, a header for only the article with that Message-ID will be requested. If both low and high are None, a header for the currently selected article will b...
def fetchXHeader(self, header, low = None, high = None, id = None): log.msg('%s: fetchXHeader()') if message is not None: r = header + ' <%s>' % (id,) elif low is high is None: r = header elif high is None: r = header + ' %d-' % (low,) elif low is None: r = header + ' -%d' % (high,) else: r = header + ' %d-%d' % (low, ...
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
self.transport.write(self._postText)
self.transport.write(self._postText[0])
def _headerPost(self, (code, message)): if code == 340: self.transport.write(self._postText) if self._postText[-2:] != '\r\n': self.sendLine('\r\n') self.sendLine('.') self._newState(None, self.postFailed, self._headerPosted) else: self.postFailed(line) self._endState()
985ff3035a15b42df933b663791277355aa6409d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/985ff3035a15b42df933b663791277355aa6409d/nntp.py
self.queueStringCommand(command, public=0).addErrback(self.fail)
d = self.queueStringCommand(command, public=0) d.addErrback(self.fail) d.addErrback(lambda x: None)
def queueLogin(self): """Initialise the connection.
11dec42b0741bdaca42604b9f3badd2f8cfdad23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/11dec42b0741bdaca42604b9f3badd2f8cfdad23/ftp.py
return self.runOperation(self.schema, self.schemaCreated, self.schemaNotCreated)
return self.runOperation(self.schema).addCallbacks(self.schemaCreated, self.schemaNotCreated)
def createSchema(self): return self.runOperation(self.schema, self.schemaCreated, self.schemaNotCreated)
c2718ba4a02bf3f56b18c94a806785bf2e3b6c6a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c2718ba4a02bf3f56b18c94a806785bf2e3b6c6a/adbapi.py
return gtk.input_add(source.fileno(), condition, wrapper)
return gtk._gobject.io_add_watch(source.fileno(), condition, wrapper)
def wrapper(source, condition, real_s=source, real_cb=callback): return real_cb(real_s, condition)
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
return gtk.input_add(source, condition, callback)
return gtk._gobject.io_add_watch(source, condition, callback)
def wrapper(source, condition, real_s=source, real_cb=callback): return real_cb(real_s, condition)
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
reads[reader] = self.input_add(reader, gtk.gdk.INPUT_READ, self.callback)
reads[reader] = self.input_add(reader, INFLAGS, self.callback)
def addReader(self, reader): if not hasReader(reader): reads[reader] = self.input_add(reader, gtk.gdk.INPUT_READ, self.callback) self.simulate()
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
writes[writer] = self.input_add(writer, gtk.gdk.INPUT_WRITE, self.callback)
writes[writer] = self.input_add(writer, OUTFLAGS, self.callback)
def addWriter(self, writer): if not hasWriter(writer): writes[writer] = self.input_add(writer, gtk.gdk.INPUT_WRITE, self.callback)
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
log.msg("Error, gtk doIteration() only supports delay of 0") gtk.main_iteration()
time.sleep(delay) gtk.main_iteration(0)
def doIteration(self, delay=0.0): if delay != 0: log.msg("Error, gtk doIteration() only supports delay of 0") gtk.main_iteration()
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
methods = [] cbNames = [] if condition & gtk.gdk.INPUT_READ: methods.append(getattr(source, 'doRead')) cbNames.append('doRead') if (condition & gtk.gdk.INPUT_WRITE): method = getattr(source, 'doWrite') if not (method in methods): methods.append(method) cbNames.append('doWrite') for method, cbName in zip(methods, cb...
log.logOwner.own(source) why = None if condition & POLL_DISCONNECTED and \ not (condition & gtk._gobject.IO_IN): why = main.CONNECTION_LOST else:
def callback(self, source, condition): methods = [] cbNames = []
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
why = method()
didRead = None if condition & gtk._gobject.IO_IN: why = source.doRead() didRead = source.doRead if not why and condition & gtk._gobject.IO_OUT: if not source.disconnected and source.doWrite != didRead: why = source.doWrite()
def callback(self, source, condition): methods = [] cbNames = []
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
log.msg('Error In %s.%s' %(source,cbName))
log.msg('Error In %s' % source)
def callback(self, source, condition): methods = [] cbNames = []
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
if why: try: source.connectionLost(failure.Failure(why)) except: log.deferr() self.removeReader(source) self.removeWriter(source) break elif source.disconnected: break self.simulate() return 1
if why: self.removeReader(source) self.removeWriter(source) try: source.connectionLost(failure.Failure(why)) except: log.deferr() log.logOwner.disown(source) self.simulate() return 1
def callback(self, source, condition): methods = [] cbNames = []
08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/08310f9467cdc9f0e5cbeaf8080652c4dd1ff45c/gtk2reactor.py
text, metadata)
text, metadata)
def sendGroupMessage(self, text, metadata=None): """Return a deferred. """ #for backwards compatibility with older twisted.words servers. if metadata: d=self.account.perspective.callRemote('groupMessage', self.name, text, metadata) d.addErrback(self.metadataFailed, "* "+text) return d else: return self.account.perspect...
ff7d2ef14f8054d40823820ce12dab1e6d412ec0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ff7d2ef14f8054d40823820ce12dab1e6d412ec0/pbsupport.py
self.getGroupConversation(groupName).setTopic(dict_["topic"], dict_.get("topic_author", None))
self.getGroupConversation(groupName).setTopic(dict_["topic"], dict_.get("topic_author", None))
def remote_setGroupMetadata(self, dict_, groupName): if dict_.has_key("topic"): self.getGroupConversation(groupName).setTopic(dict_["topic"], dict_.get("topic_author", None))
ff7d2ef14f8054d40823820ce12dab1e6d412ec0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ff7d2ef14f8054d40823820ce12dab1e6d412ec0/pbsupport.py
"twisted.words": TwistedWordsClient,
"twisted.words": TwistedWordsClient,
def connected(self, perspective): print 'Connected Words Client!', perspective registerAccount(self) self.perspective = perspective getContactsList()
ff7d2ef14f8054d40823820ce12dab1e6d412ec0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ff7d2ef14f8054d40823820ce12dab1e6d412ec0/pbsupport.py
if attr == "_v_repr":
if attr.startswith("_v_"):
def __getattr__(self, attr): if attr == "_v_repr": raise AttributeError # z.i internal thing, if attr != "__instadapt__": # __instadapt__ is part of our own backwards compat layer warnings.warn("Don't get attributes (in this case, %r) off Interface, use " ".queryDescriptionFor() etc. instead" % (attr,), ComponentsDepre...
b58d83ea9580c5293f177b5cbb34628844878cd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b58d83ea9580c5293f177b5cbb34628844878cd0/components.py
class Shell(Ftp):
class ShellFactory(Ftp):
def ftp_Abor(self, params): if self.checkauth(): return if self.dtp.transport.connected: self.dtp.loseConnection() self.reply('abort')
0c4b2ad0d80cb7190c0d274963054ec5f113c6d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0c4b2ad0d80cb7190c0d274963054ec5f113c6d5/ftp.py
p = sob.IPersistable(app)
p = sob.IPersistable(application)
def startApplication(application, save): from twisted.internet import reactor service.IService(application).startService() if save: p = sob.IPersistable(app) reactor.addSystemEventTrigger('after', 'shutdown', p.save, 'shutdown') reactor.addSystemEventTrigger('before', 'shutdown', service.IService(application).stopServi...
b3cf11caa575a7fa542533d5fdac2d3dc8017a30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b3cf11caa575a7fa542533d5fdac2d3dc8017a30/app.py
assert eco.eval(ack) == 'int main(int argc, char * * argv) {\nint n = ((argc == 2) ? (atoi(argv[1])) : (1));;\nprintf("Ack(3,%d): %d\\n", n, Ack(3, n));\n/* sleep long enough so we can measure memory usage */;\nsleep(1);\nreturn 0}'
assert eco.eval(ack) == 'int main(int argc, char * * argv) {\nint n = ((argc == 2) ? (atoi(argv[1])) : (1));;\nprintf("Ack(3,%d): %d\\n", n, Ack(3, n));\n/* sleep long enough so we can measure memory usage */;\nsleep(1);\nreturn 0}'
def testCDooDads(self): ack = """
4058ed8bf324ab2024c6d9efdd0dc9ac90f7637f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4058ed8bf324ab2024c6d9efdd0dc9ac90f7637f/test_eco.py
if not bytesToRead: return
def doReadOut(self): """Runs in thread.""" try: buffer, bytesToRead, ignore = win32pipe.PeekNamedPipe(self.hStdoutR, 0) if not bytesToRead: return hr, data = win32file.ReadFile(self.hStdoutR, bytesToRead, None) except win32api.error: self.stdoutClosed = 1 if self.stderrClosed: return main.CONNECTION_LOST else: return s...
738e86ae95b1bbf61033460a54f61f6a864ac772 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/738e86ae95b1bbf61033460a54f61f6a864ac772/win32.py
if not bytesToRead: return
def doReadErr(self): """Runs in thread.""" try: buffer, bytesToRead, ignore = win32pipe.PeekNamedPipe(self.hStderrR, 0) if not bytesToRead: return hr, data = win32file.ReadFile(self.hStderrR, bytesToRead, None) except win32api.error: self.stderrClosed = 1 if self.stdoutClosed: return main.CONNECTION_LOST else: return s...
738e86ae95b1bbf61033460a54f61f6a864ac772 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/738e86ae95b1bbf61033460a54f61f6a864ac772/win32.py
s = internet.GenericClient(connectorType, *args, **kw)
s = internet.UDPClient(remotehost, remoteport, protocol, localport, interface, maxPacketSize)
def connectUDP(self, remotehost, remoteport, protocol, localport=0, interface='', maxPacketSize=8192): s = internet.GenericClient(connectorType, *args, **kw) s.setServiceParent(self.app)
8a3aca805a7df2fa7fab9747c39b5e7f6eb7dc3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8a3aca805a7df2fa7fab9747c39b5e7f6eb7dc3e/compat.py
request = self.requestFactory(self, len(self.requests)) self.requests.append(request)
def lineReceived(self, line): self.resetTimeout()
f76caef8c922b6e7fdfce59d70ccffc3097091f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f76caef8c922b6e7fdfce59d70ccffc3097091f8/http.py