rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
unittest.TestCase.failUnlessSubstring(self, containee, container, *args, **kwargs)
self.failUnlessSubstring(containee, container, *args, **kwargs)
def failUnlessIn(self, container, containee, *args, **kwargs): # redefined to be useful in callbacks unittest.TestCase.failUnlessSubstring(self, containee, container, *args, **kwargs) return container
385bb0fcea4b2de5eb215b831ad577f7f549b7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/385bb0fcea4b2de5eb215b831ad577f7f549b7e0/test_output.py
unittest.TestCase.failIfSubstring(self, containee, container, *args, **kwargs)
self.failIfSubstring(containee, container, *args, **kwargs)
def failIfIn(self, container, containee, *args, **kwargs): # redefined to be useful in callbacks unittest.TestCase.failIfSubstring(self, containee, container, *args, **kwargs) return container
385bb0fcea4b2de5eb215b831ad577f7f549b7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/385bb0fcea4b2de5eb215b831ad577f7f549b7e0/test_output.py
def test_trialFound(self): self.failUnless(os.path.isfile(getTrialPath()), getTrialPath())
def failIfIn(self, container, containee, *args, **kwargs): # redefined to be useful in callbacks unittest.TestCase.failIfSubstring(self, containee, container, *args, **kwargs) return container
385bb0fcea4b2de5eb215b831ad577f7f549b7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/385bb0fcea4b2de5eb215b831ad577f7f549b7e0/test_output.py
reactor.callLater(2, self.reducingMsg, (fmt, lines))
self.reducingMsg(fmt, lines)
def msg(self, user, message, length = None): fmt = "PRIVMSG %s :%%s" % (user,)
d18fb6db2af4743d5e66ecdde13d96b3ade8c0f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d18fb6db2af4743d5e66ecdde13d96b3ade8c0f4/irc.py
reactor.callLater(2, self.reducingMsg, (fmt, lines[1:]))
reactor.callLater(2, self.reducingMsg, fmt, lines[1:])
def reducingMsg(self, fmt, lines): self.sendLine(fmt % lines[0]) if len(lines) > 1: reactor.callLater(2, self.reducingMsg, (fmt, lines[1:]))
d18fb6db2af4743d5e66ecdde13d96b3ade8c0f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d18fb6db2af4743d5e66ecdde13d96b3ade8c0f4/irc.py
@rtype: C{int} @return: An string of printable characters uniquely identifying for all time the specified message.
@rtype: C{str} @return: A string of printable characters uniquely identifying for all time the specified message.
def getUidl(self, index): """Get a unique identifier for a particular message. @type index: C{int} @param index: The number of the message for which to retrieve a UIDL @rtype: C{int} @return: An string of printable characters uniquely identifying for all time the specified message. """
2db00a47f84f390f63e23f8da003b95f5bc6f6ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2db00a47f84f390f63e23f8da003b95f5bc6f6ec/pop3.py
cmdline = "%s %s" % (command, string.join(args[1:], ' ')) self.hProcess, hThread, dwPid, dwTid = win32process.CreateProcess(None, cmdline, None, None, 1, 0, env, path, StartupInfo)
cmdline = ' '.join([_cmdLineQuote(a) for a in args[1:]]) self.hProcess, hThread, dwPid, dwTid = win32process.CreateProcess(command, cmdline, None, None, 1, 0, env, path, StartupInfo)
def __init__(self, reactor, protocol, command, args, environment, path): self.reactor = reactor self.protocol = protocol
dfa6d6cdff228e2d4fe33a0f20660fbb41af0870 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/dfa6d6cdff228e2d4fe33a0f20660fbb41af0870/win32eventreactor.py
return base64.encodestring(k)
return string.replace(base64.encodestring(k), '\n', '_')
def _encode(self, k): """Encode a key so it can be used as a filename. """ return base64.encodestring(k)
5610da2a2a572b87412d5d7cb928101f0fca3b55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5610da2a2a572b87412d5d7cb928101f0fca3b55/dirdbm.py
return base64.decodestring(k)
return base64.decodestring(string.replace(k, '_', '\n'))
def _decode(self, k): """Decode a filename to get the key. """ return base64.decodestring(k)
5610da2a2a572b87412d5d7cb928101f0fca3b55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5610da2a2a572b87412d5d7cb928101f0fca3b55/dirdbm.py
pbecho.SimpleService("pbecho",appl).getPerspectiveNamed("guest").makeIdentity("guest") appl.listenTCP(pb.portno, pb.BrokerFactory(pb.AuthRoot(appl)))
auth = DefaultAuthorizer(appl) service = pbecho.SimpleService("pbecho", appl, auth) service.getPerspectiveNamed("guest").makeIdentity("guest") appl.listenTCP(pb.portno, pb.BrokerFactory(pb.AuthRoot(auth)))
def getPerspectiveNamed(self, name): p = SimplePerspective(name) p.setService(self) return p
a6778e3de4596bc6ce11a3a311f77b44a985bc37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a6778e3de4596bc6ce11a3a311f77b44a985bc37/pbecho.py
L{twisted.internet.interfaces.Transport}.
L{twisted.internet.interfaces.ITransport}.
def resetDelay(self): """Call me after a successful connection to reset.
a1cbb3b6fed7f7cd7dcfeae3b0116ba56770431c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a1cbb3b6fed7f7cd7dcfeae3b0116ba56770431c/protocol.py
class WordsGateway(gateway.Gateway,pb.Referenceable):
class WordsGateway(gateway.Gateway,pb.Referenced):
def pbCallback(self,perspective): self.im.attachGateway(self.ref) self.ref.connected(perspective) self.ref.b=self.b self.attached=1
c63dfbbbfa88180b2fb7327415860a49597227fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c63dfbbbfa88180b2fb7327415860a49597227fc/words.py
def saveApplications(p, type, enc, filename):
def saveApplication(p, type, enc, filename):
def saveApplications(p, type, enc, filename): p.setStyle(type) p.save(filename=(not enc) and filename, passphrase=enc and util.getPassword("Encryption passphrase: "))
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
p.save(filename=(not enc) and filename, passphrase=enc and util.getPassword("Encryption passphrase: "))
if enc: passphrase = util.getPassword("Encryption passphrase: ") filename = None else: passphrase = None p.save(filename=filename, passphrase=passphrase)
def saveApplications(p, type, enc, filename): p.setStyle(type) p.save(filename=(not enc) and filename, passphrase=enc and util.getPassword("Encryption passphrase: "))
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
plugins = getPlugIns("tap", debug, progress)
plugins = plugin.getPlugIns("tap", debug, progress)
def loadPlugins(debug = None, progress = None): try: plugins = getPlugIns("tap", debug, progress) except IOError: print "Couldn't load the plugins file!" sys.exit(2) tapLookup = {} for plug in plugins: if hasattr(plug, 'tapname'): shortTapName = plug.tapname else: shortTapName = plug.module.split('.')[-1] tapLookup[sh...
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
GeneralOptions.postOptions(self)
def postOptions(self): if self.recursing: GeneralOptions.postOptions(self) return debug = progress = None if self['debug']: debug = self._reportDebug if self['progress']: progress = self._reportProgress self.pb = util.makeStatBar(60, 1.0) self.tapLookup = loadPlugins(debug, progress) self.init(self.tapLookup) self.rec...
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
def getApplication(uid, gid, filename):
def getApplication(uid, gid, name, filename):
def getApplication(uid, gid, filename): if filename and os.path.exists(filename): return sob.load(filename, 'pickle') else: uid, gid = getid(uid, gid): return service.Application(options.subCommand, uid, gid)
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
uid, gid = getid(uid, gid): return service.Application(options.subCommand, uid, gid) def makeService(mod, s):
uid, gid = getid(uid, gid) return service.Application(name, uid, gid) def makeService(mod, s, options):
def getApplication(uid, gid, filename): if filename and os.path.exists(filename): return sob.load(filename, 'pickle') else: uid, gid = getid(uid, gid): return service.Application(options.subCommand, uid, gid)
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
mod.updateApplication(compat.IOldApplication(s), options.subOptions)
ser = service.MultiService() mod.updateApplication(compat.IOldApplication(ser), options)
def makeService(mod, s): if hasattr(mod, 'updateApplication'): mod.updateApplication(compat.IOldApplication(s), options.subOptions) else: mod.makeService(options.subOptions).setServiceParent(s)
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
mod.makeService(options.subOptions).setServiceParent(s)
ser = mod.makeService(options) ser.setServiceParent(s)
def makeService(mod, s): if hasattr(mod, 'updateApplication'): mod.updateApplication(compat.IOldApplication(s), options.subOptions) else: mod.makeService(options.subOptions).setServiceParent(s)
60c5b2a22317d0ed6c362cf878562463f2fab37f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60c5b2a22317d0ed6c362cf878562463f2fab37f/mktap.py
packages=dist.getPackages('twisted'), data_files=dist.getDataFiles('twisted'),
packages=dist.getPackages(util.sibpath(__file__, 'twisted')), data_files=dist.getDataFiles(util.sibpath(__file__, 'twisted')),
def dict(**kw): return kw
e58f56ec7c48498cc6f0f92dd31bf10551773a19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e58f56ec7c48498cc6f0f92dd31bf10551773a19/setup.py
try: os.unlink('dist/%s' % twisteddist) os.unlink('dist/%s' % twisteddistnodocs) except EnvironmentError: pass
for f in (twisteddist, twisteddistnodocs): try: os.unlink('dist/%s' % f) except EnvironmentError: pass
def infozip(args=''): invoke(r'%s\bin\zip.exe' % options['cyghome'], args)
b287ecc8e2084c3331aa0fb200c667e0e10114c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b287ecc8e2084c3331aa0fb200c667e0e10114c5/build.py
class Option(Input):
class Option(Widget):
def setUp(self, request, node, data): self['type'] = 'button' Input.setUp(self, request, node, data)
7c113ce0af0914f30618d1de7e6a199da36c4b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7c113ce0af0914f30618d1de7e6a199da36c4b59/widgets.py
Input.setUp(self, request, node, data)
if data is None: data = '' if not self.attributes.has_key('value'): self['value'] = str(data)
def setUp(self, request, node, data): self.add(Text(self.text or data)) Input.setUp(self, request, node, data)
7c113ce0af0914f30618d1de7e6a199da36c4b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7c113ce0af0914f30618d1de7e6a199da36c4b59/widgets.py
import gtk
def _our_mainquit(): # XXX: gtk.main_quit() (which is used for crash()) raises an exception if # gtk.main_level() == 0; however, all the tests freeze if we use this # function to stop the reactor. what gives? if gtk.main_level(): gtk.main_quit()
8c0b83fa68e8203a9fd6f8fdc9db55ebc34be1fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8c0b83fa68e8203a9fd6f8fdc9db55ebc34be1fb/gtk2reactor.py
self.__crash = gtk.main_quit
self.__crash = _our_mainquit
def __init__(self, useGtk=True): self.context = gobject.main_context_default() self.loop = gobject.MainLoop() posixbase.PosixReactorBase.__init__(self) # pre 2.3.91 the glib iteration and mainloop functions didn't release # global interpreter lock, thus breaking thread and signal support. if (hasattr(gobject, "pygtk_ve...
8c0b83fa68e8203a9fd6f8fdc9db55ebc34be1fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8c0b83fa68e8203a9fd6f8fdc9db55ebc34be1fb/gtk2reactor.py
d=utils.getProcessOutput(exe, ['-c', 'print "hello world"']) d.addCallback(self.saveOutput) ttl = time.time() + 5 while self.output is None and time.time() < ttl: reactor.iterate(0.01) self.failIf(self.output is None, "timeout") self.assertEquals(self.output, "hello world\n")
scriptFile = self.makeSourceFile( 'import sys\n' 'sys.stderr.write("hello world\\n")\n')
def testOutput(self): exe = sys.executable d=utils.getProcessOutput(exe, ['-c', 'print "hello world"']) d.addCallback(self.saveOutput) ttl = time.time() + 5 while self.output is None and time.time() < ttl: reactor.iterate(0.01) self.failIf(self.output is None, "timeout") self.assertEquals(self.output, "hello world\n")
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
def testOutputWithError(self):
d = utils.getProcessOutput(exe, [scriptFile], errortoo=0) return assertions.assertFailure(d, IOError) def testOutputWithErrorCollected(self):
def testOutputWithError(self): exe = sys.executable sx = r'import sys; sys.stderr.write("hello world\n")' res1 = [] # make sure stderr raises an error normally d = utils.getProcessOutput(exe, ['-c', sx], errortoo=0) d.addBoth(res1.append) ttl = time.time() + 5 while len(res1) == 0 and time.time() < ttl: reactor.iterate...
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
sx = r'import sys; sys.stderr.write("hello world\n")' res1 = [] d = utils.getProcessOutput(exe, ['-c', sx], errortoo=0) d.addBoth(res1.append) ttl = time.time() + 5 while len(res1) == 0 and time.time() < ttl: reactor.iterate(0.01) self.failUnless(len(res1), "timeout") self.failUnless(isinstance(res1.pop().value, IOErr...
scriptFile = self.makeSourceFile( 'import sys\n' 'sys.stderr.write("hello world\\n")\n') d = utils.getProcessOutput(exe, [scriptFile], errortoo=1) return d.addCallback(self.assertEquals, "hello world\n")
def testOutputWithError(self): exe = sys.executable sx = r'import sys; sys.stderr.write("hello world\n")' res1 = [] # make sure stderr raises an error normally d = utils.getProcessOutput(exe, ['-c', sx], errortoo=0) d.addBoth(res1.append) ttl = time.time() + 5 while len(res1) == 0 and time.time() < ttl: reactor.iterate...
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
d=utils.getProcessValue(exe, ['-c', 'import sys;sys.exit(1)']) d.addCallback(self.saveValue) ttl = time.time() + 5 while self.value is None and time.time() < ttl: reactor.iterate(0.01) self.failIf(self.value is None, "timeout") self.assertEquals(self.value, 1)
scriptFile = self.makeSourceFile( "import sys\n" "sys.exit(1)\n")
def testValue(self): exe = sys.executable d=utils.getProcessValue(exe, ['-c', 'import sys;sys.exit(1)']) d.addCallback(self.saveValue) ttl = time.time() + 5 while self.value is None and time.time() < ttl: reactor.iterate(0.01) self.failIf(self.value is None, "timeout") self.assertEquals(self.value, 1)
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
def saveValue(self, o): self.value = o def saveOutput(self, o): self.output = o
d = utils.getProcessValue(exe, [scriptFile]) return d.addCallback(self.assertEquals, 1)
def saveValue(self, o): self.value = o
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
sx = r'import sys; sys.stdout.write("hello world!\n"); ' \ r'sys.stderr.write("goodbye world!\n"); sys.exit(1)' result = [] d = utils.getProcessOutputAndValue(exe, ['-c', sx]) d.addCallback(result.append) ttl = time.time() + 5 while len(result) == 0 and time.time() < ttl: reactor.iterate(0.01) self.failUnless(len(resul...
scriptFile = self.makeSourceFile( "import sys\n" "sys.stdout.write('hello world!\\n')\n" "sys.stderr.write('goodbye world!\\n')\n" "sys.exit(1)") def gotOutputAndValue((out, err, code)): self.assertEquals(out, "hello world!\n") self.assertEquals(err, "goodbye world!\n") self.assertEquals(code, 1) d = utils.getProcessO...
def testOutputAndValue(self): exe = sys.executable sx = r'import sys; sys.stdout.write("hello world!\n"); ' \ r'sys.stderr.write("goodbye world!\n"); sys.exit(1)' result = [] d = utils.getProcessOutputAndValue(exe, ['-c', sx]) d.addCallback(result.append) ttl = time.time() + 5 while len(result) == 0 and time.time() < t...
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
sx = r'import os, signal;os.kill(os.getpid(), signal.SIGKILL)' result = [] d = utils.getProcessOutputAndValue(exe, ['-c', sx]) d.addErrback(result.append) ttl = time.time() + 5 while len(result) == 0 and time.time() < ttl: reactor.iterate(0.01) self.failUnless(len(result), "timeout") actual = result[0].value expected =...
scriptFile = self.makeSourceFile( "import sys, os, signal\n" "sys.stdout.write('stdout bytes\\n')\n" "sys.stderr.write('stderr bytes\\n')\n" "sys.stdout.flush()\n" "sys.stderr.flush()\n" "os.kill(os.getpid(), signal.SIGKILL)\n")
def testOutputSignal(self): # Use SIGKILL here because it's guaranteed to be delivered. Using # SIGHUP might not work in, e.g., a buildbot slave run under the # 'nohup' command. exe = sys.executable sx = r'import os, signal;os.kill(os.getpid(), signal.SIGKILL)' result = [] d = utils.getProcessOutputAndValue(exe, ['-c',...
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
if not interfaces.IReactorProcess(reactor, None):
def gotOutputAndValue(err): (out, err, sig) = err.value self.assertEquals(out, "stdout bytes\n") self.assertEquals(err, "stderr bytes\n") self.assertEquals(sig, signal.SIGKILL) d = utils.getProcessOutputAndValue(exe, [scriptFile]) return d.addErrback(gotOutputAndValue) if interfaces.IReactorProcess(reactor, None) is ...
def testOutputSignal(self): # Use SIGKILL here because it's guaranteed to be delivered. Using # SIGHUP might not work in, e.g., a buildbot slave run under the # 'nohup' command. exe = sys.executable sx = r'import os, signal;os.kill(os.getpid(), signal.SIGKILL)' result = [] d = utils.getProcessOutputAndValue(exe, ['-c',...
fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc28c9bd0f6a10a7f4d537cd072f9e6efd72fd81/test_iutils.py
components.fixClassImplements(Sub) components.fixClassImplements(MultiplyAndAdd)
def testClasses(self): # is this a right thing to do? self.assert_( IMultiply.implementedBy(MultiplyAndAdd) ) self.assert_( IAdder.implementedBy(MultiplyAndAdd) ) self.assert_( IAdder.implementedBy(Sub) ) self.assert_( ISub.implementedBy(Sub) )
1c9b5b7f0f5d5e87718acf26ea3accc1a1037683 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1c9b5b7f0f5d5e87718acf26ea3accc1a1037683/test_components.py
el=doc1.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName
el1=doc1.documentElement actual=domhelpers.getElementsByTagName(el1, 'foo')[0].nodeName
def test_getElementsByTagName(self): doc1=microdom.parseString('<foo/>') actual=domhelpers.getElementsByTagName(doc1, 'foo')[0].nodeName expected='foo' self.assertEquals(actual, expected) el=doc1.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName self.assertEqual(actual, expected)
4c798b986c049ff03c36b7540113e457a696a90a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4c798b986c049ff03c36b7540113e457a696a90a/test_domhelpers.py
el=doc2.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName
el2=doc2.documentElement tag_list=domhelpers.getElementsByTagName(el2, 'foo') actual=''.join([node.getAttribute('in') for node in tag_list])
def test_getElementsByTagName(self): doc1=microdom.parseString('<foo/>') actual=domhelpers.getElementsByTagName(doc1, 'foo')[0].nodeName expected='foo' self.assertEquals(actual, expected) el=doc1.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName self.assertEqual(actual, expected)
4c798b986c049ff03c36b7540113e457a696a90a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4c798b986c049ff03c36b7540113e457a696a90a/test_domhelpers.py
el=doc3.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName
el3=doc3.documentElement tag_list=domhelpers.getElementsByTagName(el3, 'foo') actual=''.join([node.getAttribute('in') for node in tag_list])
def test_getElementsByTagName(self): doc1=microdom.parseString('<foo/>') actual=domhelpers.getElementsByTagName(doc1, 'foo')[0].nodeName expected='foo' self.assertEquals(actual, expected) el=doc1.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName self.assertEqual(actual, expected)
4c798b986c049ff03c36b7540113e457a696a90a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4c798b986c049ff03c36b7540113e457a696a90a/test_domhelpers.py
el=doc4.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName
actual=domhelpers.getElementsByTagName(root, 'foo')
def test_getElementsByTagName(self): doc1=microdom.parseString('<foo/>') actual=domhelpers.getElementsByTagName(doc1, 'foo')[0].nodeName expected='foo' self.assertEquals(actual, expected) el=doc1.documentElement actual=domhelpers.getElementsByTagName(el, 'foo')[0].nodeName self.assertEqual(actual, expected)
4c798b986c049ff03c36b7540113e457a696a90a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4c798b986c049ff03c36b7540113e457a696a90a/test_domhelpers.py
if path == '': return self
def getChild(self, path, request): """See twisted.web.Resource.getChild. """ if path == '': return self
69e46aab8c4cee8d25af0b2da7c7381228a9836b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/69e46aab8c4cee8d25af0b2da7c7381228a9836b/static.py
childPath = os.path.join(self.path, path)
if path == '': childPath = self.path else: childPath = os.path.join(self.path, path)
def getChild(self, path, request): """See twisted.web.Resource.getChild. """ if path == '': return self
69e46aab8c4cee8d25af0b2da7c7381228a9836b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/69e46aab8c4cee8d25af0b2da7c7381228a9836b/static.py
spinWhile(lambda :(not clientF.protocol or not clientF.protocol.closed))
spinWhile(lambda :(not clientF.protocol or not clientF.protocol.closed))
def testClosePortInProtocolFactory(self): f = ClosingFactory() port = reactor.listenTCP(0, f, interface="127.0.0.1") self.n = port.getHost().port self.ports.append(port) f.port = port clientF = MyClientFactory() reactor.connectTCP("127.0.0.1", self.n, clientF)
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
spinUntil(lambda :(f.called > 0 and getattr(clientF, 'protocol', None) is not None))
spinUntil(lambda :(f.called > 0 and getattr(clientF, 'protocol', None) is not None))
def testTcpNoDelay(self): f = MyServerFactory() port = reactor.listenTCP(0, f, interface="127.0.0.1")
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
spinUntil(lambda :(f.called > 0 and getattr(clientF, 'protocol', None) is not None))
spinUntil(lambda :(f.called > 0 and getattr(clientF, 'protocol', None) is not None))
def testTcpKeepAlive(self): f = MyServerFactory() port = reactor.listenTCP(0, f, interface="127.0.0.1") self.n = port.getHost().port self.ports.append(port) clientF = MyClientFactory() reactor.connectTCP("127.0.0.1", self.n, clientF)
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
reactor.connectTCP("127.0.0.1", "thisbetternotexist", MyClientFactory())
reactor.connectTCP("127.0.0.1", "thisbetternotexist", MyClientFactory())
def testConnectByServiceFail(self): try: reactor.connectTCP("127.0.0.1", "thisbetternotexist", MyClientFactory()) except error.ServiceNameUnknownError: return self.assert_(False, "connectTCP didn't raise ServiceNameUnknownError")
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
socket.getservbyname = lambda s, p,n=self.n: s == 'http' and p == 'tcp' and n or 10
socket.getservbyname = (lambda s, p,n=self.n: s == 'http' and p == 'tcp' and n or 10)
def testConnectByService(self): serv = socket.getservbyname try: s = MyServerFactory() port = reactor.listenTCP(0, s, interface="127.0.0.1") self.n = port.getHost().port socket.getservbyname = lambda s, p,n=self.n: s == 'http' and p == 'tcp' and n or 10 self.ports.append(port) cf = MyClientFactory() try: c = reactor.co...
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
"""Tests for correct behavior when a reactor cannot bind to the required TCP port."""
"""Tests for correct behavior when a reactor cannot bind to the required TCP port."""
def clientConnectionLost(c, reason): c.connect()
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
self.assertRaises(error.CannotListenError, reactor.listenTCP, n, f, interface='127.0.0.1')
self.assertRaises(error.CannotListenError, reactor.listenTCP, n, f, interface='127.0.0.1')
def testCannotBind(self): f = MyServerFactory()
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
reactor.connectTCP("127.0.0.1", p.getHost().port, factory, bindAddress=("127.0.0.1", 0))
reactor.connectTCP("127.0.0.1", p.getHost().port, factory, bindAddress=("127.0.0.1", 0))
def testClientBind(self): f = MyServerFactory() p = reactor.listenTCP(0, f, interface="127.0.0.1") self.ports.append(p) factory = MyClientFactory() reactor.connectTCP("127.0.0.1", p.getHost().port, factory, bindAddress=("127.0.0.1", 0))
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
reactor.connectTCP("127.0.0.1", p.getHost().port, f2, bindAddress=("127.0.0.1", port))
reactor.connectTCP("127.0.0.1", p.getHost().port, f2, bindAddress=("127.0.0.1", port))
def testClientBind(self): f = MyServerFactory() p = reactor.listenTCP(0, f, interface="127.0.0.1") self.ports.append(p) factory = MyClientFactory() reactor.connectTCP("127.0.0.1", p.getHost().port, factory, bindAddress=("127.0.0.1", 0))
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
def tearDown(self): # Wait until all the protocols on the server-side of this test have been # disconnected, to avoid leaving junk in the reactor. for d in self.serverConns: util.wait(d)
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
IPv4Address("TCP", self.transport.getHost().host, self.transport.getHost().port))
IPv4Address("TCP", self.transport.getHost().host, self.transport.getHost().port))
def connectionMade(self): reactor.callLater(0.1, self.transport.loseConnection) self.factory.testcase.assertEquals(self.transport.getHost(), IPv4Address("TCP", self.transport.getHost().host, self.transport.getHost().port)) self.factory.testcase.assertEquals(self.transport.getPeer(), IPv4Address("TCP", self.transport.ge...
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
IPv4Address("TCP", self.transport.getPeer().host, self.transport.getPeer().port)) self.factory.testcase.assertEquals(self.transport.getPeer(), self.factory.ipv4addr)
IPv4Address("TCP", self.transport.getPeer().host, self.transport.getPeer().port)) self.factory.testcase.assertEquals(self.transport.getPeer(), self.factory.ipv4addr)
def connectionMade(self): reactor.callLater(0.1, self.transport.loseConnection) self.factory.testcase.assertEquals(self.transport.getHost(), IPv4Address("TCP", self.transport.getHost().host, self.transport.getHost().port)) self.factory.testcase.assertEquals(self.transport.getPeer(), IPv4Address("TCP", self.transport.ge...
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
p = reactor.listenTCP(0, AServerFactory(self, IPv4Address('TCP', '127.0.0.1', portno)))
f = AServerFactory(self, IPv4Address('TCP', '127.0.0.1', portno)) p = reactor.listenTCP(0, f)
def testBuildProtocol(self): portno = self.getFreePort()
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
acf = AClientFactory(self, IPv4Address("TCP", "127.0.0.1", p.getHost().port)) reactor.connectTCP("127.0.0.1", p.getHost().port, acf, bindAddress=("127.0.0.1", portno))
acf = AClientFactory(self, IPv4Address("TCP", "127.0.0.1", p.getHost().port)) reactor.connectTCP("127.0.0.1", p.getHost().port, acf, bindAddress=("127.0.0.1", portno))
def testBuildProtocol(self): portno = self.getFreePort()
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
ProperlyCloseFilesTestCase.numberRounds = resource.getrlimit(resource.RLIMIT_NOFILE)[0] + 10
numRounds = resource.getrlimit(resource.RLIMIT_NOFILE)[0] + 10 ProperlyCloseFilesTestCase.numberRounds = numRounds
def testWriteNotificationRaises(self): self.client.writeConnectionLost = self.aBug self.client.transport.loseWriteConnection() spinUntil(lambda :self.client.closed) log.flushErrors(RuntimeError)
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
for childNum in range(node.childNodes.length):
if hasattr(node.childNodes, 'length'): length = node.childNodes.length else: length = len(node.childNodes) for childNum in length:
def _get(node, nodeId): if hasattr(node, 'hasAttributes') and node.hasAttributes() and ((str(node.getAttribute("id")) == nodeId) or (str(node.getAttribute("class")) == nodeId) or (str(node.getAttribute("model")) == nodeId)): return node if node.hasChildNodes(): for childNum in range(node.childNodes.length): result = _g...
b1bb264f4b21a45275b2ed6d8933a4cdb336c70c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b1bb264f4b21a45275b2ed6d8933a4cdb336c70c/domhelpers.py
@param dest: C{URL}. This should be a *physical* URL, not a logical one.
@param destURL: C{URL}. This should be a *physical* URL, not a logical one.
def sendMessage(self, destURL, message): """Send a message.
6aaa854ce9cf321d5ab41f378daa3166eb57dd4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6aaa854ce9cf321d5ab41f378daa3166eb57dd4c/sip.py
@param userURL: a logical C{URL}.
@param logicalURL: a logical C{URL}.
def getAddress(self, logicalURL): """Return physical URL of server for logical URL of user.
6aaa854ce9cf321d5ab41f378daa3166eb57dd4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6aaa854ce9cf321d5ab41f378daa3166eb57dd4c/sip.py
@type peer: The client's address
@param peer: The client's address
def getChallenge(self, peer): """Generate a challenge the client may respond to. @type peer: C{tuple} @type peer: The client's address @rtype: C{str} @return: The challenge string """
6aaa854ce9cf321d5ab41f378daa3166eb57dd4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6aaa854ce9cf321d5ab41f378daa3166eb57dd4c/sip.py
p.registerChecker(checkers.InMemoryUsernamePasswordDatabaseDontUse(user1="pass1"))
p.registerChecker( checkers.InMemoryUsernamePasswordDatabaseDontUse(user1="pass1"))
def requestAvatar(self, avatarId, mind, *interfaces): if pb.IPerspective not in interfaces: raise NotImplementedError return pb.IPerspective, MyPerspective(avatarId), lambda:None
f895201d7b77cd5ed65208a0071fae2326101b00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f895201d7b77cd5ed65208a0071fae2326101b00/pb5server.py
if ose.errno == errno.EPERM:
if ose.errno in (errno.EACCES, errno.ENOENT):
def _clearCache(self): try: os.remove(sibpath(plugins.__file__, 'dropin.cache')) except OSError, ose: if ose.errno == errno.EPERM: print 'Testing in deployed mode.' else: raise
b2b7cf44f8ba0e340da4babcd1d3a5e9d2196fe0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b2b7cf44f8ba0e340da4babcd1d3a5e9d2196fe0/test_plugin.py
except OSError, ose: if ose.errno == errno.EPERM: raise unittest.SkiptTest(
except IOError, ioe: if ioe.errno == errno.EACCES: raise unittest.SkipTest(
def _testDetectNewFiles(self): writeFileName = sibpath(plugins.__file__, 'pluginextra.py') try: wf = file(writeFileName, 'w') except OSError, ose: if ose.errno == errno.EPERM: raise unittest.SkiptTest( "No permission to add things to twisted.plugins") else: raise else: try: wf.write(begintest) wf.flush()
b2b7cf44f8ba0e340da4babcd1d3a5e9d2196fe0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b2b7cf44f8ba0e340da4babcd1d3a5e9d2196fe0/test_plugin.py
writeFile = file(writeFileName, 'w')
try: writeFile = file(writeFileName, 'w') except IOError, ioe: if ioe.errno == errno.EACCES: raise unittest.SkipTest( "No permission to add things to twisted.plugins") else: raise
def _testDetectFilesChanged(self): writeFileName = sibpath(plugins.__file__, 'pluginextra.py') writeFile = file(writeFileName, 'w') try: writeFile.write(begintest) writeFile.flush() plgs = list(plugin.getPlugIns(plugin.ITestPlugin)) # Sanity check self.assertEquals( len(plgs), 2, "Unexpected plugins found: %r" % ( [p._...
b2b7cf44f8ba0e340da4babcd1d3a5e9d2196fe0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b2b7cf44f8ba0e340da4babcd1d3a5e9d2196fe0/test_plugin.py
print repr(data) d = self.sendGlobalRequest('tcpip-forward', data, 1)
d = self.sendGlobalRequest('tcpip-forward', data)
def serviceStarted(self): if not options['notty']: self.openChannel(SSHSession()) if options.localForwards: for localPort, hostport in options.localForwards: reactor.listenTCP(localPort, forwarding.SSHLocalForwardingFactory(self, hostport)) if options.remoteForwards: for remotePort, hostport in options.remoteForwards: ...
10190f1e6ff609457b68d8105e9a08ea93d3daf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10190f1e6ff609457b68d8105e9a08ea93d3daf6/conch.py
d.addCallback(self.reply) def reply(self, data): log.msg('GLOBAL MESSAGE REPLY: %s' % repr(data))
def serviceStarted(self): if not options['notty']: self.openChannel(SSHSession()) if options.localForwards: for localPort, hostport in options.localForwards: reactor.listenTCP(localPort, forwarding.SSHLocalForwardingFactory(self, hostport)) if options.remoteForwards: for remotePort, hostport in options.remoteForwards: ...
10190f1e6ff609457b68d8105e9a08ea93d3daf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/10190f1e6ff609457b68d8105e9a08ea93d3daf6/conch.py
if s:
if s and not self.raw:
def gotTagStart(self, name, attributes): s = getattr(self, "mapStart_"+name, None) if s: self.writer(s) m = getattr(self, "start_"+name, None) m and m(name, attributes)
c1763abfac2d349d73fa6d7998147ca836edcee0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c1763abfac2d349d73fa6d7998147ca836edcee0/latex.py
if s:
if s and not self.raw:
def gotTagEnd(self, name): s = getattr(self, "mapEnd_"+name, None) if s: self.writer(s) m = getattr(self, "end_"+name, None) m and m(name)
c1763abfac2d349d73fa6d7998147ca836edcee0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c1763abfac2d349d73fa6d7998147ca836edcee0/latex.py
write('''<table border=0 cellpadding=2> <tr>''')
write('''<table border=0 cellpadding=2 width=100%> ''') write('''<tr><td colspan=7 bgcolor=black><font color=white><center><b>%s %s</b></center></font></td></tr> <tr>'''%(calendar.month_name[self.month],self.year))
def stream(self,write,request): write('''<table border=0 cellpadding=2>
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
write("</center></td>")
write("</center></td>\n")
def stream(self,write,request): write('''<table border=0 cellpadding=2>
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
def process(self,write,request,day,month,year,title,data):
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
%%%%displayAuth(request)%%%%
%%%%displayFooter(request)%%%%
def process(self,write,request,day,month,year,title,data):
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
def __init__(self,password=None,filename=None):
def __init__(self,password="twisted",filename=None):
def __init__(self,password=None,filename=None): widgets.Page.__init__(self) self.password=password self.events={} self.filename=filename self.loadPickle()
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
def setDate(self,request): curtime=time.localtime(time.time()) if request.args.has_key("m"): self.month=int(request.args['m'][0]) else: self.month=curtime[1] if request.args.has_key("y"): self.year=int(request.args['y'][0]) else: self.year=curtime[0] request.auth=0
def setValues(self,request): self.auth=0
def setDate(self,request): curtime=time.localtime(time.time()) if request.args.has_key("m"): self.month=int(request.args['m'][0]) else: self.month=curtime[1] if request.args.has_key("y"): self.year=int(request.args['y'][0]) else: self.year=curtime[0] request.auth=0 if request.postpath: if self.password: if request.post...
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
if self.password: if request.postpath[0]==self.password: request.auth=1 del request.postpath[0] else: request.auth=1
if request.postpath[0]==self.password: self.auth=1 del request.postpath[0]
def setDate(self,request): curtime=time.localtime(time.time()) if request.args.has_key("m"): self.month=int(request.args['m'][0]) else: self.month=curtime[1] if request.args.has_key("y"): self.year=int(request.args['y'][0]) else: self.year=curtime[0] request.auth=0 if request.postpath: if self.password: if request.post...
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
if int(request.postpath[0])<=12 and int(request.postpath[0])>=1: self.month=int(request.postpath[0]) del request.postpath[0] if request.postpath: self.year=int(request.postpath[0]) if self.year==0: self.year=2000 elif self.year<100: self.year=1900+self.year del request.postpath[0] except ValueError: pass
test=int(request.postpath[0]) self.command="calendar" self.options=request.postpath except: self.command=request.postpath[0] self.options=request.postpath[1:] else: self.command="calendar" self.options=[] request.postpath=[] def setDate(self): curtime=time.localtime(time.time()) self.month=curtime[1] self.year=curtime...
def setDate(self,request): curtime=time.localtime(time.time()) if request.args.has_key("m"): self.month=int(request.args['m'][0]) else: self.month=curtime[1] if request.args.has_key("y"): self.year=int(request.args['y'][0]) else: self.year=curtime[0] request.auth=0 if request.postpath: if self.password: if request.post...
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
self.setDate(request) return calendar.month_name[self.month]+" "+str(self.year)
self.setValues(request) func=getattr(self,"title_%s"%self.command,None) if func: return func(request) else: return "No Title"
def title(self,request): self.setDate(request) return calendar.month_name[self.month]+" "+str(self.year)
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
if not request.postpath: return self.displayCalendar(request)
func=getattr(self,"page_%s"%self.command,None) if func: return func(request)
def displayPage(self,request): #self.setDate(request) if not request.postpath: return self.displayCalendar(request) else: if request.postpath[0]=="event": year,month,day,ind=map(int,request.postpath[1:]) return self.events[year][month][day][ind] elif request.auth and self.displayAuth(request): return "" else: return er...
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
if request.postpath[0]=="event": year,month,day,ind=map(int,request.postpath[1:]) return self.events[year][month][day][ind] elif request.auth and self.displayAuth(request): return "" else: return error.NoResource(string.join(request.postpath,"/")).render(request) def displayCalendar(self,request): return CalendarWidge...
return "No page for command %s"%self.command def displayFooter(self,request): func=getattr(self,"footer_%s"%self.command,None) if func: return func(request)
def displayPage(self,request): #self.setDate(request) if not request.postpath: return self.displayCalendar(request) else: if request.postpath[0]=="event": year,month,day,ind=map(int,request.postpath[1:]) return self.events[year][month][day][ind] elif request.auth and self.displayAuth(request): return "" else: return er...
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
return """<a href="%s">Back To the Calendar</a>"""%url def displayAuth(self,request): if request.auth: if request.postpath and request.postpath[0]=="post": return PostForm(self) elif request.postpath and request.postpath[0]=="event": return """<a href="%s/%s/%s/%s/%s">Delete</a>""" % ( request.sibLink("%s/delete"%self...
def backToCalendar(self,request): url="/"+string.join(request.prepath,"/") if request.auth: return """<a href="%s">Back To the Calendar</a>"""%(url+"/"+self.password) else: return """<a href="%s">Back To the Calendar</a>"""%url
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
c=c+"""<a href="%s/event/%s/%s/%s/%s">%s</a><br>""" % ( request.path,
c=c+"""* <a href="%s/event/%s/%s/%s/%s">%s</a><br> """ % ( self.currentPath(request),
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>""" % ( request.path, year, month, day, ...
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
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>""" % ( request.path, year, month, day, ...
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
self.data=data
self.data=string.replace(data,"\n","<br>\n")
def __init__(self,day,month,year,title,data): self.day=day self.month=month self.year=year self.title=title self.data=data
b508ccb48d151365a9e848f61248f21f87fc5e1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b508ccb48d151365a9e848f61248f21f87fc5e1d/cal.py
self.deferredContext = self._getChild(requestContext, site.getRootResource(), self.postpath)
self.deferredContext = self._getChild(requestContext, self.site.getRootResource(), self.postpath)
def process(self): "Process a request." # get site from channel if not self.site: self.site = self.chanRequest.channel.site self.defaultHeaders() self.parseURL() self.host = self.getHost() if not self.host: return # Resource Identification if self.prepathuri: # We were given an initial prepath. prepath = map(unquote, s...
f5199542ab08e10dce2bb5231268d64ed1d750ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f5199542ab08e10dce2bb5231268d64ed1d750ff/server.py
self.handleSegment, path, newctx
self._handleSegment, path, newctx
def _getChild(self, ctx, res, path): """Create a PageContext for res, call res.locateChild, and pass the result on to _handleSegment.""" # Create a context object to represent this new resource newctx = context.PageContext(tag=res, parent=ctx) newctx.remember(tuple(self.prepath), iweb.ICurrentSegments) newctx.remember...
f5199542ab08e10dce2bb5231268d64ed1d750ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f5199542ab08e10dce2bb5231268d64ed1d750ff/server.py
def notifyFinish(self):
def notifyFinish(self):
def notifyFinish(self):
f5199542ab08e10dce2bb5231268d64ed1d750ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f5199542ab08e10dce2bb5231268d64ed1d750ff/server.py
log.msg("cleaning popsicle")
def clean(self): """Persistence tick. Clean out the fridge, persist everything that wants to be saved. """ log.msg("cleaning popsicle") self.cleaning = True savers = {} try: while self.dirtySet: l = self.dirtySet.items() self.dirtySet.clear() for obj, doSave in l: ent = self.persistentObjects.get(obj) if not ent: cont...
f50472af6a5c4efc43f7985400d18db68a8c72ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f50472af6a5c4efc43f7985400d18db68a8c72ff/freezer.py
paths = filter(os.path.isdir, map(cacheTransform, sys.path))
paths = filter(os.path.isdir, map(cacheTransform, filter(lambda x:isinstance(x, type('')), sys.path)))
def getPluginFileList(debugInspection=None, showProgress=None): """Find plugin.tml files in subdirectories of paths in C{sys.path} @type debugInspection: C{None} or a callable taking one argument @param debugInspection: If not None, this is invoked with strings containing debug information about the loading process. ...
e63f527dc761db9c351f990fc62148077d7a7eb1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e63f527dc761db9c351f990fc62148077d7a7eb1/plugin.py
if not (options['noshell'] and options['fork']):
if not options['noshell']:
def onConnect(): if not (options['noshell'] and options['fork']): conn.openChannel(SSHSession()) if options.localForwards: for localPort, hostport in options.localForwards: reactor.listenTCP(localPort, forwarding.SSHListenForwardingFactory(conn, hostport, SSHListenClientForwardingChannel)) if options.remoteForwards: fo...
4bfb893230720c49527295311e72414fb87a1b46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4bfb893230720c49527295311e72414fb87a1b46/conch.py
if len(conn.channels) == 1 and not (options['fork'] and not options['nocache']):
if len(conn.channels) == 1 and not (options['noshell'] and not options['nocache']):
def closed(self): self.unix.sendMessage('closed', self.id) if len(conn.channels) == 1 and not (options['fork'] and not options['nocache']): # just us left reactor.stop()
4bfb893230720c49527295311e72414fb87a1b46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4bfb893230720c49527295311e72414fb87a1b46/conch.py
if len(self.conn.channels) == 1 and not (options['fork'] and not options['nocache']):
if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']):
def closed(self): log.msg('closed %s' % self) if len(self.conn.channels) == 1 and not (options['fork'] and not options['nocache']): # just us left reactor.stop()
4bfb893230720c49527295311e72414fb87a1b46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4bfb893230720c49527295311e72414fb87a1b46/conch.py
if len(self.conn.channels) == 1 and not (options['fork'] and not options['nocache']):
if len(self.conn.channels) == 1 and not (options['noshell'] and not options['nocache']):
def closed(self): forwarding.SSHListenClientForwardingChannel.closed(self) if len(self.conn.channels) == 1 and not (options['fork'] and not options['nocache']): # just us left reactor.stop()
4bfb893230720c49527295311e72414fb87a1b46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4bfb893230720c49527295311e72414fb87a1b46/conch.py
f.results = []
del f.results[:len(result)]
def process(): coop = f._yield() if f.results: result.extend(f.results) f.results = [] reactor.callLater(0, process) return if coop: sleep(.3) reactor.callLater(0, coop.callLater, process) return if f.stop: reactor.callLater(0, d.callback, result)
0a983824277479c6fea131cd65192bbbf1d2116c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0a983824277479c6fea131cd65192bbbf1d2116c/test_flow.py
handleStatus_200 = lambda *args: None
def handleStatus_200(self): self.factory.gotHeaders(self.headers)
1e191aa32d1fc9299221c26afe945b16e55bccfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1e191aa32d1fc9299221c26afe945b16e55bccfc/client.py
self.addresses = {}
self.addresses = {} self.resolver._sendQuery([dns.Query(service, dns.PTR, dns.IN)])
def __init__(self, service, resolver): self.service = service self.resolver = resolver self.subscribers = [] self.addresses = {} # map name to (host, port)
ca5e69ccd90a403af0cb9dc4684abc51f5ad7134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ca5e69ccd90a403af0cb9dc4684abc51f5ad7134/mdns.py
del self.service.subscriptions[self.service]
self.resolver._removeSubscription(self.service)
def unsubscribe(self, subscriber): self.subscribers.remove(subscriber) if not self.subscribers: del self.service.subscriptions[self.service]
ca5e69ccd90a403af0cb9dc4684abc51f5ad7134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ca5e69ccd90a403af0cb9dc4684abc51f5ad7134/mdns.py
self.subscriptions = {}
self.subscriptions = {} self.cachedDomains = {}
def __init__(self): self.protocol = mDNSDatagramProtocol(self) self.subscriptions = {}
ca5e69ccd90a403af0cb9dc4684abc51f5ad7134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ca5e69ccd90a403af0cb9dc4684abc51f5ad7134/mdns.py
self._sendQuery([dns.Query('_workstation._tcp.local', dns.PTR, dns.IN)])
def startListening(self): self.protocol.startListening() # XXX set QU self._sendQuery([dns.Query('_workstation._tcp.local', dns.PTR, dns.IN)])
ca5e69ccd90a403af0cb9dc4684abc51f5ad7134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ca5e69ccd90a403af0cb9dc4684abc51f5ad7134/mdns.py
subscription.gotSRV(name, r.payload)
reactor.callLater(0, subscription.gotSRV, name[:-len(service) - 1], r.payload)
def messageReceived(self, message, protocol, address = None): #print message.queries, message.answers for r in message.answers: if r.type == dns.PTR: service = r.name.name if self.subscriptions.has_key(service): self._sendQuery([dns.Query(r.payload.name.name, dns.SRV, dns.IN)]) elif r.type == dns.SRV: name = r.name.nam...
ca5e69ccd90a403af0cb9dc4684abc51f5ad7134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ca5e69ccd90a403af0cb9dc4684abc51f5ad7134/mdns.py
def serviceAdded(self, *args): print args
def _resolved(self, ip, host): print host, "is actually", ip def serviceAdded(self, name, host, port): print "%s is ('%s', %s)" % (name, host, port) d.getIP(host).addCallback(self._resolved, host)
def serviceAdded(self, *args): print args
ca5e69ccd90a403af0cb9dc4684abc51f5ad7134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ca5e69ccd90a403af0cb9dc4684abc51f5ad7134/mdns.py