rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
self.blocked.append((method,args)) | log.debug('FTP is queueing command: %s' % cmd) self.blocked.append((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 |
command = command.upper() method = getattr(self, "ftp_%s" % command) | cmd = cmd.upper() if cmd not in ['USER','PASS'] and not self.shell: log.debug('ftp_%s returning, user not logged in' % cmd) self.reply(NOT_LOGGED_IN) return if cmd in ['RETR', 'STOR', 'LIST', 'PORT']: if not self.dtpInstance: assert self.blocked == None self.blocked = [(cmd,args)] log.debug('during dtp setup, blocke... | 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 |
return FTPError("command not implemented") | log.debug("SOMETHING IS SCREWY") def _unblock(self, *_): log.debug('_unblock running') commands = self.blocked self.blocked = None while commands and self.blocked is None: cmd, args = commands.pop(0) self.processCommand(cmd, *args) if self.blocked is not None: self.blocked.extend(commands) def _ebDtpInstance(self, _... | 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 |
if self.debug: log.msg(RESPONSE[key] % s + ENDLN) | log.debug(RESPONSE[key] % s + ENDLN) | def reply(self, key, s = ''): if string.find(RESPONSE[key], '%s') > -1: if self.debug: log.msg(RESPONSE[key] % s + ENDLN) self.transport.write(RESPONSE[key] % s + ENDLN) else: if self.debug: log.msg(RESPONSE[key] + ENDLN) self.transport.write(RESPONSE[key] + ENDLN) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg(RESPONSE[key] + ENDLN) | log.debug(RESPONSE[key] + ENDLN) | def reply(self, key, s = ''): if string.find(RESPONSE[key], '%s') > -1: if self.debug: log.msg(RESPONSE[key] % s + ENDLN) self.transport.write(RESPONSE[key] % s + ENDLN) else: if self.debug: log.msg(RESPONSE[key] + ENDLN) self.transport.write(RESPONSE[key] + ENDLN) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('_createActiveDTP') | log.debug('_createActiveDTP') | def _createActiveDTP(self): if self.debug: log.msg('_createActiveDTP') raise NotImplementedError() | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
"""creates a dtp listening on self.dtpFactory.dtpPort for connections""" if self.debug: log.msg('_createPassiveDTP') | """sets up a DTPFactory listening on an ephemeral port port is stored in self.dtpPort @returns a deferred that will be fired when a connection is made """ log.debug('_createPassiveDTP') | def _createPassiveDTP(self): """creates a dtp listening on self.dtpFactory.dtpPort for connections""" if self.debug: log.msg('_createPassiveDTP') # TODO: figure out what happens if there's an existing ACTV # DTP connection and the client calls PASV self.dtpTxfrMode = PASV # ensure state is correct if not self... | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if not self.HUMAN_READABLE_PASV_PORT: port = 0 else: port = 2122 self.dtpFactory.dtpPort = reactor.listenTCP(port, self.dtpFactory) | self.dtpPort = reactor.listenTCP(0, self.dtpFactory) return self.dtpFactory.deferred | def _createPassiveDTP(self): """creates a dtp listening on self.dtpFactory.dtpPort for connections""" if self.debug: log.msg('_createPassiveDTP') # TODO: figure out what happens if there's an existing ACTV # DTP connection and the client calls PASV self.dtpTxfrMode = PASV # ensure state is correct if not self... | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('_createDTP') | log.debug('_createDTP') | def _createDTP(self): if self.debug: log.msg('_createDTP') if self.dtpTxfrMode != ACTV: return self._createPassiveDTP() return self._createActiveDTP() | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
return self._createPassiveDTP() return self._createActiveDTP() | d = self._createPassiveDTP() else: d = self._createActiveDTP() d = self.dtpFactory.deferred d.addCallback(debugDeferred, 'dtpFactory deferred') d.addCallback(self._unblock) d.addErrback(self._ebDtpInstance) | def _createDTP(self): if self.debug: log.msg('_createDTP') if self.dtpTxfrMode != ACTV: return self._createPassiveDTP() return self._createActiveDTP() | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('cleanupDTP') if self.dtpFactory: if self.dtpFactory.dtpPort: if self.debug: log.msg('self.dtpFactory.dtpPort.stopListening()') | log.debug('cleanupDTP') if hasattr(self.dtpPort, 'connected'): self.dtpPort.loseConnection() self.dtpPort.stopListening() | def cleanupDTP(self): """called when DTP connection exits""" if self.debug: log.msg('cleanupDTP') if self.dtpFactory: if self.dtpFactory.dtpPort: if self.debug: log.msg('self.dtpFactory.dtpPort.stopListening()') self.dtpFactory = None | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
def doDTPCommand(self, command, args=None): '''causes the DTP to commence with an action''' if self.debug: log.msg('FTP.doDTPCommand: %s' % command) if not self.dtpFactory: self._createDTP() self.dtpFactory.doCommand(command, args) | self.dtpInstance = None self.dtpPort = None def _doDTPCommand(self, cmd, arg): if self.blocked is None: self.blocked = [] try: f = getattr(self.dtpInstance, "dtp_%s" % cmd, None) except AttributeError, e: log.err('SOMETHING IS SCREWY IN _doDTPCommand') raise e defer.maybeDeferred(f, arg ).addCallback(self._cbDTPComma... | def cleanupDTP(self): """called when DTP connection exits""" if self.debug: log.msg('cleanupDTP') if self.dtpFactory: if self.dtpFactory.dtpPort: if self.debug: log.msg('self.dtpFactory.dtpPort.stopListening()') self.dtpFactory = None | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('ftp_USER params: %s' % params) | log.debug('ftp_USER params: %s' % params) | def ftp_USER(self, params): """Get the login name, and reset the session PASS is expected to follow | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('ftp_PASS params: %s' % params) | log.debug('ftp_PASS params: %s' % params) | def ftp_PASS(self, params): """Authorize the USER and the submitted password | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
def _cbAnonLogin(self, (interface, avatar, logout)): '''anonymous login''' assert interface is IFTPShell peer = self.transport.getPeer() | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | ||
if self.debug: log.msg('ftp_LIST: %s' % params) | log.debug('ftp_LIST: %s' % params) | def ftp_LIST(self, params=''): """ This command causes a list to be sent from the server to the passive DTP. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the server should send current inform... | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
self.doDTPCommand('sendFile', sioObj) | self._doDTPCommand('RETR', sioObj) | def ftp_LIST(self, params=''): """ This command causes a list to be sent from the server to the passive DTP. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the server should send current inform... | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
if self.debug: log.msg('ftp_PASV') if not self.shell: if self.debug: log.msg('ftp_PASV returning, user not logged in') self.reply(NOT_LOGGED_IN) return | log.debug('ftp_PASV') | def ftp_PASV(self, *_): """Request for a passive connection | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
self._createDTP() if not self.TESTING: sockname = self.transport.getHost() localip = string.replace(sockname[1], '.', ',') lport = self.dtpFactory.dtpPort.socket.getsockname()[1] lp1 = lport / 256 lp2, lp1 = str(lport - lp1*256), str(lp1) if self.HUMAN_READABLE_PASV_PORT: self.reply(ENTERING_PASV_MODE, "%s,%s" % (loc... | if not self.dtpFactory: try: self._createDTP() except OSError, e: log.msg("CRITICAL BUG!! THIS SHOULD NOT HAVE HAPPENED!!! %s" % e) sockname = self.transport.getHost() localip = string.replace(sockname[1], '.', ',') lport = self.dtpPort.socket.getsockname()[1] lp1 = lport / 256 lp2, lp1 = str(lport - lp1*256), str(lp1)... | def ftp_PASV(self, *_): """Request for a passive connection | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
self.doDTPCommand('sendFile', fp) | self._doDTPCommand('RETR', fp) | def ftp_RETR(self, param): try: fp = self.shell.retr(cleanPath(param)) self.doDTPCommand('sendFile', fp) except FileNotFoundError, e: self.reply(FILE_NOT_FOUND, e) except PathBelowTLDError, e: self.reply(PERMISSION_DENIED, e) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py |
else: | def ftp_RETR(self, param): try: fp = self.shell.retr(cleanPath(param)) self.doDTPCommand('sendFile', fp) except FileNotFoundError, e: self.reply(FILE_NOT_FOUND, e) except PathBelowTLDError, e: self.reply(PERMISSION_DENIED, e) | cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py | |
data = ' '.join(data.split())+' ' | data = data.replace('\r', ' ') data = data.replace('\n', ' ') data = normalizeRE.sub(' ', data) | def gotText(self, data): if self.ignoring: return if self.normalizing: data = ' '.join(data.split())+' ' self.writer(data) | 09ddedb1d6812f3bc507459f853fde7d6fe39a32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/09ddedb1d6812f3bc507459f853fde7d6fe39a32/latex.py |
self.writer('\\'+level*'sub'+'section{') | self.writer('\n\n\\'+level*'sub'+'section{') | def _headerStart(self, h, attributes): level = int(h[1])-2 level += self.baseLevel self.writer('\\'+level*'sub'+'section{') | 09ddedb1d6812f3bc507459f853fde7d6fe39a32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/09ddedb1d6812f3bc507459f853fde7d6fe39a32/latex.py |
try: | try: | def opt_debug(self, opt): if opt == "yes" or opt == "y" or opt == "1": self.debug = 1 elif opt == "no" or opt == "n" or opt == "0": self.debug = 0 else: print "Unkown value for debug, setting to 0" self.debug = 0 | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py |
As you can see, you define optFlags as a list of paramaters that are either on or off. optStrings are paramaters with options that need to be assigned to them. If you want to handle your own options, define a method named opt_paramname that takes (self, option) as paramaters. option will be whatever immediately follows... | As you can see, you define optFlags as a list of paramaters (with both long and short names) that are either on or off. optStrings are paramaters with string values, with their default value as the third parameter in the list. If you want to handle your own options, define a method named opt_paramname that takes (sel... | def opt_debug(self, opt): if opt == "yes" or opt == "y" or opt == "1": self.debug = 1 elif opt == "no" or opt == "n" or opt == "0": self.debug = 0 else: print "Unkown value for debug, setting to 0" self.debug = 0 | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py |
program. See twisted.usage.__doc__ for for details. | program. See twisted.usage.__doc__ for for details. | def opt_debug(self, opt): if opt == "yes" or opt == "y" or opt == "1": self.debug = 1 elif opt == "no" or opt == "n" or opt == "0": self.debug = 0 else: print "Unkown value for debug, setting to 0" self.debug = 0 | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py |
def parseOptions(self, options=None): """ The guts of the command-line parser. """ # it's fine if this is slow if options is None: options = sys.argv[1:] dct = {} reflect.addMethodNamesToDict(self.__class__, dct, "opt_") shortOpt = '' longOpt = [] for name in dct.keys(): method = getattr(self, 'opt_'+name) reqArgs = m... | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py | ||
def parseOptions(self, options=None): """ The guts of the command-line parser. """ # it's fine if this is slow if options is None: options = sys.argv[1:] dct = {} reflect.addMethodNamesToDict(self.__class__, dct, "opt_") shortOpt = '' longOpt = [] for name in dct.keys(): method = getattr(self, 'opt_'+name) reqArgs = m... | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py | ||
def parseOptions(self, options=None): """ The guts of the command-line parser. """ # it's fine if this is slow if options is None: options = sys.argv[1:] dct = {} reflect.addMethodNamesToDict(self.__class__, dct, "opt_") shortOpt = '' longOpt = [] for name in dct.keys(): method = getattr(self, 'opt_'+name) reqArgs = m... | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py | ||
def parseOptions(self, options=None): """ The guts of the command-line parser. """ # it's fine if this is slow if options is None: options = sys.argv[1:] dct = {} reflect.addMethodNamesToDict(self.__class__, dct, "opt_") shortOpt = '' longOpt = [] for name in dct.keys(): method = getattr(self, 'opt_'+name) reqArgs = m... | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py | ||
def parseOptions(self, options=None): """ The guts of the command-line parser. """ # it's fine if this is slow if options is None: options = sys.argv[1:] dct = {} reflect.addMethodNamesToDict(self.__class__, dct, "opt_") shortOpt = '' longOpt = [] for name in dct.keys(): method = getattr(self, 'opt_'+name) reqArgs = m... | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py | ||
def parseOptions(self, options=None): """ The guts of the command-line parser. """ # it's fine if this is slow if options is None: options = sys.argv[1:] dct = {} reflect.addMethodNamesToDict(self.__class__, dct, "opt_") shortOpt = '' longOpt = [] for name in dct.keys(): method = getattr(self, 'opt_'+name) reqArgs = m... | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py | ||
def postOptions(self): """ TODO: Undocumented """ pass | 5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5232d7e529dd140a9a927eaf8fcc7f74a5d9c6f1/usage.py | ||
self.deferred.armAndErrback(error.ConnectionError(string="Connection failed")) | self.deferred.armAndErrback(error.ConnectError(string="Connection failed")) | def connectionFailed(self): if not self.term: self.term = 1 del self.broker self.deferred.armAndErrback(error.ConnectionError(string="Connection failed")) | f5683b69d77e1ca92652713620d1657f5bc5ca2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f5683b69d77e1ca92652713620d1657f5bc5ca2d/pb.py |
app.reportProfile(config['report-profile'], application.processName) | app.reportProfile(config['report-profile'], service.IProcess(application).processName) | def runApp(config): passphrase = app.getPassphrase(config['encrypted']) app.installReactor(config['reactor']) application = app.getApplication(config, passphrase) oldstdout = sys.stdout oldstderr = sys.stderr startLogging(config['logfile']) app.initialLog() os.chdir(config['rundir']) service.IService(application).privi... | 5846b686da0193d850949093f04a75c36c261aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5846b686da0193d850949093f04a75c36c261aed/twistw.py |
val = eval(code, self.namespace) | out = sys.stdout sys.stdout = StringIO.StringIO() try: val = eval(code, self.namespace) finally: rtval = sys.stdout.getvalue() sys.stdout = out | def perspective_do(self, mesg): fn = "$manhole" try: code = compile(mesg, fn, 'eval') except: try: code = compile(mesg, fn, 'exec') except: io = StringIO.StringIO() traceback.print_exc(file=io) return io.getvalue() try: val = eval(code, self.namespace) except: io = StringIO.StringIO() traceback.print_exc(file=io) retur... | 592bef9cc652daf229b823170c8603183caab1de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/592bef9cc652daf229b823170c8603183caab1de/service.py |
return io.getvalue() return val | return rtval + io.getvalue() if val is not None: return rtval + '\n' + val else: return rtval | def perspective_do(self, mesg): fn = "$manhole" try: code = compile(mesg, fn, 'eval') except: try: code = compile(mesg, fn, 'exec') except: io = StringIO.StringIO() traceback.print_exc(file=io) return io.getvalue() try: val = eval(code, self.namespace) except: io = StringIO.StringIO() traceback.print_exc(file=io) retur... | 592bef9cc652daf229b823170c8603183caab1de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/592bef9cc652daf229b823170c8603183caab1de/service.py |
self._results = results | self._results = results | def __init__(self, results, finished): Cooperate.__init__(self) self._results = results self._finished = finished | 0d9b5b3750615f58c2d0f754f5d516173a671ffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0d9b5b3750615f58c2d0f754f5d516173a671ffa/flow.py |
self.execute() | if self.execute: self.execute() | def finish(self): self._finished.append(1) self.execute() | 0d9b5b3750615f58c2d0f754f5d516173a671ffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0d9b5b3750615f58c2d0f754f5d516173a671ffa/flow.py |
self.execute() | if self.execute: self.execute() | def callback(self, value): self._results.append(value) self.execute() | 0d9b5b3750615f58c2d0f754f5d516173a671ffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0d9b5b3750615f58c2d0f754f5d516173a671ffa/flow.py |
expectedHeaders = {'Request' : '/foo/bar', 'Command' : 'GET', 'Version' : 'HTTP/1.0', 'Content-Length' : '21'} | expectedHeaders = {'request' : '/foo/bar', 'command' : 'GET', 'version' : 'HTTP/1.0', 'content-length' : '21'} | def testBuffer(self): b = StringIOWithoutClosing() a = http.HTTPChannel() a.requestFactory = DummyHTTPHandler a.makeConnection(protocol.FileWrapper(b)) # one byte at a time, to stress it. for byte in self.requests: a.dataReceived(byte) a.connectionLost() value = b.getvalue() if value != self.expected_response: for i in... | f86e718c3c1d0405bfe458f2f79cf43aca582f99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f86e718c3c1d0405bfe458f2f79cf43aca582f99/test_http.py |
print "status" | def _handleStatus(self, version, status, message): print "status" self.gotStatus = 1 self.assertEquals(version, "HTTP/1.0") self.assertEquals(status, "200") | f86e718c3c1d0405bfe458f2f79cf43aca582f99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f86e718c3c1d0405bfe458f2f79cf43aca582f99/test_http.py | |
print "response" | def _handleResponse(self, data): print "response" self.gotResponse = 1 self.assertEquals(data, "'''\n10\n0123456789'''\n") | f86e718c3c1d0405bfe458f2f79cf43aca582f99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f86e718c3c1d0405bfe458f2f79cf43aca582f99/test_http.py | |
self.assertEquals(self.expectedHeaders[key], value) | self.assertEquals(self.expectedHeaders[string.lower(key)], value) | def _handleHeader(self, key, value): self.numHeaders = self.numHeaders + 1 self.assertEquals(self.expectedHeaders[key], value) | f86e718c3c1d0405bfe458f2f79cf43aca582f99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f86e718c3c1d0405bfe458f2f79cf43aca582f99/test_http.py |
print "headers" | def _handleEndHeaders(self): print "headers" self.gotEndHeaders = 1 self.assertEquals(self.numHeaders, 4) | f86e718c3c1d0405bfe458f2f79cf43aca582f99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f86e718c3c1d0405bfe458f2f79cf43aca582f99/test_http.py | |
self.listenerTCP.loseConnection() d = defer.maybeDeferred(self.listenerUDP.stopListening) | """Asynchronously disconnect listenerTCP, listenerUDP and resolver""" d1 = self.listenerTCP.loseConnection() d2 = defer.maybeDeferred(self.listenerUDP.stopListening) d = defer.gatherResults([d1, d2]) | def tearDown(self): self.listenerTCP.loseConnection() d = defer.maybeDeferred(self.listenerUDP.stopListening) def disconnectTransport(ignored): if getattr(self.resolver.protocol, 'transport', None) is not None: return self.resolver.protocol.transport.stopListening() d.addCallback(disconnectTransport) d.addCallback(lamb... | 208054dd22eacf6ec28ee6065ea7ed8cf531641d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/208054dd22eacf6ec28ee6065ea7ed8cf531641d/test_names.py |
d = clientCreator.connectTCP("127.0.0.1", portNum) | d2 = clientCreator.connectTCP("127.0.0.1", portNum) | def _rememberProtocolInstance(addr): protocol = buildProtocol(addr) self.serverProtocol = protocol.wrappedProtocol return protocol | 6dc2595124ed21d282576cfb553463fbb3d540f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6dc2595124ed21d282576cfb553463fbb3d540f3/test_ftp.py |
return d.addCallback(gotClient) | d2.addCallback(gotClient) return defer.gatherResults([d1, d2]) | def gotClient(client): self.client = client | 6dc2595124ed21d282576cfb553463fbb3d540f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6dc2595124ed21d282576cfb553463fbb3d540f3/test_ftp.py |
mapStart_q = mapEnd_q = '"' | mapStart_q = "``" mapEnd_q = "''" | def end_div(self, _): class_ = self.divs.pop() if class_: self.gotTagEnd('div_'+class_) | a963d264870f587445df2800dca7f7933647ae02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a963d264870f587445df2800dca7f7933647ae02/latex.py |
raise NotImplementedError() | raise NotImplementedError("%s does not implement writeVector()" % (self.__class__.__name__,)) | def writeVector(self, data): raise NotImplementedError() | 7857da7eafb89faffafd754b3d1a75bf45647193 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7857da7eafb89faffafd754b3d1a75bf45647193/abstract.py |
if not self.vector: return 0 l = self.writeVector(self.vector) if l < 0 or isinstance(l, Exception): return l if l == 0 and self.vector: result = 0 else: result = None | if self.vector: l = self.writeVector(self.vector) if l < 0 or isinstance(l, Exception): return l if l == 0 and self.vector: result = 0 else: result = None | def doWrite(self): if not self.vector: return 0 l = self.writeVector(self.vector) if l < 0 or isinstance(l, Exception): return l if l == 0 and self.vector: result = 0 else: result = None if not self.vector: self.stopWriting() if self.producer is not None and ((not self.streamingProducer) or self.producerPaused): self.p... | 7857da7eafb89faffafd754b3d1a75bf45647193 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7857da7eafb89faffafd754b3d1a75bf45647193/abstract.py |
checker.allowedClasses['div']['latexmacros'] = 1 checker.allowedClasses['span']['latexformula'] = 1 | checker.allowedClasses['div'].__self__['latexmacros'] = 1 checker.allowedClasses['span'].__self__['latexformula'] = 1 | def generate_lint(self, d): checker = lint.getDefaultChecker() checker.allowedClasses = checker.allowedClasses.copy() checker.allowedClasses['div']['latexmacros'] = 1 checker.allowedClasses['span']['latexformula'] = 1 return lambda file, linkrel: lint.doFile(file, checker) | 2cb0892f1084e8afe0a4265a9606590e71096c7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2cb0892f1084e8afe0a4265a9606590e71096c7e/math.py |
"""See twisted.internet.interfaces.IReactorCore.callFromThread. | """See twisted.internet.interfaces.IReactorThreads.callFromThread. | def callFromThread(self, f, *args, **kw): """See twisted.internet.interfaces.IReactorCore.callFromThread. """ assert callable(f), "%s is not callable" % f if threadable.isInIOThread(): self.callLater(0, f, *args, **kw) else: # lists are thread-safe in CPython, but not in Jython # this is probably a bug in Jython, but u... | 95e0de5ce93632a937dd30b0029c487acb9f2c45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/95e0de5ce93632a937dd30b0029c487acb9f2c45/base.py |
self.consumer.unregisterProducer() self.finishedCallback.callback(None) | if self.consumer is not None: self.consumer.unregisterProducer() if self.finishedCallback is not None: self.finishedCallback.callback(None) | def _doWrite(self, data): if self.consumer is None: return if data is None: # The end. self.consumer.unregisterProducer() self.finishedCallback.callback(None) self.finishedCallback = self.deferred = self.consumer = self.stream = None return self.deferred = None if self.enforceStr: # XXX: sucks that we have to do this.... | 978a11af326672d035c878af83c90d53ac6ccf6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/978a11af326672d035c878af83c90d53ac6ccf6d/stream.py |
self.connector() | if self.totalConnections<self.numberRounds: self.connector() | def _connectionMade(self): self.totalConnections += 1 self.connector() | 97549ff308ab8fa77ce74f1dfc8b012dedc23c53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/97549ff308ab8fa77ce74f1dfc8b012dedc23c53/test_tcp.py |
childFDs[2] = self.factory.stderrFile | childFDs[2] = self.factory.stderrFile.fileno() | def connectionMade(self): sockFD = self.transport.fileno() childFDs = {0: sockFD, 1: sockFD} if self.factory.stderrFile: childFDs[2] = self.factory.stderrFile | 667195f5a092a34b3a69e1bd3edfb583ad789a36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/667195f5a092a34b3a69e1bd3edfb583ad789a36/inetd.py |
None, None, service.user, service.group, childFDs) | None, None, uid, gid, childFDs) | def connectionMade(self): sockFD = self.transport.fileno() childFDs = {0: sockFD, 1: sockFD} if self.factory.stderrFile: childFDs[2] = self.factory.stderrFile | 667195f5a092a34b3a69e1bd3edfb583ad789a36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/667195f5a092a34b3a69e1bd3edfb583ad789a36/inetd.py |
if href.startswith('http://') or href.startswith('https://'): | if urlparse.urlparse(href)[0] in supported_schemes: | def visitNode_a_href(self, node): self.visitNodeDefault(node) href = node.getAttribute('href') if href.startswith('http://') or href.startswith('https://'): if node.childNodes[0].data != href: self.writer('\\footnote{%s}' % latexEscape(href)) elif href.startswith('mailto:'): pass else: if href.startswith('#'): href = s... | 73f607dfc2f93f840940f2fe486de7d15ab94b17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/73f607dfc2f93f840940f2fe486de7d15ab94b17/latex.py |
elif href.startswith('mailto:'): pass | def visitNode_a_href(self, node): self.visitNodeDefault(node) href = node.getAttribute('href') if href.startswith('http://') or href.startswith('https://'): if node.childNodes[0].data != href: self.writer('\\footnote{%s}' % latexEscape(href)) elif href.startswith('mailto:'): pass else: if href.startswith('#'): href = s... | 73f607dfc2f93f840940f2fe486de7d15ab94b17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/73f607dfc2f93f840940f2fe486de7d15ab94b17/latex.py | |
def receiveDirectMessage(self, senderName, message): | def receiveDirectMessage(self, senderName, message, metadata=None): | def receiveDirectMessage(self, senderName, message): #>> :glyph_!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello #>> :glyph!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello | fb5c4485fb829bdefd61c579b3f24943941d7c43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fb5c4485fb829bdefd61c579b3f24943941d7c43/ircservice.py |
lines = string.split(message, '\n') for line in lines: self.sendLine(":%s!%s@%s PRIVMSG %s :%s" % (senderName, senderName, self.servicename, self.nickname, line)) def receiveGroupMessage(self, sender, group, message): | if (metadata is not None) and (metadata['style'] == 'emote'): message = irc.ctcpStringify([('ACTION', message)]) self.sendLine(":%s!%s@%s PRIVMSG %s :%s" % (senderName, senderName, self.servicename, self.nickname, irc.lowQuote(message))) def receiveGroupMessage(self, sender, group, message, metadata=None): if (metad... | def receiveDirectMessage(self, senderName, message): #>> :glyph_!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello #>> :glyph!glyph@adsl-64-123-27-108.dsl.austtx.swbell.net PRIVMSG glyph_ :hello | fb5c4485fb829bdefd61c579b3f24943941d7c43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fb5c4485fb829bdefd61c579b3f24943941d7c43/ircservice.py |
lines = string.split(message, '\n') for line in lines: self.sendLine(":%s!%s@%s PRIVMSG (sender, sender, self.servicename, group, line)) | self.sendLine(":%s!%s@%s PRIVMSG (sender, sender, self.servicename, group, irc.lowQuote(message))) | def receiveGroupMessage(self, sender, group, message): if sender is not self: lines = string.split(message, '\n') for line in lines: self.sendLine(":%s!%s@%s PRIVMSG #%s :%s" % (sender, sender, self.servicename, group, line)) | fb5c4485fb829bdefd61c579b3f24943941d7c43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fb5c4485fb829bdefd61c579b3f24943941d7c43/ircservice.py |
def irc_PRIVMSG(self, prefix, params): """Send a (private) message. | fb5c4485fb829bdefd61c579b3f24943941d7c43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fb5c4485fb829bdefd61c579b3f24943941d7c43/ircservice.py | ||
meth = getattr(self.im_class, self.im_func) | def receiveClose(self): assert self.state == 3 meth = getattr(self.im_class, self.im_func) if self.im_self is None: return meth # TODO: late-available instances #if isinstance(self.im_self, NotKnown): # im = _InstanceMethod(self.im_name, self.im_self, self.im_class) # return im im = instancemethod(meth, self.im_s... | 6a1847b39e4e7b913e5633719596298a93139442 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6a1847b39e4e7b913e5633719596298a93139442/slicer.py | |
flags = tuple(parseNestedList(parts[1])) | flags = tuple(parseNestedParens(parts[1])) | def auth_APPEND(self, tag, args): parts = splitQuoted(args) if len(parts) == 2: flags = () date = rfc822.formatdate() size = parts[1] elif len(parts) == 3: if parts[1].startswith('(') and parts[1].endswith(')'): flags = tuple(parseNestedList(parts[1])) date = rfc822.formatdate() else: flags = () date = parts[1] size = ... | 81c180248fc2fbc67097acf305c1f291ad0f3d50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/81c180248fc2fbc67097acf305c1f291ad0f3d50/imap4.py |
c.connectionLost = self.sendEOF | c.connectionLost = lambda x=None,s=self:s.sendEOF() | def channelOpen(self, foo): #global globalSession #globalSession = self # turn off local echo if options['agent']: d = self.conn.sendRequest(self, 'auth-agent-req@openssh.com', '', wantReply=1) d.addBoth(lambda x:log.msg(x)) if options['noshell']: return if (options['command'] and options['tty']) or not options['notty'... | 513e8bf3a80c80d446acf5420077f775da9561b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/513e8bf3a80c80d446acf5420077f775da9561b6/conch.py |
supportedTerms = ['xterm', 'xterm-color', 'linux', 'screen'] if not os.environ.has_key('TERM'): | import sys if not sys.stderr.isatty(): return False try: import curses curses.setupterm() return curses.tigetnum("colors") > 2 except: | def _supportsColor(self): supportedTerms = ['xterm', 'xterm-color', 'linux', 'screen'] if not os.environ.has_key('TERM'): return False return os.environ['TERM'] in supportedTerms | 47c152dd702c6be271403a86112776bff5aa8b74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/47c152dd702c6be271403a86112776bff5aa8b74/trial.py |
return os.environ['TERM'] in supportedTerms | def _supportsColor(self): supportedTerms = ['xterm', 'xterm-color', 'linux', 'screen'] if not os.environ.has_key('TERM'): return False return os.environ['TERM'] in supportedTerms | 47c152dd702c6be271403a86112776bff5aa8b74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/47c152dd702c6be271403a86112776bff5aa8b74/trial.py | |
self.transport.loseConnection() | self.disconnect() | def connectionMade(self): if DENY_CONNECTION: self.transport.loseConnection() return | 15b2ab21feaeb85fb3fff11efeaec88d91007453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/15b2ab21feaeb85fb3fff11efeaec88d91007453/pop3testserver.py |
self.transport.loseConnection() | self.disconnect() | def lineReceived(self, line): """Error Conditions""" uline = line.upper() find = lambda s: uline.find(s) != -1 | 15b2ab21feaeb85fb3fff11efeaec88d91007453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/15b2ab21feaeb85fb3fff11efeaec88d91007453/pop3testserver.py |
self.sendLine('+OK TLS not available') | self.sendLine('-ERR TLS not available') | def startTLS(self): if self.ctx is None: self.getContext() | 15b2ab21feaeb85fb3fff11efeaec88d91007453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/15b2ab21feaeb85fb3fff11efeaec88d91007453/pop3testserver.py |
('DCC', ['SEND', 'RESUME', fileName, port, resumePos])]) | ('DCC', ['RESUME', fileName, port, resumePos])]) | def dccResume(self, user, fileName, port, resumePos): """Send a DCC RESUME request to another user.""" self.ctcpMakeQuery(user, [ ('DCC', ['SEND', 'RESUME', fileName, port, resumePos])]) | 405f675c0888e3a2152daa3543f83dc794ec7c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/405f675c0888e3a2152daa3543f83dc794ec7c0b/irc.py |
('DCC', ['SEND', 'ACCEPT', fileName, port, resumePos])]) | ('DCC', ['ACCEPT', fileName, port, resumePos])]) | def dccAcceptResume(self, user, fileName, port, resumePos): """Send a DCC ACCEPT response to clients who have requested a resume. """ self.ctcpMakeQuery(user, [ ('DCC', ['SEND', 'ACCEPT', fileName, port, resumePos])]) | 405f675c0888e3a2152daa3543f83dc794ec7c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/405f675c0888e3a2152daa3543f83dc794ec7c0b/irc.py |
dcctype = data[0].upper() if dcctype in ('RESUME', 'ACCEPT'): handler = getattr(self, 'dcc_SEND_' + dcctype, None) data.pop() handler(user, channel, data) return | def dcc_SEND(self, user, channel, data): # Use splitQuoted for those who send files with spaces in the names. data = text.splitQuoted(data) if len(data) < 3: raise IRCBadMessage, "malformed DCC SEND request: %r" % (data,) | 405f675c0888e3a2152daa3543f83dc794ec7c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/405f675c0888e3a2152daa3543f83dc794ec7c0b/irc.py | |
print 'called conv' | def _conv(p, items, foo): print 'called conv' try: d = conv(items) except: import traceback print 'FOOOFOFOFOSDFOSDF' traceback.print_exc() return ev = threading.Event() def cb(r): ev.r = (1, r) ev.set() def eb(e): ev.r = (0, e) ev.set() reactor.callFromThread(d.addCallbacks, cb, eb) ev.wait() print 'ASDASDASDASD' done... | 9bff7add7451515209f0a1aadc10d470d8aec967 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9bff7add7451515209f0a1aadc10d470d8aec967/pamauth.py | |
print 'FOOOFOFOFOSDFOSDF' | def _conv(p, items, foo): print 'called conv' try: d = conv(items) except: import traceback print 'FOOOFOFOFOSDFOSDF' traceback.print_exc() return ev = threading.Event() def cb(r): ev.r = (1, r) ev.set() def eb(e): ev.r = (0, e) ev.set() reactor.callFromThread(d.addCallbacks, cb, eb) ev.wait() print 'ASDASDASDASD' done... | 9bff7add7451515209f0a1aadc10d470d8aec967 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9bff7add7451515209f0a1aadc10d470d8aec967/pamauth.py | |
print 'ASDASDASDASD' | def eb(e): ev.r = (0, e) ev.set() | 9bff7add7451515209f0a1aadc10d470d8aec967 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9bff7add7451515209f0a1aadc10d470d8aec967/pamauth.py | |
n.setAttribute("parent:connect", "%s:%d" % (connector.host, str(connector.portno))) | n.setAttribute("parent:connect", "%s:%d" % (connector.host, connector.portno)) | def jellyToDOM_1(self, jellier, node): if hasattr(self, 'uid'): node.setAttribute("uid", str(self.uid)) node.setAttribute("gid", str(self.gid)) node.setAttribute("name", self.name) tcpnode = jellier.document.createElement("tcp") node.appendChild(tcpnode) svcnode = jellier.document.createElement("services") node.appendC... | 7b4ee68921149b350d529dc0e8b836a224cc0c76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7b4ee68921149b350d529dc0e8b836a224cc0c76/app.py |
body = "<HTML><BODY><br>web.Server Traceback \n\n" + html.PRE(io.getvalue()) + "\n\n</body></html>" | body = "<HTML><BODY><br>web.Server Traceback \n\n" + html.PRE(io.getvalue()) + "\n\n</body></html>\n" | def process(self): "Process a request." # Log the request to a file. print self # cache the client information, we'll need this later to be pickled and # sent with the request so CGIs will work remotely self.client = self.transport.getPeer() # set various default headers self.setHeader('server', version) self.setHead... | e3c1f9b79756e940cfaeb62057bd297dbbd0abc8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e3c1f9b79756e940cfaeb62057bd297dbbd0abc8/server.py |
self.factory.startFactory() | def startListening(self): """Create and bind my socket, and begin listening on it. | 895baa0fd79212a7de1e3fd4d751ff563705b171 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/895baa0fd79212a7de1e3fd4d751ff563705b171/tcp.py | |
from twisted.web2 import stream import sys stream.readStream(response.stream, lambda x: (sys.stderr.write(x), sys.stderr.write("\n"))) | def do_test(response): response = IResponse(response) | a308c788e861c7e822c9a27586b9fe79c1418ffe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a308c788e861c7e822c9a27586b9fe79c1418ffe/test_report.py | |
class Redirect(resource.Resource): def __init__(self, url): self.url = url def render(self, request): request.setHeader("location", self.url) request.setResponseCode(http.TEMPORARY_REDIRECT) return """ | def addSlash(request): return "http://%s%s/" % ( request.getHeader("host"), (string.split(request.uri,'?')[0])) def redirectTo(URL, request): request.setHeader("location", URL) request.setResponseCode(http.TEMPORARY_REDIRECT) return """ | def render(self, request): request.setHeader("content-type", self.type) if request.method == "HEAD": request.setHeader("content-length", len(self.data)) return '' return self.data | ab833aa9247ee2c525ffafd7efbe81b8d09c296c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ab833aa9247ee2c525ffafd7efbe81b8d09c296c/static.py |
""" % {'url': self.url} | """ % {'url': URL} class Redirect(resource.Resource): def __init__(self, request): self.url = addSlash(request) def render(self, request): return redirectTo(self.url, request) | def render(self, request): request.setHeader("location", self.url) request.setResponseCode(http.TEMPORARY_REDIRECT) return """ | ab833aa9247ee2c525ffafd7efbe81b8d09c296c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ab833aa9247ee2c525ffafd7efbe81b8d09c296c/static.py |
return self.redirect(request) | return Redirect(request) | def getChild(self, path, request): """See twisted.web.Resource.getChild. """ if path == '..': return error.NoResource("Invalid request URL.") | ab833aa9247ee2c525ffafd7efbe81b8d09c296c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ab833aa9247ee2c525ffafd7efbe81b8d09c296c/static.py |
def getChild(self, path, request): """See twisted.web.Resource.getChild. """ if path == '..': return error.NoResource("Invalid request URL.") | ab833aa9247ee2c525ffafd7efbe81b8d09c296c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ab833aa9247ee2c525ffafd7efbe81b8d09c296c/static.py | ||
index = self.getIndex(request) if index: return index.render(request) return self.redirect(request).render(request) | if self.path[-1] == '/': index = self.getIndex(request) if index: return index.render(request) else: return self.redirect(request) | def render(self, request): "You know what you doing." mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime =\ os.stat(self.path) | ab833aa9247ee2c525ffafd7efbe81b8d09c296c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ab833aa9247ee2c525ffafd7efbe81b8d09c296c/static.py |
redirectURL = "http://%s%s/" % ( request.getHeader("host"), (string.split(request.uri,'?')[0])) return Redirect(redirectURL) | return redirectTo(addSlash(request), request) | def redirect(self, request): redirectURL = "http://%s%s/" % ( request.getHeader("host"), (string.split(request.uri,'?')[0])) return Redirect(redirectURL) | ab833aa9247ee2c525ffafd7efbe81b8d09c296c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ab833aa9247ee2c525ffafd7efbe81b8d09c296c/static.py |
I will login as soon as I receive the weclome message from the server. | I will login as soon as I receive the welcome message from the server. | def __init__(self, username='anonymous', password='twisted@twistedmatrix.com', passive=1): """Constructor. | a74a930c2aa7d9fa20b4c0909754dfef5abe695f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a74a930c2aa7d9fa20b4c0909754dfef5abe695f/ftp.py |
cmd.deferred.addErrback(portCmd.fail) | cmd.deferred.addErrback(lambda e, pc=portCmd: pc.fail(e) or e) cmd.deferred.addErrback(portCmd.realDeferred.errback) cmd.deferred.arm() | abcdef = re.sub('[^0-9, ]', '', line[4:]) | a74a930c2aa7d9fa20b4c0909754dfef5abe695f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a74a930c2aa7d9fa20b4c0909754dfef5abe695f/ftp.py |
listener = FTPDataPort(0, FTPDataPortFactory()) | factory = FTPDataPortFactory() listener = FTPDataPort(0, factory) factory.port = listener | def newCL(oldCL=oldCL, portCmd=portCmd): oldCL() portCmd.realDeferred.callback(portCmd.protocol) | a74a930c2aa7d9fa20b4c0909754dfef5abe695f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a74a930c2aa7d9fa20b4c0909754dfef5abe695f/ftp.py |
while factory.line is None: reactor.iterate(0.1) | util.spinWhile(lambda :factory.line is None) | def lineReceived(self, line): self.factory.line = line | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while factory.line is None: reactor.iterate(0.1) | util.spinWhile(lambda :factory.line is None) | def lineReceived(self, line): self.factory.line = line | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while factory.line is None: reactor.iterate(0.1) | util.spinWhile(lambda :factory.line is None) | def lineReceived(self, line): self.factory.line = line | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while not l: reactor.iterate(0.1) | util.spinWhile(lambda :not l) | def testUDP(self): if not interfaces.IReactorUDP(reactor, None): raise unittest.SkipTest, "This reactor does not support UDP sockets" p = protocol.DatagramProtocol() t = internet.TCPServer(0, p) t.startService() num = t._port.getHost().port l = [] defer.maybeDeferred(t.stopService).addCallback(l.append) while not l: re... | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while not l: reactor.iterate(0.1) | util.spinWhile(lambda :not l) | def testUDP(self): if not interfaces.IReactorUDP(reactor, None): raise unittest.SkipTest, "This reactor does not support UDP sockets" p = protocol.DatagramProtocol() t = internet.TCPServer(0, p) t.startService() num = t._port.getHost().port l = [] defer.maybeDeferred(t.stopService).addCallback(l.append) while not l: re... | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while factory.line is None: reactor.iterate(0.1) | util.spinWhile(lambda :factory.line is None) | def lineReceived(self, line): self.factory.line = line | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while not l: reactor.iterate(0.1) | util.spinWhile(lambda :not l) | def testConnectionGettingRefused(self): factory = protocol.ServerFactory() factory.protocol = wire.Echo t = internet.TCPServer(0, factory) t.startService() num = t._port.getHost().port t.stopService() l = [] factory = protocol.ClientFactory() factory.clientConnectionFailed = lambda *args: l.append(None) c = internet.TC... | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while factory.line is None: reactor.iterate(0.1) | util.spinWhile(lambda :factory.line is None) | def lineReceived(self, line): self.factory.line = line | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while not l: reactor.iterate(0.1) | util.spinWhile(lambda :not l) | def lineReceived(self, line): self.factory.line = line | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
while factory.line is None: reactor.iterate(0.1) | util.spinWhile(lambda :factory.line is None) | def lineReceived(self, line): self.factory.line = line | a79e9f9c61953c867382db060dfde03dbf771dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a79e9f9c61953c867382db060dfde03dbf771dc3/test_application.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.