rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
while node.childNodes.length:
while len(node.childNodes):
def clearNode(node): """ Remove all children from the given node. """ if node.hasChildNodes(): while node.childNodes.length: node.removeChild(node.lastChild)
0ae37083bdd47893ed2e353de9c0f4f1923d8526 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0ae37083bdd47893ed2e353de9c0f4f1923d8526/domhelpers.py
self.reportingInterval = struct.unpack('!H',snac[3])[0]
self.reportingInterval = struct.unpack('!H',snac[3][:2])[0]
def oscar_0B_02(self, snac): """ stats reporting interval """ self.reportingInterval = struct.unpack('!H',snac[3])[0]
9148dae08940b3a6e3a17de4251756c58130bb72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9148dae08940b3a6e3a17de4251756c58130bb72/oscar.py
print location reactor.stop()
print location reactor.stop()
def printValue(location): print location reactor.stop()
1c610529daaa06455f209c3aca5969e5a3a24508 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1c610529daaa06455f209c3aca5969e5a3a24508/google.py
print 'error', error reactor.stop()
print 'error', error reactor.stop()
def printError(error): print 'error', error reactor.stop()
1c610529daaa06455f209c3aca5969e5a3a24508 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1c610529daaa06455f209c3aca5969e5a3a24508/google.py
fd = 0 try: new = tty.tcgetattr(fd) except: log.msg('not a typewriter!') else: new[3] = new[3] & ~tty.ICANON & ~tty.ECHO new[6][tty.VMIN] = 1 new[6][tty.VTIME] = 0 tty.tcsetattr(fd, tty.TCSANOW, new) tty.setraw(fd)
_enterRawMode()
def channelOpen(self, foo): #global globalSession #globalSession = self # turn off local echo log.msg('session %s open' % self.id) if options['agent']: d = self.conn.sendRequest(self, 'auth-agent-req@openssh.com', '', wantReply=1) d.addBoth(lambda x:log.msg(x)) if options['noshell']: return if (options['command'] and o...
883f0b5c6f6dc6412ac9927a7afebce8f2f402fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/883f0b5c6f6dc6412ac9927a7afebce8f2f402fe/conch.py
os.kill(os.getpid(), signal.SIGSTOP)
def _(): _leaveRawMode() sys.stdout.flush() sys.stdin.flush() os.kill(os.getpid(), signal.SIGTSTP) _enterRawMode() reactor.callLater(0, _)
def handleInput(self, char): #log.msg('handling %s' % repr(char)) if char in ('\n', '\r'): self.escapeMode = 1 self.write(char) elif self.escapeMode == 1 and char == options['escape']: self.escapeMode = 2 elif self.escapeMode == 2: self.escapeMode = 1 # so we can chain escapes together if char == '.': # disconnect log....
883f0b5c6f6dc6412ac9927a7afebce8f2f402fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/883f0b5c6f6dc6412ac9927a7afebce8f2f402fe/conch.py
self.add(widgets.Text(data))
self.add(widgets.Text(cgi.escape(data)))
def setUp(self, request, node, data): """ Set up this Widget object before it gets rendered into HTML. Since self is a Widget, I can use the higher level widget API to add a Text widget to self. I then rely on Widget.generateDOM to convert from Widgets into the Document Object Model. """ self.add(widgets.Text(data))
690b52ed96d687b2e67cdfefd9ccabc3623c61ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/690b52ed96d687b2e67cdfefd9ccabc3623c61ea/wovenquotes.py
iq = IQ(self.xmlstream, "set") iq.addElement(("jabber:iq:auth", "query")) iq.query.addElement("username", content = self.jid.user) iq.query.addElement("resource", content = self.jid.resource)
reply = IQ(self.xmlstream, "set") reply.addElement(("jabber:iq:auth", "query")) reply.query.addElement("username", content = self.jid.user) reply.query.addElement("resource", content = self.jid.resource)
def _authQueryResultEvent(self, iq): if iq["type"] == "result": # Construct auth request iq = IQ(self.xmlstream, "set") iq.addElement(("jabber:iq:auth", "query")) iq.query.addElement("username", content = self.jid.user) iq.query.addElement("resource", content = self.jid.resource) # Prefer digest over plaintext if Dige...
f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad/client.py
iq.query.addElement("digest", content = digest)
reply.query.addElement("digest", content = digest)
def _authQueryResultEvent(self, iq): if iq["type"] == "result": # Construct auth request iq = IQ(self.xmlstream, "set") iq.addElement(("jabber:iq:auth", "query")) iq.query.addElement("username", content = self.jid.user) iq.query.addElement("resource", content = self.jid.resource) # Prefer digest over plaintext if Dige...
f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad/client.py
iq.query.addElement("password", content = self.password)
reply.query.addElement("password", content = self.password)
def _authQueryResultEvent(self, iq): if iq["type"] == "result": # Construct auth request iq = IQ(self.xmlstream, "set") iq.addElement(("jabber:iq:auth", "query")) iq.query.addElement("username", content = self.jid.user) iq.query.addElement("resource", content = self.jid.resource) # Prefer digest over plaintext if Dige...
f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad/client.py
iq.addCallback(self._authResultEvent) iq.send()
reply.addCallback(self._authResultEvent) reply.send()
def _authQueryResultEvent(self, iq): if iq["type"] == "result": # Construct auth request iq = IQ(self.xmlstream, "set") iq.addElement(("jabber:iq:auth", "query")) iq.query.addElement("username", content = self.jid.user) iq.query.addElement("resource", content = self.jid.resource) # Prefer digest over plaintext if Dige...
f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f4deb2f74ca862c4f64bbe03a471e65f2d1b8aad/client.py
if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']):
if len(self.conn.channels) == 0 and not (options['noshell'] and not options['nocache']):
def closed(self): global old log.msg('closed %s' % self) if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']): # just us left stopConnection() elif not options['nocache']: # fork into the background if os.fork(): if old: fd = sys.stdin.fileno() tty.tcsetattr(fd, tty.TCSANOW, old) if (...
4e49770151960815599c623be258944b8d80a5fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4e49770151960815599c623be258944b8d80a5fc/conch.py
if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']):
if len(self.conn.channels) == 0 and not (options['noshell'] and not options['nocache']):
def closed(self): forwarding.SSHListenClientForwardingChannel.closed(self) if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']): # just us left stopConnection()
4e49770151960815599c623be258944b8d80a5fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4e49770151960815599c623be258944b8d80a5fc/conch.py
if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']):
if len(self.conn.channels) == 0 and not (options['noshell'] and not options['nocache']):
def closed(self): forwarding.SSHConnectForwardingChannel.closed(self) if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']): # just us left stopConnection()
4e49770151960815599c623be258944b8d80a5fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4e49770151960815599c623be258944b8d80a5fc/conch.py
a=request.getComponent(simpleguard.Authenticated)
def wchild_secret(self, request): a=request.getComponent(simpleguard.Authenticated) if not request.getComponent(simpleguard.Authenticated): return InfiniChild(LoginPage()) return Authenticated()
1263d3c0a0dbf98ee3b6064f29d31136d28465a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1263d3c0a0dbf98ee3b6064f29d31136d28465a5/login.py
a=request.getComponent(simpleguard.Authenticated)
def wchild_another(self, request): a=request.getComponent(simpleguard.Authenticated) if not request.getComponent(simpleguard.Authenticated): return InfiniChild(LoginPage()) return Another()
1263d3c0a0dbf98ee3b6064f29d31136d28465a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1263d3c0a0dbf98ee3b6064f29d31136d28465a5/login.py
methodName = methodName.split('.')[-1]
self.methodName = methodName.split('.')[-1]
def __init__(self, methodName): if type(methodName) is types.StringType: self.testClass = reflect.namedObject('.'.join(methodName.split('.')[:-1])) methodName = methodName.split('.')[-1] else: self.testClass = methodName.im_class self.methodName = methodName.__name__
b9d3086572b873eb85417477e2cdd04fd824022b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b9d3086572b873eb85417477e2cdd04fd824022b/runner.py
failure.Failure.printTraceback(file=self)
failure.Failure().printTraceback(file=self)
def processCommand(self, cmd): fn = '$telnet$' try: code = compile(cmd,fn,'eval') except: try: code = compile(cmd, fn, 'single') except: io = StringIO() failure.Failure().printTraceback(file=self) log.deferr() self.write('\r\n') return "Command" try: out = sys.stdout sys.stdout = self try: val = eval(code, self.factory...
37dea130941827dad115fe6a31bf662cf05d6d54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/37dea130941827dad115fe6a31bf662cf05d6d54/telnet.py
addr = {'TCP': lambda: address.IPv4Address(addrdesc, tup[1], tup[2], _bwHack='INET'), 'UNIX': lambda: address.UNIXAddress(tup[1])}[addrdesc]()
addr = {'TCP': lambda: address.IPv4Address(addrdesc, tup[1], tup[2], _bwHack='INET'), 'UNIX': lambda: address.UNIXAddress(tup[1])}[addrdesc]()
def setCopyableState(self, state): for k in 'host', 'client': tup = state[k] addrdesc = {'INET': 'TCP', 'UNIX': 'UNIX'}[tup[0]] addr = {'TCP': lambda: address.IPv4Address(addrdesc, tup[1], tup[2], _bwHack='INET'), 'UNIX': lambda: address.UNIXAddress(tup[1])}[addrdesc]() state[k] = addr pb.RemoteCopy.setCopyableState(se...
16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f/distrib.py
"""I can't connect to a publisher; I'll now reply to all pending requests.
"""I can't connect to a publisher; I'll now reply to all pending requests.
def notConnected(self, msg): """I can't connect to a publisher; I'll now reply to all pending requests. """ log.msg("could not connect to distributed web service: %s" % msg) self.waiting = 0 self.publisher = None for request in self.pending: request.write("Unable to connect to distributed server.") request.finish() sel...
16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f/distrib.py
pb.getObjectAt(self.host, self.port, 10).addCallbacks(self.connected, self.notConnected)
bf = pb.PBClientFactory() timeout = 10 if self.host == "unix": reactor.connectUNIX(self.port, bf, timeout) else: reactor.connectTCP(self.host, self.port, bf, timeout) d = bf.getRootObject() d.addCallbacks(self.connected, self.notConnected)
def render(self, request): """Render this request, from my server.
16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f/distrib.py
reactor.spawnProcess(p, '/bin/true', ['true'])
reactor.spawnProcess(p, cmd, ['true'])
def testNormalTermination(self): p = TrivialProcessProtocol() reactor.spawnProcess(p, '/bin/true', ['true']) while not p.finished: reactor.iterate(0.01) p.reason.trap(error.ProcessDone) self.assertEquals(p.reason.value.exitCode, 0)
9e5c20b4869ecbb1215928c6b9210a85cca1e974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9e5c20b4869ecbb1215928c6b9210a85cca1e974/test_process.py
reactor.spawnProcess(p, '/bin/false', ['false'])
reactor.spawnProcess(p, cmd, ['false'])
def testAbnormalTermination(self): p = TrivialProcessProtocol() reactor.spawnProcess(p, '/bin/false', ['false']) while not p.finished: reactor.iterate(0.01) p.reason.trap(error.ProcessTerminated) self.assertEquals(p.reason.value.exitCode, 1)
9e5c20b4869ecbb1215928c6b9210a85cca1e974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9e5c20b4869ecbb1215928c6b9210a85cca1e974/test_process.py
return open(self.path,'rb')
return open(self.path, "rb")
def openForReading(self): """Open a file and return it.""" return open(self.path,'rb')
35201a3d117e388a2d4a962bd88af065f40ba968 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/35201a3d117e388a2d4a962bd88af065f40ba968/static.py
if h1: h1 = h1[0] parent = h1.parentNode i = parent.childNodes.index(h1) parent.childNodes[i+1:i+1] = [toc]
empty = microdom.Element('span') for node in h1: node.parentNode.replaceChild(empty, node)
def putInToC(document, toc): h1 = domhelpers.findNodesNamed(document, 'h1') if h1: h1 = h1[0] parent = h1.parentNode i = parent.childNodes.index(h1) parent.childNodes[i+1:i+1] = [toc]
d611d100a5009c14bf7f3fce9295797785519ceb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d611d100a5009c14bf7f3fce9295797785519ceb/tree.py
putInToC(document, generateToC(document))
putInToC(template, generateToC(document))
def munge(document, template, linkrel, d, fullpath, ext, url): addMtime(template, fullpath) expandAPI(document) fixAPI(document, url) fontifyPython(document) addPyListings(document, d) addHTMLListings(document, d) fixLinks(document, ext) putInToC(document, generateToC(document)) footnotes(document) notes(document) # t...
d611d100a5009c14bf7f3fce9295797785519ceb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d611d100a5009c14bf7f3fce9295797785519ceb/tree.py
self.sendLine(":%s!%s@%s PRIVMSG %s :%s" % (senderName, senderName, self.servicename, self.nickname, message))
lines = string.split(message, '\n') for line in lines: self.sendLine(":%s!%s@%s PRIVMSG %s :%s" % (senderName, senderName, self.servicename, self.nickname, line))
def receiveDirectMessage(self, senderName, message): #>> :glyph_!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello #>> :glyph!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello
18819907a26bf8ef0ba562c77d6ab325a0ddf25f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/18819907a26bf8ef0ba562c77d6ab325a0ddf25f/ircservice.py
self.sendLine(":%s!%s@%s PRIVMSG (sender, sender, self.servicename, group, message))
lines = string.split(message, '\n') for line in lines: self.sendLine(":%s!%s@%s PRIVMSG (sender, sender, self.servicename, group, line))
def receiveGroupMessage(self, sender, group, message): if sender is not self: self.sendLine(":%s!%s@%s PRIVMSG #%s :%s" % (sender, sender, self.servicename, group, message))
18819907a26bf8ef0ba562c77d6ab325a0ddf25f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/18819907a26bf8ef0ba562c77d6ab325a0ddf25f/ircservice.py
print [result, path1, path2]
def comparePathFragments(self, path1, path2): result = LenientIntCompare()(path1, path2) print [result, path1, path2] return result
5521612fd47d773d5380022d0c449f7d0a0ad2c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5521612fd47d773d5380022d0c449f7d0a0ad2c9/filepile.py
self.kexAlg = 'diffie-helmman-group-exchange-sha1-old'
self.kexAlg = 'diffie-hellman-group-exchange-sha1-old'
def ssh_KEX_DH_GEX_REQUEST_OLD(self, packet): if self.ignoreNextPacket: self.ignoreNextPacket = 0 return if self.kexAlg == 'diffie-hellman-group1-sha1': # this is really KEXDH_INIT clientDHPubKey, foo = getMP(packet) y = Util.number.getRandomNumber(16, entropy.get_bytes) f = pow(DH_GENERATOR, y, DH_PRIME) sharedSecret ...
84b3bc776d3f5698a92f7761d6e83822ab7a9e6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/84b3bc776d3f5698a92f7761d6e83822ab7a9e6b/transport.py
y = Util.number.getRandomNumber(16, entropy.get_bytes)
pSize = Util.number.size(self.p) y = Util.number.getRandomNumber(pSize, entropy.get_bytes)
def ssh_KEX_DH_GEX_INIT(self, packet): clientDHPubKey, foo = getMP(packet)
84b3bc776d3f5698a92f7761d6e83822ab7a9e6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/84b3bc776d3f5698a92f7761d6e83822ab7a9e6b/transport.py
y = Util.number.getRandomNumber(16, entropy.get_bytes)
y = Util.number.getRandomNumber(pSize, entropy.get_bytes)
def ssh_KEX_DH_GEX_INIT(self, packet): clientDHPubKey, foo = getMP(packet)
84b3bc776d3f5698a92f7761d6e83822ab7a9e6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/84b3bc776d3f5698a92f7761d6e83822ab7a9e6b/transport.py
def ssh_KEX_DH_GEX_INIT(self, packet): clientDHPubKey, foo = getMP(packet)
84b3bc776d3f5698a92f7761d6e83822ab7a9e6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/84b3bc776d3f5698a92f7761d6e83822ab7a9e6b/transport.py
def connectionFailed(self): self.socks.makeReply(91)
def connectionMade(self): junk, host, port = self.transport.getPeer() self.socks.makeReply(90, 0, port=port, ip=host) self.socks.otherConn=self
8fb3a3a9b2750f4ca1ac7020527e993ed51eea64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fb3a3a9b2750f4ca1ac7020527e993ed51eea64/socks.py
protocol.ClientCreator(reactor, SOCKSv4Outgoing, self).connectTCP(server,port)
d = protocol.ClientCreator(reactor, SOCKSv4Outgoing, self).connectTCP(server,port) d.addErrback(lambda result, self=self: self.makeReply(91))
def dataReceived(self,data): if self.otherConn: self.otherConn.write(data) return self.buf=self.buf+data if '\000' in self.buf[8:]: head,self.buf=self.buf[:8],self.buf[8:] try: version,code,port=struct.unpack("!BBH",head[:4]) except struct.error: raise RuntimeError, "struct error with head='%s' and buf='%s'"%(repr(head...
8fb3a3a9b2750f4ca1ac7020527e993ed51eea64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fb3a3a9b2750f4ca1ac7020527e993ed51eea64/socks.py
testdir = "_trial_temp"
testdir = os.path.abspath("_trial_temp")
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) suite = unittest.TestSuite() if config['recurse']: for package in config['packages']: suite.addPackageRecursive(package) else: for package in...
01fc27f149df819242a843a7173462519232f831 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/01fc27f149df819242a843a7173462519232f831/trial.py
TLSTestCase.testTLS(self)
return TLSTestCase.testTLS(self) testTLS.suppress = [_bufferedSuppression] testTLS.todo = "startTLS doesn't empty buffer before starting TLS. :("
def testTLS(self): TLSTestCase.testTLS(self)
d628ada4460ef35c57a2fa5554cfebc926a38894 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d628ada4460ef35c57a2fa5554cfebc926a38894/test_ssl.py
TLSTestCase.testBackwardsTLS(self) testTLS.todo = "startTLS doesn't empty buffer before starting TLS. :("
return TLSTestCase.testBackwardsTLS(self) testBackwardsTLS.suppress = [_bufferedSuppression]
def testBackwardsTLS(self): TLSTestCase.testBackwardsTLS(self)
d628ada4460ef35c57a2fa5554cfebc926a38894 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d628ada4460ef35c57a2fa5554cfebc926a38894/test_ssl.py
for f in self.outgoingDccFiles:
for f in self._outgoingDccFiles:
def dcc_RESUME(self, user, channel, data): data = text.splitQuoted(data) if len(data) < 3: raise IRCBadMessage, "malformed DCC SEND RESUME request: %r" % (data,) (filename, port, resumePos) = data[:3] try: port = int(port) resumePos = int(resumePos) except ValueError: return # lets see which outgoingFile this goes to f...
a8d1dc47ec79709995d1f32c5dc36657b9184c01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a8d1dc47ec79709995d1f32c5dc36657b9184c01/irc.py
message := the message, or '' to come back from awayness
message := the message, or '' to come back from awayness
def away(self,message=''): """ change away state
cf5c1b9b6982ffbfcc655062fdf4b5c939fafc3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cf5c1b9b6982ffbfcc655062fdf4b5c939fafc3f/toc.py
return SMTPProtcolError(code, resp, str(self.log))
return SMTPProtocolError(code, resp, str(self.log))
def smtpTransferFailed(self, code, resp): if code < 0: # protocol error return SMTPProtcolError(code, resp, str(self.log)) return self.smtpState_msgSent(code, resp)
8dc1bca02ccb5a35ef89e1b4422d67a7c2a7809d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8dc1bca02ccb5a35ef89e1b4422d67a7c2a7809d/smtp.py
if os.geteuid() != uid: raise IOError(errno.EACCES) if os.getegid() != gid: raise IOError(errno.EACCES)
def _runAsUser(self, f, *args): euid = os.geteuid() egid = os.getegid() uid, gid = self.avatar.getUserGroupId() os.setegid(gid) os.seteuid(uid) # the next two lines fix some kind of timing error with WinSCP if os.geteuid() != uid: raise IOError(errno.EACCES) if os.getegid() != gid: raise IOError(errno.EACCES) try: if n...
4e62364b5011c80d961b92a91f72e27f787e2ca1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4e62364b5011c80d961b92a91f72e27f787e2ca1/filetransfer.py
signal.signal(signum, handler)
if handler is not None: signal.signal(signum, handler)
def restore(self): for signum, handler in self._store.iteritems(): signal.signal(signum, handler)
88a2168058e0fb862cf5fb96ce5746beb546c259 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/88a2168058e0fb862cf5fb96ce5746beb546c259/util.py
fileId = str(id(fileObj))
fileId = str(hash(fileObj))
def _cbOpenFile(self, fileObj, requestId): fileId = str(id(fileObj)) if fileId in self.openFiles: raise KeyError, 'id already open' self.openFiles[fileId] = fileObj self.sendPacket(FXP_HANDLE, struct.pack('!L', requestId) + NS(fileId))
ee1bf798596e75c0fba86deb49bbec1181c3cffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ee1bf798596e75c0fba86deb49bbec1181c3cffa/filetransfer.py
handle = str(id(dirObj))
handle = str(hash(dirObj))
def _cbOpenDirectory(self, dirObj, requestId): handle = str(id(dirObj)) if handle in self.openDirs: raise KeyError, "already opened this directory" self.openDirs[handle] = [dirObj, iter(dirObj)] self.sendPacket(FXP_HANDLE, struct.pack('!L', requestId) + NS(handle))
ee1bf798596e75c0fba86deb49bbec1181c3cffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ee1bf798596e75c0fba86deb49bbec1181c3cffa/filetransfer.py
except:
finally:
def _runAsUser(self, f, *args): euid = os.geteuid() egid = os.getegid() uid, gid = self.avatar.getUserGroupId() os.setegid(0) os.seteuid(0) os.setegid(gid) os.seteuid(uid) try: if not hasattr(f,'__iter__'): f = [(f, ) + args] for i in f: r = i[0](*i[1:]) except: os.setegid(0) os.seteuid(0) os.setegid(egid) os.seteuid(e...
ee1bf798596e75c0fba86deb49bbec1181c3cffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ee1bf798596e75c0fba86deb49bbec1181c3cffa/filetransfer.py
raise else: os.setegid(0) os.seteuid(0) os.setegid(egid) os.seteuid(euid) return r
return r
def _runAsUser(self, f, *args): euid = os.geteuid() egid = os.getegid() uid, gid = self.avatar.getUserGroupId() os.setegid(0) os.seteuid(0) os.setegid(gid) os.seteuid(uid) try: if not hasattr(f,'__iter__'): f = [(f, ) + args] for i in f: r = i[0](*i[1:]) except: os.setegid(0) os.seteuid(0) os.setegid(egid) os.seteuid(e...
ee1bf798596e75c0fba86deb49bbec1181c3cffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ee1bf798596e75c0fba86deb49bbec1181c3cffa/filetransfer.py
NOTE: this function assumes it is runner as the logged-in user:
NOTE: this function assumes it runs as the logged-in user:
def _setAttrs(self, path, attrs): """ NOTE: this function assumes it is runner as the logged-in user: i.e. under _runAsUser() """ if attrs.has_key("uid") and attrs.has_key("gid"): os.lchown(path, attrs["uid"], attrs["gid"]) if attrs.has_key("permissions"): os.chmod(path, attrs["permissions"]) if attrs.has_key("atime") ...
ee1bf798596e75c0fba86deb49bbec1181c3cffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ee1bf798596e75c0fba86deb49bbec1181c3cffa/filetransfer.py
text = escapingRE.sub(r'\\\1{}', text.replace('\\', '$\\backslash$'))
text = escapingRE.sub(lambda x: (x.group()=='\\' and '$\\backslash$') or '\\'+x.group(), text)
def latexEscape(text): text = escapingRE.sub(r'\\\1{}', text.replace('\\', '$\\backslash$')) return text.replace('\n', ' ')
54d3f31425b89b4abfb2ee2e644b6e7c5e0be0ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/54d3f31425b89b4abfb2ee2e644b6e7c5e0be0ca/latex.py
if resolv:
if resolv and os.path.exists(resolv):
def __init__(self, resolv = None, servers = None, timeout = 10): """ @type servers: C{list} of C{(str, int)} or C{None} @param servers: If not None, interpreted as a list of addresses of domain name servers to attempt to use for this lookup. Addresses should be in dotted-quad form. If specified, overrides C{resolv}. ...
3f79a4b2808dda23356facf050dc8e070c68e262 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3f79a4b2808dda23356facf050dc8e070c68e262/client.py
match = re.match(self.fileLinePattern, line)
match = self.fileLinePattern.match(line)
def lineReceived(self, line): match = re.match(self.fileLinePattern, line) if match: dict = match.groupdict() dict['size'] = int(dict['size']) self.files.append(dict)
97a89b8b4379e63389140bd8b3ddb277f9e147ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/97a89b8b4379e63389140bd8b3ddb277f9e147ff/ftp.py
def __init__(self,year,month,getday): self.month=month self.year=year self.getday=getday def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
def __init__(self,year,month,getday): self.month=month self.year=year self.getday=getday def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
def __init__(self,year,month,getday): self.month=month self.year=year self.getday=getday
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
write('''<tr><td colspan=7 bgcolor=black><font color=white><center><b>%s %s</b></center></font></td></tr>
write('''<tr><td colspan=7 bgcolor=black><font color=white><center><b>%s %s</b></center></font></td></tr>
def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
for day in calendar.day_name: write("<td><center><b>&nbsp;%s&nbsp;</b></center></td>"%day) write('''</tr>
for day in calendar.day_name: write("<td><center><b>&nbsp;%s&nbsp;</b></center></td>"%day) write('''</tr>
def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
cal=calendar.monthcalendar(self.year,self.month) for week in cal: write('''<tr>
cal=calendar.monthcalendar(self.year,self.month) for week in cal: write('''<tr>
def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
for day in week: write("<td><center>") if day: write(str(day)) inf=self.getday(request,day,self.month,self.year) if inf: write("<BR>"+inf) write("</center></td>\n") write('''</tr>
for day in week: write("<td><center>") if day: write(str(day)) inf=self.getday(request,day,self.month,self.year) if inf: write("<BR>"+inf) write("</center></td>\n") write('''</tr>
def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
write("</table>")
write("</table>")
def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
formGen=widgets.Form.formGen formGen['intmenu']=widgets.htmlFor_menu formFields = [ ["intmenu","Day","day",map(str,range(1,32))], ["menu","Month","month",calendar.month_name[1:]], ["int","Year","year",str(time.localtime(time.time())[0])], ["string","Title","title",""], ["text","Data","data",""] ] formParse = { 'int':...
formGen=widgets.Form.formGen formGen['intmenu']=widgets.htmlFor_menu formFields = [ ["intmenu","Day","day",map(str,range(1,32))], ["menu","Month","month",calendar.month_name[1:]], ["int","Year","year",str(time.localtime(time.time())[0])], ["string","Title","title",""], ["text","Data","data",""] ] formParse = { 'int':...
def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
def __init__(self,page,event): self.page=page self.event=event def getFormFields(self,request): text=string.replace(self.event.data,"<br>\n","\n") return [ ["string","Title","title",self.event.title], ["text","Data","data",text]] def process(self,write,request,title,data): self.event.title=title self.event.data=strin...
def __init__(self,page,event): self.page=page self.event=event def getFormFields(self,request): text=string.replace(self.event.data,"<br>\n","\n") return [ ["string","Title","title",self.event.title], ["text","Data","data",text]] def process(self,write,request,title,data): self.event.title=title self.event.data=strin...
def __init__(self,page,event): self.page=page self.event=event
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
isLeaf = 1 template = '''<HTML>
isLeaf = 1 template = '''<HTML>
def process(self,write,request,title,data): self.event.title=title self.event.data=string.replace(data,"\n","<br>\n") log.msg("made it here") return [self.page.backToCalendar(request)] log.msg("made it here too")
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
def __init__(self,password="twisted",filename=None): widgets.Page.__init__(self) self.password=password self.events={} self.filename=filename self.loadPickle() def setValues(self,request): self.auth=0 if request.postpath: if request.postpath[0]==self.password: self.auth=1 del request.postpath[0] if request.postpath: t...
def __init__(self,password="twisted",filename=None): widgets.Page.__init__(self) self.password=password self.events={} self.filename=filename self.loadPickle() def setValues(self,request): self.auth=0 if request.postpath: if request.postpath[0]==self.password: self.auth=1 del request.postpath[0] if request.postpath: t...
def __init__(self,password="twisted",filename=None): widgets.Page.__init__(self) self.password=password self.events={} self.filename=filename self.loadPickle()
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
self.currentPath(request), year, month, day, self.events[year][month][day].index(event), event.title) return c def setDay(self,day,month,year,title,data): self.makeDay(day,month,year) self.events[year][month][day].append(EventWidget(day,month,year,title,data)) self.savePickle() def makeDay(self,day,month,year): if no...
self.currentPath(request), year, month, day, self.events[year][month][day].index(event), event.title) return c def setDay(self,day,month,year,title,data): self.makeDay(day,month,year) self.events[year][month][day].append(EventWidget(day,month,year,title,data)) self.savePickle() def makeDay(self,day,month,year): if no...
def getDay(self,request,day,month,year): if not self.events.has_key(year): return if not self.events[year].has_key(month): return if not self.events[year][month].has_key(day): return c="" for event in self.events[year][month][day]: c=c+"""* <a href="%s/event/%s/%s/%s/%s">%s</a><br>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
def loadPickle(self): if not self.filename: return try: self.events=cPickle.load(open(self.filename)) except: pass def savePickle(self): if not self.filename: return cPickle.dump(self.events,open(self.filename,"w")) def title_event(self,request): return self.getCurrentEvent().title def title_calendar(self,request): ...
def loadPickle(self): if not self.filename: return try: self.events=cPickle.load(open(self.filename)) except: pass def savePickle(self): if not self.filename: return cPickle.dump(self.events,open(self.filename,"w")) def title_event(self,request): return self.getCurrentEvent().title def title_calendar(self,request): ...
def loadPickle(self): if not self.filename: return try: self.events=cPickle.load(open(self.filename)) except: pass
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
self.currentPath(request)+"/delete/"+string.join(self.options,"/"), self.currentPath(request)+"/edit/"+string.join(self.options,"/"), self.backToCalendar(request)) def footer_calendar(self,request): if not self.auth: return "" return '''<a href="%s">Post Event</a>'''%(self.currentPath(request)+"/post") def currentPat...
self.currentPath(request)+"/delete/"+string.join(self.options,"/"), self.currentPath(request)+"/edit/"+string.join(self.options,"/"), self.backToCalendar(request)) def footer_calendar(self,request): if not self.auth: return "" return '''<a href="%s">Post Event</a>'''%(self.currentPath(request)+"/post") def currentPat...
def footer_event(self,request): if not self.auth: return self.backToCalendar(request) return '''<a href="%s">Delete</a><br>
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
def __init__(self,day,month,year,title,data): self.day=day self.month=month self.year=year self.title=title self.data=string.replace(data,"\n","<br>\n") def display(self,request): c="<b>Date:</b> %s %s, %s<br>\n"%(calendar.month_name[self.month], self.day, self.year) c=c+"<b>Title:</b> %s<br>\n"%self.title c=c+"<b>Dat...
def __init__(self,day,month,year,title,data): self.day=day self.month=month self.year=year self.title=title self.data=string.replace(data,"\n","<br>\n") def display(self,request): c="<b>Date:</b> %s %s, %s<br>\n"%(calendar.month_name[self.month], self.day, self.year) c=c+"<b>Title:</b> %s<br>\n"%self.title c=c+"<b>Dat...
def __init__(self,day,month,year,title,data): self.day=day self.month=month self.year=year self.title=title self.data=string.replace(data,"\n","<br>\n")
30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py
def render(self, request):
def _rewrite(self, request):
def render(self, request): for rewriteRule in self.rewriteRules: rewriteRule(request) resource = self.resource.getChildForRequest(request) return resource.render(request)
f7ab18c6d00cbd37b92b88d3ca3d832543bc00e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f7ab18c6d00cbd37b92b88d3ca3d832543bc00e1/rewrite.py
resource = self.resource.getChildForRequest(request) return resource.render(request)
def getChild(self, path, request): request.postpath.insert(0, path) self._rewrite(request) path = request.postpath.pop(0) return self.resource.getChildWithDefault(path, request) def render(self, request): self._rewrite(request) return self.resource.render(request)
def render(self, request): for rewriteRule in self.rewriteRules: rewriteRule(request) resource = self.resource.getChildForRequest(request) return resource.render(request)
f7ab18c6d00cbd37b92b88d3ca3d832543bc00e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f7ab18c6d00cbd37b92b88d3ca3d832543bc00e1/rewrite.py
except MailboxError, m:
except MailboxException, m:
def auth_SUBSCRIBE(self, tag, args): name = self._parseMbox(args) try: self.account.subscribe(name) except MailboxError, m: self.sendNegativeResponse(tag, str(m)) else: self.sendPositiveResponse(tag, 'Subscribed')
a7ff0f623e81d0634f750ef72246e3d10f179105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a7ff0f623e81d0634f750ef72246e3d10f179105/imap4.py
except MailboxError, m:
except MailboxException, m:
def auth_UNSUBSCRIBE(self, tag, args): name = self._parseMbox(args) try: self.account.unsubscribe(name) except MailboxError, m: self.sendNegativeResponse(tag, str(m)) else: self.sendPositiveResponse(tag, 'Unsubscribed')
a7ff0f623e81d0634f750ef72246e3d10f179105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a7ff0f623e81d0634f750ef72246e3d10f179105/imap4.py
raise MailboxError, "Not currently subscribed to " + name
raise MailboxException, "Not currently subscribed to " + name
def unsubscribe(self, name): name = name.upper() if name not in self.subscriptions: raise MailboxError, "Not currently subscribed to " + name self.subscriptions.remove(name)
a7ff0f623e81d0634f750ef72246e3d10f179105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a7ff0f623e81d0634f750ef72246e3d10f179105/imap4.py
host, port, url = _parse(l[0]) self.factory.host = host
host, port, url = _parse(l[0], defaultPort=self.transport.addr[1]) if host: self.factory.host = host self.factory.port = port
def handleStatus_301(self): l = self.headers.get('location') if not l: self.handleStatusDefault() host, port, url = _parse(l[0]) self.factory.host = host self.factory.url = url
035a42131cb602f6c1f9b215473faaa892bf3919 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/035a42131cb602f6c1f9b215473faaa892bf3919/client.py
def handleStatus_301(self): l = self.headers.get('location') if not l: self.handleStatusDefault() host, port, url = _parse(l[0]) self.factory.host = host self.factory.url = url
035a42131cb602f6c1f9b215473faaa892bf3919 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/035a42131cb602f6c1f9b215473faaa892bf3919/client.py
def _parse(url):
def _parse(url, defaultPort=80):
def _parse(url): parsed = urlparse.urlparse(url) url = urlparse.urlunparse(('','')+parsed[2:]) host, port = parsed[1], 80 if ':' in host: host, port = host.split(':') port = int(port) return host, port, url
035a42131cb602f6c1f9b215473faaa892bf3919 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/035a42131cb602f6c1f9b215473faaa892bf3919/client.py
host, port = parsed[1], 80
host, port = parsed[1], defaultPort
def _parse(url): parsed = urlparse.urlparse(url) url = urlparse.urlunparse(('','')+parsed[2:]) host, port = parsed[1], 80 if ':' in host: host, port = host.split(':') port = int(port) return host, port, url
035a42131cb602f6c1f9b215473faaa892bf3919 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/035a42131cb602f6c1f9b215473faaa892bf3919/client.py
Mailboxes which do not intent to do any special processing to
Mailboxes which do not intend to do any special processing to
def requestStatus(self, names): """Return status information about this mailbox.
ec6d64fa5b4b5a26c6d0226a79791169926a468f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ec6d64fa5b4b5a26c6d0226a79791169926a468f/imap4.py
i1 = self.preferredOrder.index(x) i2 = self.preferredOrder.index(y) if i1 < 0: return 1 if i2 < 0: return -1
try: i1 = self.preferredOrder.index(x) except ValueError: return 1 try: i2 = self.preferredOrder.index(y) except ValueError: return -1
def _(x, y): i1 = self.preferredOrder.index(x) i2 = self.preferredOrder.index(y) if i1 < 0: return 1 if i2 < 0: return -1 return cmp(i1, i2)
b8be787dd1edd62d7fd477bd854e041dbb4923ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b8be787dd1edd62d7fd477bd854e041dbb4923ef/userauth.py
self.transport.write('%3.3d-%s\r\n' % (code, line)) self.transport.write('%3.3d %s\r\n' % (code, lastline and lastline[0] or ''))
self.sendLine('%3.3d-%s' % (code, line)) self.sendLine('%3.3d %s' % (code, lastline and lastline[0] or ''))
def sendCode(self, code, message=''): "Send an SMTP code with a message." lines = message.splitlines() lastline = lines[-1:] for line in lines[:-1]: self.transport.write('%3.3d-%s\r\n' % (code, line)) self.transport.write('%3.3d %s\r\n' % (code, lastline and lastline[0] or ''))
0e15828e19c8c9911679d7aac75c954c63410219 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0e15828e19c8c9911679d7aac75c954c63410219/smtp.py
self.sendCode(550, 'Cannot receive for specified address')
self.sendCode(failure.value.code, 'Cannot receive for specified address %s: %s' % (repr(str(failure.value.addr)), failure.value.resp))
def _ebFromValidate(self, failure): if failure.check(SMTPBadSender): self.sendCode(550, 'Cannot receive for specified address') 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' )
0e15828e19c8c9911679d7aac75c954c63410219 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0e15828e19c8c9911679d7aac75c954c63410219/smtp.py
self.sendCode(550, 'Cannot receive for specified address')
self.sendCode(failure.value.code, failure.value.resp)
def _ebToValidate(self, failure): if failure.check(SMTPBadRcpt): self.sendCode(550, 'Cannot receive for specified address') 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' )
0e15828e19c8c9911679d7aac75c954c63410219 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0e15828e19c8c9911679d7aac75c954c63410219/smtp.py
"""Remove the parent of the service."""
"""Remove the parent of the service. @rtype: C{Deferred} @return: a deferred which is triggered when the service has finished shutting down. If shutting down is immediate, a value can be returned (usually, None). """
def disownServiceParent(self): """Remove the parent of the service."""
1df6bc7fc0bc1c3e319634e02cec46e16325eddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1df6bc7fc0bc1c3e319634e02cec46e16325eddb/service.py
self.parent.removeService(self)
d = self.parent.removeService(self)
def disownServiceParent(self): self.parent.removeService(self) self.parent = None
1df6bc7fc0bc1c3e319634e02cec46e16325eddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1df6bc7fc0bc1c3e319634e02cec46e16325eddb/service.py
def stopService(self): self.running = 0
1df6bc7fc0bc1c3e319634e02cec46e16325eddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1df6bc7fc0bc1c3e319634e02cec46e16325eddb/service.py
def removeService(self, service): """Remove a child service. @type service: C{IService} @raise L{ValueError}: Raised if the given service is not a child. """
1df6bc7fc0bc1c3e319634e02cec46e16325eddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1df6bc7fc0bc1c3e319634e02cec46e16325eddb/service.py
service.stopService()
return service.stopService() else: return None
def removeService(self, service): if service.name: del self.namedServices[service.name] self.services.remove(service) if self.running: service.stopService()
1df6bc7fc0bc1c3e319634e02cec46e16325eddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1df6bc7fc0bc1c3e319634e02cec46e16325eddb/service.py
def __init__(self, uid=None, gid=None): """Set uid and gid
1df6bc7fc0bc1c3e319634e02cec46e16325eddb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1df6bc7fc0bc1c3e319634e02cec46e16325eddb/service.py
@type portType: type which implements C{IListeningPort}
@type portType: type which implements L{IListeningPort}
def listenWith(self, portType, *args, **kw): """Start an instance of the given C{portType} listening.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@type connectorType: type which implements C{IConnector}
@type connectorType: type which implements L{IConnector}
def connectWith(self, connectorType, *args, **kw): """ Start an instance of the given C{connectorType} connecting.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@param factory: a twisted.internet.protocol.ServerFactory instance
@param factory: a L{twisted.internet.protocol.ServerFactory} instance
def listenTCP(self, port, factory, backlog=5, interface=''): """Connects a given protocol factory to the given numeric TCP/IP port.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@raise CannotListenError: as defined in twisted.internet.error, if it
@raise CannotListenError: as defined here L{twisted.internet.error.CannotListenError}, if it
def listenTCP(self, port, factory, backlog=5, interface=''): """Connects a given protocol factory to the given numeric TCP/IP port.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@param factory: a twisted.internet.protocol.ClientFactory instance
@param factory: a L{twisted.internet.protocol.ClientFactory} instance
def connectTCP(self, host, port, factory, timeout=30, bindAddress=None): """Connect a TCP client.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@returns: An object implementing IConnector. This connector will call
@returns: An object implementing L{IConnector}. This connector will call
def connectTCP(self, host, port, factory, timeout=30, bindAddress=None): """Connect a TCP client.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
failed, or lost - see ClientFactory docs for details.
failed, or lost - see L{ClientFactory<twisted.internet.protocol.ServerFactory>} docs for details.
def connectTCP(self, host, port, factory, timeout=30, bindAddress=None): """Connect a TCP client.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
"""Connects a given DatagramProtocol to the given numeric UDP port. @returns: object conforming to IListeningPort.
"""Connects a given L{DatagramProtocol<twisted.internet.protocol.DatagramProtocol>} to the given numeric UDP port. @returns: object conforming to L{IListeningPort}.
def listenMulticast(self, port, protocol, interface='', maxPacketSize=8192): """Connects a given DatagramProtocol to the given numeric UDP port.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
"""Connects a ConnectedDatagramProtocol instance to a UDP port.
"""Connects a L{ConnectedDatagramProtocol<twisted.internet.protocol.ConnectedDatagramProtocol>} instance to a UDP port.
def connectMulticast(self, remotehost, remoteport, protocol, localport=0, interface='', maxPacketSize=8192): """Connects a ConnectedDatagramProtocol instance to a UDP port. """
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@see: C{twisted.internet.protocol.ProcessProtocol}
@see: L{twisted.internet.protocol.ProcessProtocol}
def spawnProcess(self, processProtocol, executable, args=(), env={}, path=None, uid=None, gid=None, usePTY=0): """Spawn a process, with a process protocol.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@type resolver: An object implementing the C{IResolverSimple} interface
@type resolver: An object implementing the L{IResolverSimple} interface
def installResolver(self, resolver): """Set the internal resolver to use to for name lookups.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
"""Implement me to be able to use FileDescriptor type resources.
"""Implement me to be able to use L{FileDescriptor<twisted.internet.abstract.FileDescriptor>} type resources.
def installResolver(self, resolver): """Set the internal resolver to use to for name lookups.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
@raise CannotListenError: as defined in C{twisted.internet.error},
@raise CannotListenError: as defined here L{twisted.internet.error.CannotListenError},
def startListening(self): """Start listening on this port.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
"""I am a FileDescriptor that can both read and write.
"""I am a L{FileDescriptor<twisted.internet.abstract.FileDescriptor>} that can both read and write.
def doWrite(self): """Some data is available for reading on your descriptor. """
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
to resumeProducing(). A producer should implement the IProducer
to resumeProducing(). A producer should implement the L{IProducer}
def registerProducer(self, producer, streaming): """Register to receive data from a producer.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py