rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
d.startListening() | def serviceAdded(self, *args): print args | ca5e69ccd90a403af0cb9dc4684abc51f5ad7134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ca5e69ccd90a403af0cb9dc4684abc51f5ad7134/mdns.py | |
return self.remote._prePathURL | return self._prePathURL | def prePathURL(self): return self.remote._prePathURL | 1fc19a3f5fddcf8d6c0972321b4bd54e8f6bf6ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1fc19a3f5fddcf8d6c0972321b4bd54e8f6bf6ab/distrib.py |
if cm.func_code.co_argcount == 1 and not type(vm) == types.LambdaType: | if cm.func_code.co_argcount == 1 and not type(cm) == types.LambdaType: | def getSubcontroller(self, request, node, model, controllerName): controller = None cm = getattr(self, 'wcfactory_' + controllerName, None) if cm is None: cm = getattr(self, 'factory_' + controllerName, None) if cm is not None: warnings.warn("factory_ methods are deprecated; please use " "wcfactory_ instead", Deprecati... | 34363e398d8b29066ffd3b4a7d1f15f5670463bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/34363e398d8b29066ffd3b4a7d1f15f5670463bf/controller.py |
"Wrap <pre> tags around some text and escape it with web.escapehtml." | "Wrap <pre> tags around some text and HTML-escape it." | def PRE(text): "Wrap <pre> tags around some text and escape it with web.escapehtml." return "<pre>"+escape(text)+"</pre>" | 1235bf9723a60f372fe5785d8f85ca12be8c6b6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1235bf9723a60f372fe5785d8f85ca12be8c6b6c/html.py |
import shutil shutil.copyfile('win32/twisted-postinstall.py', 'twisted-postinstall.py') setup_args['scripts'].append('twisted-postinstall.py') | setup_args['scripts'].append('win32/twisted-postinstall.py') | def _detect_modules(self): """ Determine which extension modules we should build on this system. """ | ea68780b29828af05b6a63188ba2f8b9ba39950d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ea68780b29828af05b6a63188ba2f8b9ba39950d/setup.py |
self.sendCode(250, '%s Hello %s, nice to meet you' % (self.host, peer)) | self.sendCode(250, '%s Hello %s, nice to meet you' % (self.host, host)) | def do_HELO(self, rest): peer = self.transport.getPeer() try: host = peer.host except AttributeError: host = str(peer) self._helo = (rest, host) self._from = None self._to = [] self.sendCode(250, '%s Hello %s, nice to meet you' % (self.host, peer)) | 1fabffd4cb782b18e01fc9fc530aec3e72dafbf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1fabffd4cb782b18e01fc9fc530aec3e72dafbf4/smtp.py |
timeOut = 60 * 60 * 12 | def connectionLost(self, reason): """connection was lost""" pass | 6494592dfee619e3c115a8a4a1fb3a414b3e6ea1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6494592dfee619e3c115a8a4a1fb3a414b3e6ea1/http.py | |
_getDebugger().run("suite.run(config['random'])", globals(), locals()) | suite.debugger = suite.reporter.debugger = True suite.run(config['random']) | def _doRun(config): suite = _getSuite(config) _getDebugger().run("suite.run(config['random'])", globals(), locals()) return suite | 4d65fd7651497cf9ed1f9e8ca32275c6e94b4d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4d65fd7651497cf9ed1f9e8ca32275c6e94b4d5b/trial.py |
return call_until_failure(_doRun, config) | return _getDebugger(config).runcall(call_until_failure, _doRun, config) | def _doRun(config): suite = _getSuite(config) _getDebugger().run("suite.run(config['random'])", globals(), locals()) return suite | 4d65fd7651497cf9ed1f9e8ca32275c6e94b4d5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4d65fd7651497cf9ed1f9e8ca32275c6e94b4d5b/trial.py |
File._directoryLister = DirectoryLister | def __repr__(self): return '<DirectoryLister of %r>' % self.path | 8ff5efe1c54bbfe7f9f7f4638eb52aee06d83657 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8ff5efe1c54bbfe7f9f7f4638eb52aee06d83657/dirlist.py | |
return defer.deferToThread(socket.gethostbyname, name).chainDeferred(d) | return threads.deferToThread(socket.gethostbyname, name) | def getHostByName(self, name, timeout = 10): # XXX - Make this respect timeout return defer.deferToThread(socket.gethostbyname, name).chainDeferred(d) | 702b60953389156b6b780a10b587e54e2808837d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/702b60953389156b6b780a10b587e54e2808837d/client.py |
rw = 1 | def testIdListParser(self): inputs = [ '1', '1,2', '1,3,5', '1:10', '1:10,11', '1:5,10:20', '1,5:10', '1,5:10,15:20', '1:10,15,20:25', ] outputs = [ [1], [1, 2], [1, 3, 5], range(1, 11), range(1, 12), range(1, 6) + range(10, 21), [1] + range(5, 11), [1] + range(5, 11) + range(15, 21), range(1, 11) + [15] + range(20, 2... | 1efc2c99ff92b68cc100fd30a0d70a4297c764b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1efc2c99ff92b68cc100fd30a0d70a4297c764b3/test_imap.py | |
return 1 | return self.rw | def isWriteable(self): return 1 | 1efc2c99ff92b68cc100fd30a0d70a4297c764b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1efc2c99ff92b68cc100fd30a0d70a4297c764b3/test_imap.py |
self._cbStopClient() | self._cbStopClient(None) | def examined(args): self.examinedArgs = args self._cbStopClient() | 1efc2c99ff92b68cc100fd30a0d70a4297c764b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1efc2c99ff92b68cc100fd30a0d70a4297c764b3/test_imap.py |
testExamine.todo = "Test framework's mailbox is always READ-WRITE" | def examined(args): self.examinedArgs = args self._cbStopClient() | 1efc2c99ff92b68cc100fd30a0d70a4297c764b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1efc2c99ff92b68cc100fd30a0d70a4297c764b3/test_imap.py | |
pwrq.addCallback(self._testmakeIdentity_1) pwrq.addErrback(self._testmakeIdentity_1fail) | pwrq.addCallbacks(self._testmakeIdentity_1, self._testmakeIdentity_1fail) | def testmakeIdentity(self): self.ident = ident = self.perspective.makeIdentity("password") # simple password verification pwrq = ident.verifyPlainPassword("password") pwrq.addCallback(self._testmakeIdentity_1) pwrq.addErrback(self._testmakeIdentity_1fail) pwrq.arm() | 472c8259b25bb01d85ebb65b1fd9d23a3856f6f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/472c8259b25bb01d85ebb65b1fd9d23a3856f6f8/test_cred.py |
self.fail("Identity did not verify with plain password") | try: self.fail("Identity did not verify with plain password: %s" % msg) except self.failureException, e: self.error = sys.exc_info() raise | def _testmakeIdentity_1fail(self, msg): self.fail("Identity did not verify with plain password") | 472c8259b25bb01d85ebb65b1fd9d23a3856f6f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/472c8259b25bb01d85ebb65b1fd9d23a3856f6f8/test_cred.py |
self.fail("Identity did not verify with hashed password") | try: self.fail("Identity did not verify with hashed password: %s" % msg) except self.failureException, e: self.error = sys.exc_info() raise | def _testmakeIdentity_2fail(self, msg): self.fail("Identity did not verify with hashed password") | 472c8259b25bb01d85ebb65b1fd9d23a3856f6f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/472c8259b25bb01d85ebb65b1fd9d23a3856f6f8/test_cred.py |
log.msg('Removing stale pidfile %s' % pidfile) | log.msg('Removing stale pidfile %s' % pidfile, isError=True) | def checkPID(pidfile): if os.path.exists(pidfile): try: pid = int(open(pidfile).read()) except ValueError: sys.exit('Pidfile %s contains non-numeric value' % pidfile) try: os.kill(pid, 0) except OSError, why: if why[0] == errno.ESRCH: # The pid doesnt exists. log.msg('Removing stale pidfile %s' % pidfile) os.remove(pid... | 18fb49d213ae3ef1708827a123a1a8aa2ae00010 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/18fb49d213ae3ef1708827a123a1a8aa2ae00010/twistd.py |
checkPID(config['pidfile']) | def runApp(config): passphrase = app.getPassphrase(config['encrypted']) app.installReactor(config['reactor']) config['nodaemon'] = config['nodaemon'] or config['debug'] oldstdout = sys.stdout oldstderr = sys.stderr startLogging(config['logfile'], config['syslog'], config['prefix'], config['nodaemon']) app.initialLog() ... | 18fb49d213ae3ef1708827a123a1a8aa2ae00010 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/18fb49d213ae3ef1708827a123a1a8aa2ae00010/twistd.py | |
"""Return value for form inpurt.""" | """Return value for form input.""" | def getValue(request, argument): """Return value for form inpurt.""" values = request.args.get(argument.name, None) if values: try: return argument.coerce(values[0]) except formmethod.InputError: return values[0] return argument.default | 4fcf3974af001e6becd57d1555de5170b6788478 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4fcf3974af001e6becd57d1555de5170b6788478/form.py |
"""Return values for form inpurt.""" | """Return values for form input.""" | def getValues(request, argument): """Return values for form inpurt.""" values = request.args.get(argument.name, None) if values: try: return argument.coerce(values) except formmethod.InputError: return values return argument.default | 4fcf3974af001e6becd57d1555de5170b6788478 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4fcf3974af001e6becd57d1555de5170b6788478/form.py |
for tag, value, desc in arg.choices: | for tag, value, desc in arg.flags: | def input_checkgroup(self, request, content, arg): s = content.div() defaults = getValues(request, arg) for tag, value, desc in arg.choices: if value in defaults: kw = {'checked' : '1'} else: kw = {} s.input(type="checkbox", name=arg.name, value=tag, **kw).text(desc) return s | 4fcf3974af001e6becd57d1555de5170b6788478 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4fcf3974af001e6becd57d1555de5170b6788478/form.py |
log.msg('other side refused open\nreason: %s'%(self.id, reason)) | log.msg('other side refused open\nreason: %s'% reason) | def openFailed(self, reason): """ Called when the the open failed for some reason. reason.desc is a string descrption, reason.code the the SSH error code. | 1426fb66e412215ba63560e86e33cafe653c2fce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1426fb66e412215ba63560e86e33cafe653c2fce/channel.py |
factory.protocol = wire.Echo | factory.protocol = TestEcho TestEcho.d = defer.Deferred() | def testUNIX(self): if not interfaces.IReactorUNIX(reactor, None): raise unittest.SkipTest, "This reactor does not support UNIX domain sockets" s = service.MultiService() c = compat.IOldApplication(s) factory = protocol.ServerFactory() factory.protocol = wire.Echo if os.path.exists('.hello.skt'): os.remove('hello.skt')... | b86e8c7c349c1e1400ab6677573d4fe8211cdc60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b86e8c7c349c1e1400ab6677573d4fe8211cdc60/test_application.py |
s.stopService() | util.wait(defer.maybeDeferred(s.stopService)) | def lineReceived(self, line): self.factory.line = line | b86e8c7c349c1e1400ab6677573d4fe8211cdc60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b86e8c7c349c1e1400ab6677573d4fe8211cdc60/test_application.py |
factory.protocol = wire.Echo | factory.protocol = TestEcho TestEcho.d = defer.Deferred() | def testTCP(self): s = service.MultiService() c = compat.IOldApplication(s) factory = protocol.ServerFactory() factory.protocol = wire.Echo c.listenTCP(0, factory) s.privilegedStartService() s.startService() num = list(s)[0]._port.getHost().port class Foo(basic.LineReceiver): def connectionMade(self): self.transport.wr... | b86e8c7c349c1e1400ab6677573d4fe8211cdc60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b86e8c7c349c1e1400ab6677573d4fe8211cdc60/test_application.py |
s.stopService() | util.wait(defer.maybeDeferred(s.stopService)) | def lineReceived(self, line): self.factory.line = line | b86e8c7c349c1e1400ab6677573d4fe8211cdc60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b86e8c7c349c1e1400ab6677573d4fe8211cdc60/test_application.py |
entry.insert_text(result[0]) entry.set_position(oldpos+len(result[0])-len(word)) | entry.insert_defaults(result[0]) entry.set_position(oldpos+len(result[0])-len(word)-1) | def handle_key_press_event(self, entry, event): stopSignal = False # ASSUMPTION: Assume Meta == mod4 isMeta = event.state & gtk.GDK.MOD4_MASK | 0dc25992cdefab87edcce15bd9503c72f6a32636 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0dc25992cdefab87edcce15bd9503c72f6a32636/gtkcommon.py |
except Exception, (e,): log.err() | except Exception, e: log.err(e) | def lineReceived(self, line): "Process the input from the client" self.resetTimeout() line = string.strip(line) log.debug(repr(line)) line = self.reTelnetChars.sub('', line) # clean up '\xff\xf4\xff' nonsense line = line.encode() try: cmdAndArgs = line.split(' ',1) log.debug('processing command %s' % cmdAndArgs) self.... | 7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25/ftp.py |
if self.fp is not None: | if self.fp is not None and not self.fp.closed: | def finishedFileTransfer(self, *arg): """called back when a file transfer has been completed by the dtp""" log.debug('finishedFileTransfer! cleaning up DTP') if self.fp is not None: if self.fp.tell() == self.fpsize: log.debug('transfer completed okay :-)') self.reply(TXFR_COMPLETE_OK) else: log.debug("uh-oh there was a... | 7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25/ftp.py |
if self.tld is not None: self.filepath = python.FilePath(self.tld) | def __init__(self, user=None, tld=None): """Constructor @param user: the name of the user whose permissions we'll be using @type user: string """ self.user = user # user name self.tld = tld self.debug = True | 7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25/ftp.py | |
except OSError, (e,): | except (IOError, OSError), (e,): | def retr(self, path): import os.path as osp cpath, spath = self.mapCPathToSPath(path) if not osp.isfile(spath): raise FileNotFoundError(cpath) try: return (file(spath, 'rb'), os.path.getsize(spath)) except OSError, (e,): log.debug(e) raise OperationFailedError('') | 7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25/ftp.py |
raise OperationFailedError('') | raise OperationFailedError('An OSError occurred %s' % e) | def retr(self, path): import os.path as osp cpath, spath = self.mapCPathToSPath(path) if not osp.isfile(spath): raise FileNotFoundError(cpath) try: return (file(spath, 'rb'), os.path.getsize(spath)) except OSError, (e,): log.debug(e) raise OperationFailedError('') | 7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7b8a0471b5d50b1a6fc33c27b11cb2d62070dd25/ftp.py |
def resetMode(self, moeds): | def resetMode(self, modes): | def resetMode(self, moeds): pass | 6a5890536deb7c50bbf65a5cb28890b9dd9fadef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6a5890536deb7c50bbf65a5cb28890b9dd9fadef/insults.py |
@param inedx: The number of the message for which to retrieve the size, | @param index: The number of the message for which to retrieve the size, | def listMessages(self, index=None): """Retrieve the size of one or more messages. @type index: C{int} or C{None} @param inedx: The number of the message for which to retrieve the size, or None to retrieve the size of all messages. @rtype: C{int} or any iterable of C{int} @return: The number of octets in the specified... | 2e0b201297100e160f657ff2c484cefb03887c22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2e0b201297100e160f657ff2c484cefb03887c22/pop3.py |
for url in ['/foo/', '/foo/bar', '/foo/bar/baz', 'foo/bar/']: | for url in ['/foo/', '/foo/bar', '/foo/bar/baz', '/foo/bar/']: | def testSimple(self): for url in ['/foo/', '/foo/bar', '/foo/bar/baz', 'foo/bar/']: request = server.Request(self.d, 1) request.setHost('example.com', 81) request.gotLength(0) request.requestReceived('GET', '/foo/bar/baz', 'HTTP/1.0') self.assertEqual(request.getRootURL(), "http://example.com/foo") | aaacc16cbda69568f488bbfd7f8f981d21fb3d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/aaacc16cbda69568f488bbfd7f8f981d21fb3d4a/test_web.py |
request.requestReceived('GET', '/foo/bar/baz', 'HTTP/1.0') | request.requestReceived('GET', url, 'HTTP/1.0') | def testSimple(self): for url in ['/foo/', '/foo/bar', '/foo/bar/baz', 'foo/bar/']: request = server.Request(self.d, 1) request.setHost('example.com', 81) request.gotLength(0) request.requestReceived('GET', '/foo/bar/baz', 'HTTP/1.0') self.assertEqual(request.getRootURL(), "http://example.com/foo") | aaacc16cbda69568f488bbfd7f8f981d21fb3d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/aaacc16cbda69568f488bbfd7f8f981d21fb3d4a/test_web.py |
return self.name.lower() == other.name.lower() | return str(self.name).lower() == str(other.name).lower() | def __eq__(self, other): if isinstance(other, SimpleRecord): return self.name.lower() == other.name.lower() return 0 | 8c5744280915832cf4f388aaad8f3e6e46f23b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8c5744280915832cf4f388aaad8f3e6e46f23b1f/dns.py |
log.msg(repr(ord(packet[0]))) log.msg(repr(hasattr(self, 'first'))) log.msg(repr(len(self.buf))) | def dataReceived(self, data): self.buf = self.buf+data if not self.gotVersion: parts = self.buf.split('\n') for p in parts: if p[: 4] == 'SSH-': self.gotVersion = 1 self.otherVersionString = p.strip() if p.split('-')[1]not in('1.99', '2.0'): # bad version self.sendDisconnect(DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED, '... | 181b3107822517e7a93072b4c84b501aaa8b23d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/181b3107822517e7a93072b4c84b501aaa8b23d8/transport.py | |
x = StringIO.StringIO() | x = cStringIO.StringIO() | def listUsers(self, req): import pwd x = StringIO.StringIO() x.write('<UL>\n') for user in pwd.getpwall(): pw_name, pw_passwd, pw_uid, pw_gid, pw_gecos, pw_dir, pw_shell \ = user realname = string.split(pw_gecos,',')[0] if not realname: realname = pw_name fmtStr = '<LI><A HREF="%s/">%s (%s)</a>\n' if os.path.exists(os.... | 25f350c06d74b06711f4789870b82e05a87d160d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/25f350c06d74b06711f4789870b82e05a87d160d/distrib.py |
compiler.compile(["conftest.c"]) | compiler.compile(["conftest.c"], output_dir='') | def _check_header(self, header_name): """ Check if the given header can be included by trying to compile a file that contains only an #include line. """ compiler = new_compiler() compiler.announce("checking for %s ..." % header_name, 0) | 0fe3a617b8d91b90597011f64b3ecf2ea360a445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0fe3a617b8d91b90597011f64b3ecf2ea360a445/setup.py |
gtk.GtkWindow(self, gtk.WINDOW_TOPLEVEL) | gtk.GtkWindow.__init__(self, gtk.WINDOW_TOPLEVEL) | def __init__(self): gtk.GtkWindow(self, gtk.WINDOW_TOPLEVEL) | 8e7b87beeb228de943cad5be38398f41e0c23afa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8e7b87beeb228de943cad5be38398f41e0c23afa/gtkmanhole.py |
def __init__(self): gtk.GtkWindow(self, gtk.WINDOW_TOPLEVEL) | 8e7b87beeb228de943cad5be38398f41e0c23afa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8e7b87beeb228de943cad5be38398f41e0c23afa/gtkmanhole.py | ||
def __call__(self, adaptable, default=_Nothing, persist=None, registry=None): if registry != None: raise RuntimeError, "registry argument will be ignored" if persist != None: warnings.warn("persist argument is deprecated", DeprecationWarning) if default == _Nothing: default = self.marker return interface.InterfaceClas... | def __call__(): def __call__(self, adaptable, default=_Nothing, persist=None, registry=None): if registry != None: raise RuntimeError, "registry argument will be ignored" if persist != None: warnings.warn("persist argument is deprecated", DeprecationWarning) if default == _Nothing: default = self.marker if hasattr(a... | def __call__(self, adaptable, default=_Nothing, persist=None, registry=None): if registry != None: raise RuntimeError, "registry argument will be ignored" # possibly should be removed for efficiency reasons if persist != None: warnings.warn("persist argument is deprecated", DeprecationWarning) if default == _Nothing: d... | fc31519b56de0374f282c8226301e959936e93b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc31519b56de0374f282c8226301e959936e93b6/components.py |
registry.register([self], [to], '', using) | registry.registerAdapter(using, self, to) | def adaptWith(self, using, to, registry=None): if registry != None: raise RuntimeError, "registry argument will be ignored" warnings.warn("persist argument is deprecated", DeprecationWarning) registry = theAdapterRegistry registry.register([self], [to], '', using) | fc31519b56de0374f282c8226301e959936e93b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc31519b56de0374f282c8226301e959936e93b6/components.py |
self.register([origInterface], interfaceClasses, '', adapterFactory) | def registerAdapter(self, adapterFactory, origInterface, *interfaceClasses): """Register an adapter class. | fc31519b56de0374f282c8226301e959936e93b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc31519b56de0374f282c8226301e959936e93b6/components.py | |
return self.adapterRegistry.get((fromInterface, toInterface), default) | raise NotImplementedError | def getAdapterFactory(self, fromInterface, toInterface, default): """Return registered adapter for a given class and interface. """ return self.adapterRegistry.get((fromInterface, toInterface), default) | fc31519b56de0374f282c8226301e959936e93b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc31519b56de0374f282c8226301e959936e93b6/components.py |
if implements(obj, interfaceClass): return obj if persist != False: pkey = (id(obj), interfaceClass) if self.adapterPersistence.has_key(pkey): return self.adapterPersistence[pkey] if hasattr(obj, '__class__'): klas = obj.__class__ else: klas = type(obj) for fromInterface in classToInterfaces(klas): adapterFactory = (... | def getAdapter(self, obj, interfaceClass, default=_Nothing, adapterClassLocator=None, persist=None): """Return an object that implements the given interface. | fc31519b56de0374f282c8226301e959936e93b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fc31519b56de0374f282c8226301e959936e93b6/components.py | |
def __getattr__(self, name): return getattr(self.object, name) | 81d8e07860159aafe57753b5b47a5e7ac7768e58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/81d8e07860159aafe57753b5b47a5e7ac7768e58/ftp.py | ||
def matcher(element, classes=classes): | def matcher(element, self=self): | def matcher(element, classes=classes): if element.tagName != 'code': return 0 if not element.hasAttribute('class'): return 0 if element.getAttribute('class') in classes: return 0 return 1 | a316feafc21f5ad476880b87db8be2c26be76741 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a316feafc21f5ad476880b87db8be2c26be76741/lint.py |
if element.getAttribute('class') in classes: | if self.allowedCodeClasses(element.getAttribute('class')): | def matcher(element, classes=classes): if element.tagName != 'code': return 0 if not element.hasAttribute('class'): return 0 if element.getAttribute('class') in classes: return 0 return 1 | a316feafc21f5ad476880b87db8be2c26be76741 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a316feafc21f5ad476880b87db8be2c26be76741/lint.py |
if failure.check(IOError): | if failure.check(IOError, OSError): | def msg(err): if what is not None: log.msg("%s while %s" % (err, what)) | a7ccc100326c948d7e092ad1938dfec2ed9cdd7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a7ccc100326c948d7e092ad1938dfec2ed9cdd7b/http.py |
if e == errno.EACCES: | if e == errno.EACCES or e == errno.EPERM: | def msg(err): if what is not None: log.msg("%s while %s" % (err, what)) | a7ccc100326c948d7e092ad1938dfec2ed9cdd7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a7ccc100326c948d7e092ad1938dfec2ed9cdd7b/http.py |
return RSA.construct(decodedKey[1: 6]) | n,e,d,p,q=decodedKey[1:6] return RSA.construct((n,e,d,p,q)) | def getPrivateKeyObject_openssh(data, passphrase): kind = data[0][11: 14] if data[1].startswith('Proc-Type: 4,ENCRYPTED'): # encrypted key ivdata = data[2].split(',')[1][:-1] iv = ''.join([chr(int(ivdata[i:i+2],16)) for i in range(0, len(ivdata), 2)]) if not passphrase: raise BadKeyError, 'encrypted key with no passphr... | 3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1/keys.py |
['p', common.MP(obj.p)[4:]], ['q', common.MP(obj.q)[4:]], ['a', common.MP(obj.d%(obj.p-1))[4:]], ['b', common.MP(obj.d%(obj.q-1))[4:]], ['c', common.MP(Util.number.inverse(obj.q, obj.p))[4:]]]]]) | ['p', common.MP(q)[4:]], ['q', common.MP(p)[4:]], ['a', common.MP(obj.d%(q-1))[4:]], ['b', common.MP(obj.d%(p-1))[4:]], ['c', common.MP(Util.number.inverse(p, q))[4:]]]]]) | def makePrivateKeyString_lsh(obj, passphrase): #assert not passphrase keyType = objectType(obj) if keyType == 'ssh-rsa': return sexpy.pack([['private-key', ['rsa-pkcs1', ['n', common.MP(obj.n)[4:]], ['e', common.MP(obj.e)[4:]], ['d', common.MP(obj.d)[4:]], ['p', common.MP(obj.p)[4:]], ['q', common.MP(obj.q)[4:]], ['a',... | 3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1/keys.py |
objData = [0, obj.n, obj.e, obj.d, obj.p, obj.q, obj.d%(obj.p-1), obj.d%(obj.q-1),Util.number.inverse(obj.q, obj.p)] | p,q=obj.p,obj.q if p > q: (p,q) = (q,p) objData = [0, obj.n, obj.e, obj.d, q, p, obj.d%(q-1), obj.d%(p-1),Util.number.inverse(p, q)] | def makePrivateKeyString_openssh(obj, passphrase): keyType = objectType(obj) if keyType == 'ssh-rsa': keyData = '-----BEGIN RSA PRIVATE KEY-----\n' objData = [0, obj.n, obj.e, obj.d, obj.p, obj.q, obj.d%(obj.p-1), obj.d%(obj.q-1),Util.number.inverse(obj.q, obj.p)] elif keyType == 'ssh-dss': keyData = '-----BEGIN DSA PR... | 3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1/keys.py |
return keyData | return keyData def makePrivateKeyBlob(obj): keyType = objectType(obj) if keyType == 'ssh-rsa': return common.NS(keyType) + common.MP(obj.n) + common.MP(obj.e) + \ common.MP(obj.d) + common.MP(obj.u) + common.MP(obj.q) + \ common.MP(obj.p) elif keyType == 'ssh-dss': return common.NS(keyType) + common.MP(obj.p) + common... | def makePrivateKeyString_openssh(obj, passphrase): keyType = objectType(obj) if keyType == 'ssh-rsa': keyData = '-----BEGIN RSA PRIVATE KEY-----\n' objData = [0, obj.n, obj.e, obj.d, obj.p, obj.q, obj.d%(obj.p-1), obj.d%(obj.q-1),Util.number.inverse(obj.q, obj.p)] elif keyType == 'ssh-dss': keyData = '-----BEGIN DSA PR... | 3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3cf1ed6058067c1597ae54cb3a1cd95725a1e8d1/keys.py |
view = widgets.Widget(self.model) | view = widgets.Widget(model) | def getSubview(self, request, node, model, viewName): """Get a sub-view from me. """ view = None vm = getattr(self, 'wvfactory_' + viewName, None) if vm is None: vm = getattr(self, 'factory_' + viewName, None) if vm is not None: warnings.warn("factory_ methods are deprecated; please use " "wvfactory_ instead", Deprecat... | 60f7d4e70244a6f7b2d620f54a3f31001c0c3faa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60f7d4e70244a6f7b2d620f54a3f31001c0c3faa/view.py |
ret.append(msg + '\n') | ret.append(str(msg) + '\n') | def formatError(tm): # would need another adapter for tbformat='emacs' ret = [DOUBLE_SEPARATOR, '%s: %s (%s)\n' % (WORDS[tm.status], tm.name, itrial.IFQClassName(tm.klass))] for msg in tm.skip, itrial.ITodo(tm.todo).msg: if msg is not None: ret.append(msg + '\n') if tm.status not in (SUCCESS, SKIP, UNEXPECTED_SUCCESS... | 454202d62f06e55b7d6da2ad8bab2a09958856a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/454202d62f06e55b7d6da2ad8bab2a09958856a8/adapters.py |
of the arguments the semantics. | of the semantics of the arguments. | def service(description, factory): """Return the service corresponding to a description @type description: C{str} @type factory: C{twisted.internet.interfaces.IProtocolFactory} @rtype: C{twisted.application.service.IService} @return: the service corresponding to a description of a reliable virtual circuit server. See... | 186a5ff362cb6cbfffd7295fbf3313e6541c872f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/186a5ff362cb6cbfffd7295fbf3313e6541c872f/ports.py |
of the arguments the semantics. | of the semantics of the arguments. | def listen(description, factory): """Listen on a port corresponding to a description @type description: C{str} @type factory: C{twisted.internet.interfaces.IProtocolFactory} @rtype: C{twisted.internet.interfaces.IListeningPort} @return: the port corresponding to a description of a reliable virtual circuit server. See... | 186a5ff362cb6cbfffd7295fbf3313e6541c872f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/186a5ff362cb6cbfffd7295fbf3313e6541c872f/ports.py |
del self.proc | def connectionLost(self, reason): """I close my process's stderr. """ abstract.FileDescriptor.connectionLost(self, reason) os.close(self.proc.stderr) self.proc.errConnectionLost() del self.proc | 2ece81b335005f8b6a5f96b848531357fd18aeb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2ece81b335005f8b6a5f96b848531357fd18aeb5/process.py | |
self.err.stopReading() self.err.connectionLost(None) | self.err.stopReading() self.err.connectionLost(None) | def closeStderr(self): """Close stderr.""" if hasattr(self, "err"): self.err.stopReading() self.err.connectionLost(None) | 2ece81b335005f8b6a5f96b848531357fd18aeb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2ece81b335005f8b6a5f96b848531357fd18aeb5/process.py |
abstract.FileDescriptor.loseConnection(self) | self.stopReading() self.connectionLost(None) | def closeStdout(self): """Close stdout.""" if not self.lostOutConnection: abstract.FileDescriptor.loseConnection(self) | 2ece81b335005f8b6a5f96b848531357fd18aeb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2ece81b335005f8b6a5f96b848531357fd18aeb5/process.py |
cp.deferred.addCallback(lambda ign: cp.startTLS()) cp.deferred.addCallback(lambda ign: cp.quit()) def asserts(ign): | def cbConnected(ignored): log.msg("Connected to server; starting TLS") return cp.startTLS() def cbStartedTLS(ignored): log.msg("Started TLS; disconnecting") return cp.quit() def cbDisconnected(ign): log.msg("Disconnected; asserting correct input received") | def testStartTLS(self): sf = TLSServerFactory() sf.protocol.output = [ ['+OK'], # Server greeting ['+OK', 'STLS', '.'], # CAPA response ['+OK'], # STLS response ['+OK', '.'], # Second CAPA response ['+OK'] # QUIT response ] sf.protocol.context = ServerTLSContext() port = reactor.listenTCP(0, sf) | 8f124eb9550a3abf05295229996377fba364ae50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8f124eb9550a3abf05295229996377fba364ae50/test_pop3client.py |
cp.deferred.addCallback(asserts) | def asserts(ign): self.assertEquals( sf.input, ['CAPA', 'STLS', 'CAPA', 'QUIT']) | 8f124eb9550a3abf05295229996377fba364ae50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8f124eb9550a3abf05295229996377fba364ae50/test_pop3client.py | |
return defer.maybeDeferred(port.stopListening).addCallback(lambda ign: result) | def cbShutdown(ignored): log.msg("Shut down server") return result return defer.maybeDeferred(port.stopListening).addCallback(cbShutdown) cp.deferred.addCallback(cbConnected) cp.deferred.addCallback(cbStartedTLS) cp.deferred.addCallback(cbDisconnected) | def cleanup(result): conn.disconnect() return defer.maybeDeferred(port.stopListening).addCallback(lambda ign: result) | 8f124eb9550a3abf05295229996377fba364ae50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8f124eb9550a3abf05295229996377fba364ae50/test_pop3client.py |
if seenNames.has_key(tmlname): debugInspection('Seen %s already' % tmlname) continue seenNames[tmlname] = 1 if exists(tmlname): result.append(tmlname) debugInspection('Found ' + tmlname) | if isAModule(join((d,plugindir))): seenNames[plugindir] = 1 if exists(tmlname): result.append(tmlname) debugInspection('Found ' + tmlname) else: debugInspection('Failed ' + tmlname) | 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. ... | cf37cab2907c62030461b721de0c2aaaa2eb26fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cf37cab2907c62030461b721de0c2aaaa2eb26fb/plugin.py |
debugInspection('Failed ' + tmlname) | debugInspection('Not a module ' + tmlname) | 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. ... | cf37cab2907c62030461b721de0c2aaaa2eb26fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cf37cab2907c62030461b721de0c2aaaa2eb26fb/plugin.py |
log.msg(str(process.reapProcessHandlers.keys())) | def processEnded(self, reason): log.msg("MAD(ssh): connection lost") log.msg(str(process.reapProcessHandlers.keys())) unittest._inst.assertEquals(reason.value.exitCode, 0, 'exit code was not 0: %s' % reason.value.exitCode) self.buf = self.buf.replace('\r\n', '\n') unittest._inst.assertEquals(self.buf, 'goodbye\n') # g... | 9a529e58a0b0a2b196f2506d4d3e5df04c320d41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9a529e58a0b0a2b196f2506d4d3e5df04c320d41/test_conch.py | |
server = Server() | def testShutdownFromDatagramReceived(self): | 9599c601494a7dec157f36e72101974f6ec29a22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9599c601494a7dec157f36e72101974f6ec29a22/test_udp.py | |
p = reactor.listenUDP(0, server, interface='127.0.0.1') pr = server.packetReceived = defer.Deferred() | pr = self.server.packetReceived = defer.Deferred() | def testShutdownFromDatagramReceived(self): | 9599c601494a7dec157f36e72101974f6ec29a22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9599c601494a7dec157f36e72101974f6ec29a22/test_udp.py |
server.transport.connectionLost() | self.server.transport.connectionLost() | def pktRece(ignored): # Simulate reactor.stop() behavior :( server.transport.connectionLost() # Then delay this Deferred chain until the protocol has been # disconnected, as the reactor should do in an error condition # such as we are inducing. This is very much a whitebox test. reactor.callLater(0, finished.callback,... | 9599c601494a7dec157f36e72101974f6ec29a22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9599c601494a7dec157f36e72101974f6ec29a22/test_udp.py |
server.transport.write('\0' * 64, ('127.0.0.1', server.transport.getHost().port)) | self.server.transport.write('\0' * 64, ('127.0.0.1', self.server.transport.getHost().port)) | def flushErrors(ignored): # We are breaking abstraction and calling private APIs, any # number of horrible errors might occur. As long as the reactor # doesn't hang, this test is satisfied. (There may be room for # another, stricter test.) log.flushErrors() | 9599c601494a7dec157f36e72101974f6ec29a22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9599c601494a7dec157f36e72101974f6ec29a22/test_udp.py |
return "Directory listing for %s" % request.uri | return "Directory listing for %s" % urllib.unquote(request.uri) | def wmfactory_header(self, request): return "Directory listing for %s" % request.uri | 5f486b2f580aea57686744c882b43b0f4585646a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5f486b2f580aea57686744c882b43b0f4585646a/dirlist.py |
def getNodeController(self, request, node, model): | def getNodeModel(self, submodel): if submodel: modelGetter = DefaultWidget(self.model) modelGetter.setSubmodel(submodel) model = modelGetter.getData() else: model = None return model def getNodeController(self, request, node, submodel): | def getNodeController(self, request, node, model): controllerName = node.getAttribute('controller') # Look up an InputHandler controllerFactory = DefaultHandler if controllerName: namespaces = [self.controller] for namespace in namespaces: controllerFactory = getattr(namespace, 'factory_' + controllerName, None) if co... | 3e9326c02c350f24d9edb01a21197fc0767d9e49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e9326c02c350f24d9edb01a21197fc0767d9e49/view.py |
def getNodeView(self, request, node, model): | def getNodeView(self, request, node, submodel): | def getNodeView(self, request, node, model): view = None viewName = node.getAttribute('view') | 3e9326c02c350f24d9edb01a21197fc0767d9e49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e9326c02c350f24d9edb01a21197fc0767d9e49/view.py |
if submodel: modelGetter = DefaultWidget(self.model) modelGetter.setSubmodel(submodel) model = modelGetter.getData() else: model = None controller = self.getNodeController(request, node, model) result = self.getNodeView(request, node, model) | controller = self.getNodeController(request, node, submodel) result = self.getNodeView(request, node, submodel) | def handleNode(self, request, node): if not hasattr(node, 'getAttribute'): # text node? return node id = node.getAttribute('model') submodel_prefix = node.getAttribute("_submodel_prefix") if submodel_prefix and id: submodel = "/".join([submodel_prefix, id]) elif id: submodel = id elif submodel_prefix: submodel = submo... | 3e9326c02c350f24d9edb01a21197fc0767d9e49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3e9326c02c350f24d9edb01a21197fc0767d9e49/view.py |
d = None | # def stopListening(self, s): | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
if self.debug: log.msg('got a DTP connection %s:%s' % (peer[1],peer[2])) if self.debug: log.msg("DTP ip matches PI ip? %s" % str(peer[1] == self.factory.pi.peerHost[1])) | log.debug('got a DTP connection %s:%s' % (peer[1],peer[2])) | def connectionMade(self): """Will start an transfer, if one is queued up, when the client connects""" peer = self.transport.getPeer() if self.debug: log.msg('got a DTP connection %s:%s' % (peer[1],peer[2])) # make sure someone isn't doing something sneaky if self.debug: log.msg("DTP ip matches PI ip? %s" % str(peer[1] ... | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
self.factory._unblock() | d, self.factory.deferred = self.factory.deferred, defer.Deferred() log.debug('firing dtpFactory deferred') d.callback(None) | def connectionMade(self): """Will start an transfer, if one is queued up, when the client connects""" peer = self.transport.getPeer() if self.debug: log.msg('got a DTP connection %s:%s' % (peer[1],peer[2])) # make sure someone isn't doing something sneaky if self.debug: log.msg("DTP ip matches PI ip? %s" % str(peer[1] ... | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: print "running self.transport.loseConnection()" self.cleanup() def sendFile(self, fp): '''queues up a file object for sending out over the wire''' | self.factory.stopFactory() def dtp_RETR(self, fp): '''ssnds a file object out the wire''' | def connectionLost(self, reason): log.msg('lost DTP connection %s, oh well!' % reason) # makes sure connection is closed and factory shuts down # when client disconnects if self.debug: print "running self.transport.loseConnection()" self.cleanup() | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('sendfile sending %s' % filename) | log.debug('sendfile sending %s' % filename) | def sendFile(self, fp): '''queues up a file object for sending out over the wire''' filename = _getFPName(fp) self.fp = fp | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
class ActvDTPFactory(protocol.ClientFactory): pass | def sendFile(self, fp): '''queues up a file object for sending out over the wire''' filename = _getFPName(fp) self.fp = fp | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
debug = True | def sendFile(self, fp): '''queues up a file object for sending out over the wire''' filename = _getFPName(fp) self.fp = fp | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
dtpPort = None | def sendFile(self, fp): '''queues up a file object for sending out over the wire''' filename = _getFPName(fp) self.fp = fp | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
blocked = [] deferred = defer.Deferred() | deferred = defer.Deferred() | def sendFile(self, fp): '''queues up a file object for sending out over the wire''' filename = _getFPName(fp) self.fp = fp | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('PasvDTPFactory.buildProtocol') if self.instance: | if self.instance: | def buildProtocol(self, addr): if self.debug: log.msg('PasvDTPFactory.buildProtocol') if self.instance: return p = protocol.ServerFactory.buildProtocol(self, addr) # like in __init__ of a base-class p.factory = self p.debug = self.debug p.pi = self.pi self.instance = p return p | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
p.debug = self.debug | def buildProtocol(self, addr): if self.debug: log.msg('PasvDTPFactory.buildProtocol') if self.instance: return p = protocol.ServerFactory.buildProtocol(self, addr) # like in __init__ of a base-class p.factory = self p.debug = self.debug p.pi = self.pi self.instance = p return p | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
self.instance = p | self.pi.dtpInstance = p | def buildProtocol(self, addr): if self.debug: log.msg('PasvDTPFactory.buildProtocol') if self.instance: return p = protocol.ServerFactory.buildProtocol(self, addr) # like in __init__ of a base-class p.factory = self p.debug = self.debug p.pi = self.pi self.instance = p return p | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
def doCommand(self, command, *args): if self.blocked is not None: if self.debug: log.msg('dtp blocking (command=%s, args=%s)'% (command, args)) self.blocked.append((command, args)) return if self.debug: log.msg('dtp running (command=%s, args=%s)'% (command, args)) f = getattr(self.instance, command, None) if f: d = d... | def doCommand(self, command, *args): if self.blocked is not None: if self.debug: log.msg('dtp blocking (command=%s, args=%s)'% (command, args)) self.blocked.append((command, args)) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
if self.dtpPort.connected: if self.debug: log.msg('self.dtpPort.loseConnection()') self.dtpPort.loseConnection() | def stopFactory(self): if self.dtpPort.connected: if self.debug: log.msg('self.dtpPort.loseConnection()') self.dtpPort.loseConnection() | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
blocked = None deferred = None if MODULE_DEBUG: debug = True ANNOYINGLY_VERBOSE = True TESTING = False DEBUG_AUTO_ANON_LOGIN = True HUMAN_READABLE_PASV_PORT = True else: debug, ANNOYINGLY_VERBOSE, TESTING, DEBUG_AUTO_ANON_LOGIN, HUMAN_READABLE_PASV_PORT = (False,False,False,False,False) | blocked = None | def cleanPath(params): # cleanup backslashes and multiple foreslashes if params: params = re.sub(r'[\\]{2,}?', '/', params) params = re.sub(r'[/]{2,}?','/', params) return params | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('ftp-pi connectionMade') | log.debug('ftp-pi connectionMade') | def connectionMade(self): if self.debug: log.msg('ftp-pi connectionMade') self.reply(WELCOME_MSG) self.peerHost = self.transport.getPeer() if self.debug and self.DEBUG_AUTO_ANON_LOGIN: lr = self.lineReceived lr('USER anonymous') lr('PASS f@d.com') lr('PASV') lr('LIST') lr('RETR .vim/vimrc') | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug and self.DEBUG_AUTO_ANON_LOGIN: lr = self.lineReceived lr('USER anonymous') lr('PASS f@d.com') lr('PASV') lr('LIST') lr('RETR .vim/vimrc') | self.__testingautologin() def __testingautologin(self): import warnings; warnings.warn(''' --> DEBUGGING CODE ACTIVE!!! <-- ''') lr = self.lineReceived lr('USER anonymous') lr('PASS f@d.com') lr('PASV') lr('LIST') lr('RETR .vim/vimrc') lr('RETR Session.vim') | def connectionMade(self): if self.debug: log.msg('ftp-pi connectionMade') self.reply(WELCOME_MSG) self.peerHost = self.transport.getPeer() if self.debug and self.DEBUG_AUTO_ANON_LOGIN: lr = self.lineReceived lr('USER anonymous') lr('PASS f@d.com') lr('PASV') lr('LIST') lr('RETR .vim/vimrc') | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg(repr(line)) | log.debug(repr(line)) | def lineReceived(self, line): "Process the input from the client" line = string.strip(line) if self.debug: log.msg(repr(line)) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
log.err() | log.err(e) | def lineReceived(self, line): "Process the input from the client" line = string.strip(line) if self.debug: log.msg(repr(line)) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
log.err() | log.err(e) | def lineReceived(self, line): "Process the input from the client" line = string.strip(line) if self.debug: log.msg(repr(line)) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
def processCommand(self, command, *args): | def processCommand(self, cmd, *args): | def processCommand(self, command, *args): if self.blocked != None: self.blocked.append((method,args)) return | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.