rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
registerReapProccessHandler(self.pid, self)
registerReapProcessHandler(self.pid, self)
def __init__(self, reactor, command, args, environment, path, proto, uid=None, gid=None): """Spawn an operating-system process.
6e5029b6945ddb47ed220fdcc89a120eabc49fb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6e5029b6945ddb47ed220fdcc89a120eabc49fb3/process.py
registerReapProccessHandler(self.pid, self)
registerReapProcessHandler(self.pid, self)
def __init__(self, reactor, command, args, environment, path, proto, uid=None, gid=None, usePTY=None): """Spawn an operating-system process.
6e5029b6945ddb47ed220fdcc89a120eabc49fb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6e5029b6945ddb47ed220fdcc89a120eabc49fb3/process.py
"""Add the given message to the currently selected mailbox
"""Add the given message to the given mailbox.
def append(self, mailbox, message, flags = (), date = None): """Add the given message to the currently selected mailbox
e7b63b2dfb6248af5706ce22adadaefd9599d255 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e7b63b2dfb6248af5706ce22adadaefd9599d255/imap4.py
'-v '
def testOurServerCmdLineClient(self): """test the Conch server against the cmdline client """ if runtime.platformType == 'win32': raise unittest.SkipTest, "can't run cmdline client on win32" cmd = ('%s %s -p %i -l testuser ' '--known-hosts kh_test ' '--user-authentications publickey ' '--host-key-algorithms ssh-rsa ' '...
b47cdf56a5967b02de88278a8ff3e84788639d5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b47cdf56a5967b02de88278a8ff3e84788639d5c/test_conch.py
'-v '
def testOurServerUnixClient(self): if runtime.platformType == 'win32': raise unittest.SkipTest, "can't run cmdline client on win32" cmd1 = ('-p %i -l testuser ' '--known-hosts kh_test ' '--user-authentications publickey ' '--host-key-algorithms ssh-rsa ' '-a ' '-K direct ' '-i dsa_test ' 'localhost' ) cmd2 = ('%s %s -p...
b47cdf56a5967b02de88278a8ff3e84788639d5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b47cdf56a5967b02de88278a8ff3e84788639d5c/test_conch.py
self.connected = 1
def doConnect(self): """I connect the socket.
8adc84f987a9ccc810aae73cd1a8806ef08ad85b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8adc84f987a9ccc810aae73cd1a8806ef08ad85b/tcp.py
self.startReading()
def _connectDone(self): self.startReading() self.protocol = self.connector.buildProtocol(self.getPeer()) self.protocol.makeConnection(self) self.logstr = self.protocol.__class__.__name__+",client"
8adc84f987a9ccc810aae73cd1a8806ef08ad85b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8adc84f987a9ccc810aae73cd1a8806ef08ad85b/tcp.py
self.startReading()
def _connectDone(self): self.startReading() self.protocol = self.connector.buildProtocol(self.getPeer()) self.protocol.makeConnection(self) self.logstr = self.protocol.__class__.__name__+",client"
8adc84f987a9ccc810aae73cd1a8806ef08ad85b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8adc84f987a9ccc810aae73cd1a8806ef08ad85b/tcp.py
if self.attributeDesc!=None:
if attributeDesc!=None:
def __init__(self, attributeDesc=None, assertionValue=None, encoded=None, berdecoder=None): BERSequence.__init__(self, value=[]) if self.attributeDesc!=None: assert encoded==None self.attributeDesc=attributeDesc self.assertionValue=assertionValue elif encoded!=None: assert attributeDesc==None assert assertionValue==Non...
b53dce13250d2a880491fb76fb2f87e2e734e72d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b53dce13250d2a880491fb76fb2f87e2e734e72d/pureldap.py
self.service.connectionLost(self.name)
self.service.connectionLost(self.name, self.transport.pid)
def processEnded(self, reason): if not self.empty: self.output.dataReceived('\n') self.service.connectionLost(self.name)
e63be4be40c2fa73dfc4b4e37611c16cfc14ca76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e63be4be40c2fa73dfc4b4e37611c16cfc14ca76/procmon.py
def connectionLost(self, name): if self.murder.has_key(name): self.murder[name].cancel() del self.murder[name] return del self.protocols[name]
def connectionLost(self, name, pid): if self.murder.has_key(pid): self.murder[pid].cancel() del self.murder[pid] if self.protocols.has_key(name): del self.protocols[name]
def connectionLost(self, name): if self.murder.has_key(name): self.murder[name].cancel() del self.murder[name] return del self.protocols[name] if time.time()-self.timeStarted[name]<self.threshold: delay = self.delay[name] = min(1+2*self.delay.get(name, 0), 3600) else: delay = self.delay[name] = 0 if self.active and sel...
e63be4be40c2fa73dfc4b4e37611c16cfc14ca76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e63be4be40c2fa73dfc4b4e37611c16cfc14ca76/procmon.py
self.murder[name] = reactor.callLater(self.killTime, os.kill, pid, 9)
self.murder[pid] = reactor.callLater(self.killTime, os.kill, pid, 9)
def stopProcess(self, name): if not self.protocols.has_key(name): return pid = self.protocols[name].transport.pid del self.protocols[name] os.kill(pid, 15) self.murder[name] = reactor.callLater(self.killTime, os.kill, pid, 9)
e63be4be40c2fa73dfc4b4e37611c16cfc14ca76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e63be4be40c2fa73dfc4b4e37611c16cfc14ca76/procmon.py
self.startProcess(name)
def restartAll(self): for name in self.processes.keys(): self.stopProcess(name) self.startProcess(name)
e63be4be40c2fa73dfc4b4e37611c16cfc14ca76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e63be4be40c2fa73dfc4b4e37611c16cfc14ca76/procmon.py
def printAnswer(answers):
def printAnswer((answers, auth, add)):
def printAnswer(answers): if not len(answers): print 'No answers' else: print '\n'.join(map(str, answers)) reactor.stop()
cde5c33416453546f4b4434c1372ad4439d86f20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cde5c33416453546f4b4434c1372ad4439d86f20/dns-service.py
print '\n'.join(map(str, answers))
print '\n'.join([str(x.payload) for x in answers])
def printAnswer(answers): if not len(answers): print 'No answers' else: print '\n'.join(map(str, answers)) reactor.stop()
cde5c33416453546f4b4434c1372ad4439d86f20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cde5c33416453546f4b4434c1372ad4439d86f20/dns-service.py
dirListingPage = widgets.WidgetPage(DirectoryListing(self.path)) return dirListingPage.render(request)
return self.redirect(request).render(request)
def render(self, request): "You know what you doing." mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime =\ os.stat(self.path)
d20dfe4b938f38e9df3286ad95cd8291e9c3b1f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d20dfe4b938f38e9df3286ad95cd8291e9c3b1f5/static.py
def locate(self, name, debug=1):
def locate(self, name, debug=0):
def locate(self, name, debug=1): """ Get a reference to an object with the given name which is somewhere on the path above us. """ return self._lookup(name, debug=debug)
ea0b08aa06fe462a957cfe0e88a4554a2bc285cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ea0b08aa06fe462a957cfe0e88a4554a2bc285cc/refpath.py
def acquire(self, name, debug=1):
def acquire(self, name, debug=0):
def acquire(self, name, debug=1): """ Look for an attribute or element by name in all of our parents """ return self._lookup(name, acquire=1, debug=debug)
ea0b08aa06fe462a957cfe0e88a4554a2bc285cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ea0b08aa06fe462a957cfe0e88a4554a2bc285cc/refpath.py
class YieldIteration(Exception):
class PauseFlow(Exception):
def iter(lst): from types import ListType, TupleType if type(lst) == type([]) or type(lst) == type(tuple()): return _ListIterator(lst) else: return lst.__iter__()
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
This exception can be used as a signal from an iterator returned from an IFlowFunction; the Flow object could then reschedule itself in the event queue so that other operations can proceed. In this case, the iterator's next() will just be called at a later time. ''' initialState = "__initial__" failureState = "__fa...
This exception can be used as a signal from a stage in the flow to the flow controller. It can occur in either the __call__ of the stage, or in the next() method of any iterator returned. The result of this signal is that the entire flow mechanism is paused and recheduled in the main loop so that other operations in...
def iter(lst): from types import ListType, TupleType if type(lst) == type([]) or type(lst) == type(tuple()): return _ListIterator(lst) else: return lst.__iter__()
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
This is an interface for a function (with attributes) which participates in a given Flow. It is typical to implement this using a function given attributes. Every attribute may be missing to provide minimal behavior. isIterable This is true if the function returns an iterable object; in 2.1 this is either a list o...
This function constructs a FlowStage tuple which is used inside the Flow mechanism to track state, etc. If an argument is provided, then it is used; otherwise the callable is searched for the same attribute, else, the default is used. onFinish This function attribute, if present, will be called after all subordin...
def iter(lst): from types import ListType, TupleType if type(lst) == type([]) or type(lst) == type(tuple()): return _ListIterator(lst) else: return lst.__iter__()
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
Note: if none of these attributes are provided, then the function is expected to return a tuple with two items, a (state, value) or None to stop the flow. ''' def __call__(self, data): ''' When the function is invoked, it is passed a single argument, the data for the call. To stop further interaction within the Flow, ...
onFailure This is a callable attribute, that, if present will be executed when ever an error occurs processing any of the children. This callable is applied with the an stack of IFlowFunction, and the current data value. The onFinish function can remedy the problem by returning a valid value, or can cancel recursi...
def iter(lst): from types import ListType, TupleType if type(lst) == type([]) or type(lst) == type(tuple()): return _ListIterator(lst) else: return lst.__iter__()
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
This is a state machine driven data consumer. Flow objects are used to run data from a producer, such as a database query, through various filter functions until the data is eventually consumed and None is returned. As data is introduced into the Flow using the 'run' method, the Flow looks up the appropriate handler,...
This is a state machine driven data consumer. Flow stages are used to run data from a producer, such as a database query, through various filter functions until the data is eventually consumed and None is returned. As data is introduced into the Flow using the 'run' method, the Flow looks up the appropriate handler, ...
def onFailure(self, state, data, failure): ''' This function attribute, if present, will be called when ever an error occurs in processing any of the children, This callable is applied with the state, and data of the failing call. Either None, or a (state, value) tuple should be returned from this function; if a tuple...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
def __init__(self, *bases): ''' Initializes a Flow object, optionally using one or more subordinate flow objects for default behavior. The stack is used when the currently executing object wants to be notified that all children have finished processing. ''' self.states = {} self.bases = bases or [] self.s...
def __init__(self): ''' Initializes a Flow object. Processing starts at initialStage and then proceeds recursively. Note that the stages are implemented as a singly-linked list, where each link is an array containing a FlowStage, and the next link. ''' self.stageHead = None self.stageTail = None self.callStack ...
def __init__(self, *bases): ''' Initializes a Flow object, optionally using one or more subordinate flow objects for default behavior. The stack is used when the currently executing object wants to be notified that all children have finished processing. ''' self.states = {} self.bases = bases or [] self.s...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
def register(self, func, state = initialState, nextState = None, isIterable = 0, onFinish = None, onFailure = None, stopValue = None): ''' This allows the registration of callback functions which are applied whenever an appropriate event of a given state is encountered. Each callback item, run, start, and finish can e...
def addStage(self, callable, onFinish = None, isIterable = None, isDynamic = None, stopValue = None, onFailure = None): ''' This appends an additional stage to the singly-linked list, starting with stageHead. ''' stage = FlowStage(callable, onFinish, isIterable, isDynamic, stopValue, onFailure) link = FlowStageLink(sta...
def register(self, func, state = initialState, nextState = None, isIterable = 0, onFinish = None, onFailure = None, stopValue = None): ''' This allows the registration of callback functions which are applied whenever an appropriate event of a given state is encountered. Each callback item, run, start, and finish can e...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None))
assert not linktail, "not implemented" stack = self.callStack if not stack: self.callStack = stack = [] link = self.stageHead stack.append((_STACK_STAGE, (link, data)))
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
(state, data, finish, itr, stop) = stack[-1] if finish: finish()
(kind, param) = stack[-1] if _STACK_FINISH == kind: param()
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
elif itr: trace("-> iterator")
if _STACK_DYNAMIC == kind: (flow, data, linknext) = param ret = flow.run(data, linknext) if ret: return ret stack.pop() continue if _STACK_ITERATOR == kind: (iterator, stop, linknext) = param
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
data = itr.next() if data is stop: continue if not state: (state, data) = data if data is stop: continue
data = iterator.next() if data is stop: continue param = (linknext, data)
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
trace("-> stop")
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
except YieldIteration: trace("-> yield")
except PauseFlow:
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
return else: stack.pop() tpl = self._lookup(state) (func, state, isIterable, finish, failure, stop) = tpl if finish: stack.append((state, None, finish, None, stop))
return 1 (link, data) = param (func, finish, isIterable, isDynamic, stop, failure) = link.stage if _STACK_STAGE == kind: stack.pop() if finish: stack.append((_STACK_FINISH,finish))
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
trace("-> item")
if data is stop: continue if isDynamic: (data, flow) = data stack.append((_STACK_DYNAMIC,(flow, data, link.next ))) continue
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
if data: data = iter(data) self.stack.append((state, None, None,data, stop)) else: if data is stop: continue if not state: (state, data) = data if data is stop: continue stack.append((state, data, None, None, stop)) trace("end flow") def __str__(self,indlvl=0): indent = "\n" + " " * indlvl indent2 = indent + " ...
iterator = iter(data) param = (iterator, stop, link.next) stack.append((_STACK_ITERATOR,param)) continue stack.append((_STACK_STAGE,(link.next,data))) def __call__(self, data): self.run(data) def testFlow(): ''' Test basic Flow operation ''' def dataSource(data): return [1, 1+data, 1+data*2] def addOne(data): return...
def run(self, data = None, state=initialState): ''' This executes the current flow, given empty starting data and the default initial state. ''' trace("running flow") stack = self.stack if not(stack): stack.append((state, data, None, None, None)) while stack: (state, data, finish, itr, stop) = stack[-1] if finish: fini...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
regular iterators, this one throws a YieldIteration exception
regular iterators, this one throws a PauseFlow exception
def __str__(self,indlvl=0): indent = "\n" + " " * indlvl indent2 = indent + " " return "%sFlow: %s%s%s%s%s" % ( indent,repr(self),indent2, indent2.join(self.states.keys()),indent, "".join(map(lambda a: a.__str__(indlvl+1), self.bases)))
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
raise YieldIteration
raise PauseFlow
def next(self): if self.buff: return self.buff.pop(0) if self.isFinished: raise StopIteration if self.failure: raise self.failure raise YieldIteration
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
f.register(CountIterator(),nextState='print',onFinish=printDone) f.register(printResult,'print')
f.addStage(CountIterator(),onFinish=printDone) f.addStage(printResult)
def printResult(x): print x
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
pool = ConnectionPool("mx.ODBC.EasySoft","PSICustomerProto")
pool = ConnectionPool("mx.ODBC.EasySoft","<somedsn>")
def testFlowConnect(): from twisted.enterprise.adbapi import ConnectionPool pool = ConnectionPool("mx.ODBC.EasySoft","PSICustomerProto") def printResult(x): print x def printDone(): print "done" f = Flow() sql = "SELECT caption from vw_date" f.register(FlowQueryIterator(pool,sql),nextState='print') f.register(printResu...
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
sql = "SELECT caption from vw_date" f.register(FlowQueryIterator(pool,sql),nextState='print') f.register(printResult,'print')
f.waitInterval = 1 f.addStage(FlowQueryIterator(pool,sql),onFinish=printDone) f.addStage(printResult)
def printDone(): print "done"
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
def testFlow(): ''' A very boring unit test for the Flow object ''' def addOne(data): return "multiplyTwo", data+1 def multiplyTwo(data): if data > 10: return "printResult", data*2 else: return "addOne", data*2 def printResult(data): print data f = Flow() f.register(addOne) f.register(addOne,"addOne") f.register(mul...
def printDone(): print "done"
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
def foo(data): return "flarbis", data / 99
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
testBadFlow()
def foo(data): return "flarbis", data / 99
4cf3103eb894bde67fe5e1250725e8ef11de7f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4cf3103eb894bde67fe5e1250725e8ef11de7f5a/flow.py
d.addCallbacks(callback=self._runTest, errback=self.deferredError)
d.addCallbacks(callback=self._runTest, errback=self.deferredError)
def _runSetUp(self): from twisted.internet import defer testDeferred = 0 self.testResult.startTest(self) try: d = self.setUp() if d is not None and isinstance(d, defer.Deferred): d.addCallbacks(callback=self._runTest, errback=self.deferredError) d.addBoth(self.cleanup) testDeferred = 1 except: self.testResult.addError(...
9cc0beb1f0b4eea1d33a40d57c996181d5788a52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9cc0beb1f0b4eea1d33a40d57c996181d5788a52/unittest.py
testResult.addError(self, self._exc_info())
self.testResult.addError(self, self._exc_info())
def _runTearDown(self, ignored=None): from twisted.internet import defer cleanupDeferred = 0 try: d = self.tearDown() if d is not None and isinstance(d, defer.Deferred): d.addErrback(self.deferredError) d.addBoth(self.cleanup) cleanupDeferred = 1 except: testResult.addError(self, self._exc_info()) for e in twisted.pyth...
9cc0beb1f0b4eea1d33a40d57c996181d5788a52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9cc0beb1f0b4eea1d33a40d57c996181d5788a52/unittest.py
state.['members'] = []
state['members'] = []
def __getstate__(self): state = self.__dict__.copy() state.['members'] = [] return state
2b338b41ec685e126e185e1a5e12a3a269ff9bb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2b338b41ec685e126e185e1a5e12a3a269ff9bb2/service.py
self.content.close()
try: self.content.close() except OSError: pass
def _cleanup(self): """Called when have finished responding and are no longer queued.""" self.channel.requestDone(self) del self.channel self.content.close() del self.content
add1306d06a2d035bd20ba972795e122729217c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/add1306d06a2d035bd20ba972795e122729217c8/http.py
basesupport.AbstractGroup.__init__(name, wordsClient, chatui)
basesupport.AbstractGroup.__init__(self, name, wordsClient, chatui)
def __init__(self, name, wordsClient, chatui): basesupport.AbstractGroup.__init__(name, wordsClient, chatui) self.joined = 0
8fc44391c7bfff958cb200cd4abaf009ea9546b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fc44391c7bfff958cb200cd4abaf009ea9546b1/pbsupport.py
self.dirlist = os.listdir(self.dirname)
try: self.dirlist = os.listdir(self.dirname) except OSError: self.dirlist = []
def listdir(self, forwards=True): """If I do not have a cached directory listing, load a directory listing and sort it according to self.cmpfunc. """ if self.dirlist is None: self.dirlist = os.listdir(self.dirname) self.dirlist.sort(self.cmpfunc) if forwards: self.pos = -1 else: self.pos = len(self.dirlist) -1 return s...
ac661cae2263be6c7dde92493fea01cd482a3624 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ac661cae2263be6c7dde92493fea01cd482a3624/filepile.py
def prefixedMethods(obj, prefix):
def prefixedMethods(obj, prefix=''):
def prefixedMethods(obj, prefix): """A list of methods with a given prefix on a given instance. """ dct = {} accumulateMethods(obj, dct, prefix) return dct.values()
805e2117cdcd996786d45c9613e7501eb23d6c45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/805e2117cdcd996786d45c9613e7501eb23d6c45/reflect.py
TrialRoot, and tells it what modules were requested on the command line. It also hands it a reporter. The TrialRoot then takes all of the packages, modules, classes and methods, and adapts them to ITestRunner objects, which it then calls the run method on.
TrialRoot, handing it a reporter, and then calls run, passing it an already-created TestSuite.
def __getattr__(self, name): return getattr(self._test, name)
b4bb59fac0c9ab1c87c6ef7b39efe2a838c18f6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b4bb59fac0c9ab1c87c6ef7b39efe2a838c18f6f/runner.py
raise TypeError("Data must be not be unicode")
raise TypeError("Data must not be unicode")
def write(self, data): """Reliably write some data.
8687742392a5e06228b2cebf295e8b2bf25a4540 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8687742392a5e06228b2cebf295e8b2bf25a4540/abstract.py
return self.clientFactory.onMade.addCallback(getProtos)
dl = defer.DeferredList([self.clientFactory.onMade, self.serverFactory.onMade]) return dl.addCallback(getProtos)
def getProtos(rlst): self.cli = self.clientFactory.theProto self.svr = self.serverFactory.theProto
07cccc7ccff4206e949cb668b89cf9edc620f7a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07cccc7ccff4206e949cb668b89cf9edc620f7a5/test_amp.py
ccl = conn.connectionLost d = defer.Deferred().addBoth(ccl) conn.connectionLost = d.callback
d = defer.Deferred().addErrback(_loseAndPass, conn) conn.connectionLost = d.errback
def tearDown(self): L = [] for conn in self.cli, self.svr: if conn.transport is not None: # depend on amp's function connection-dropping behavior ccl = conn.connectionLost d = defer.Deferred().addBoth(ccl) conn.connectionLost = d.callback conn.transport.loseConnection() L.append(d) if self.serverPort is not None: L.app...
07cccc7ccff4206e949cb668b89cf9edc620f7a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07cccc7ccff4206e949cb668b89cf9edc620f7a5/test_amp.py
L.append(self.serverPort.stopListening())
L.append(defer.maybeDeferred(self.serverPort.stopListening))
def tearDown(self): L = [] for conn in self.cli, self.svr: if conn.transport is not None: # depend on amp's function connection-dropping behavior ccl = conn.connectionLost d = defer.Deferred().addBoth(ccl) conn.connectionLost = d.callback conn.transport.loseConnection() L.append(d) if self.serverPort is not None: L.app...
07cccc7ccff4206e949cb668b89cf9edc620f7a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07cccc7ccff4206e949cb668b89cf9edc620f7a5/test_amp.py
return defer.DeferredList(L, consumeErrors=True)
return defer.DeferredList(L)
def tearDown(self): L = [] for conn in self.cli, self.svr: if conn.transport is not None: # depend on amp's function connection-dropping behavior ccl = conn.connectionLost d = defer.Deferred().addBoth(ccl) conn.connectionLost = d.callback conn.transport.loseConnection() L.append(d) if self.serverPort is not None: L.app...
07cccc7ccff4206e949cb668b89cf9edc620f7a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/07cccc7ccff4206e949cb668b89cf9edc620f7a5/test_amp.py
r = failure.trap(error.UnauthorizedLogin, TLDNotSetInRealmError)
r = failure.trap(cred_error.UnauthorizedLogin, TLDNotSetInRealmError)
def _ebLogin(self, failure): r = failure.trap(error.UnauthorizedLogin, TLDNotSetInRealmError) if r == TLDNotSetInRealmError: log.debug(failure.getErrorMessage()) self.reply(REQ_ACTN_NOT_TAKEN, 'internal server error') self.transport.loseConnection() else: self.reply(AUTH_FAILURE, '')
0b7e7ab24ad6b464659df640ed65569fcee5f05a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0b7e7ab24ad6b464659df640ed65569fcee5f05a/ftp.py
self.pipes[childFD].loseConnection()
if self.pipes.has_key(childFD): self.pipes[childFD].loseConnection()
def closeChildFD(self, childFD): # for writer pipes, loseConnection tries to write the remaining data # out to the pipe before closing it self.pipes[childFD].loseConnection()
203c8277830868d01f35eee2dbcb9da7e3b146c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/203c8277830868d01f35eee2dbcb9da7e3b146c0/process.py
file(f, 'w').write("@%s %s %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9" % (pyexe, scriptpy))
file(f, 'w').write("@%s %s %%*" % (pyexe, scriptpy))
def install(sitepackages, prefix): # bat files for pys so twisted command prompt works scripts=join(prefix, 'scripts') pyexe=join(prefix, 'python.exe') for bat in """twistd.bat mktap.bat websetroot.bat lore.bat manhole.bat tapconvert.bat trial.bat coil.bat""".split(): f=join(scripts, bat) scriptpy=f.replace('.bat', '.p...
28179e74a9d4d6f3d8c85e83f73f157eef51a6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/28179e74a9d4d6f3d8c85e83f73f157eef51a6ba/twisted_postinstall.py
self.sendUntaggedResponse('SEARCH' + ' '.join(searchResults)) self.sendPositiveResponse(tag, 'OK SEARCH completed')
if searchResults: self.sendUntaggedResponse('SEARCH ' + ' '.join(searchResults)) self.sendPositiveResponse(tag, 'SEARCH completed')
def __cbManualSearch(self, result, tag, mbox, query, uid, searchResults = None): if searchResults is None: searchResults = [] for (i, (id, msg)) in zip(range(5), result): if self.searchFilter(query, id, msg): if uid: searchResults.append(str(msg.getUID())) else: searchResults.append(str(id)) if i == 4: reactor.callLate...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
if not self.singleSearch(query, id, msg):
if not self.singleSearchStep(query, id, msg):
def searchFilter(self, query, id, msg): while query: if not self.singleSearch(query, id, msg): return False return True
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
c = query.pop(0).upper()
c = q.upper()
def singleSearchStep(self, query, id, msg): q = query.pop(0) if isinstance(q, list): if not self.searchFilter(q, id, msg): return False else: c = query.pop(0).upper() f = getattr(self, 'search_' + c) if f: if not f(query, id, msg): return False else: # IMAP goes *out of its way* to be complex # Sequence sets to search ...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend(('RFC822.HEADER', _formatHeaders(msg.getHeaders(True))))
hdrs = _formatHeaders(msg.getHeaders(True)) doLast.extend(('RFC822.HEADER', hdrs))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend(('RFC822.TEXT', msg.getBodyFile()))
doLast.extend(('RFC822.TEXT', msg.getBodyFile()))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend(('RFC822', hdrs + '\r\n' + body))
doLast.extend(('RFC822', hdrs + '\r\n' + body))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend((str(part), _formatHeaders(msg.getHeaders(True))))
doLast.extend((str(part), _formatHeaders(msg.getHeaders(True))))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend((str(part), _formatHeaders(hdrs)))
doLast.extend((str(part), _formatHeaders(hdrs, part.header.fields)))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend((str(part), subMsg.getBodyFile()))
doLast.extend((str(part), subMsg.getBodyFile()))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend((str(part), _formatHeaders(msg.getHeaders(True))))
doLast.extend((str(part), _formatHeaders(msg.getHeaders(True))))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
response.extend((str(part), _formatHeaders(msg.getHeaders(True)) + '\r\n' + subMsg.getBodyFile().read()))
doLast.extend((str(part), _formatHeaders(msg.getHeaders(True)) + '\r\n' + subMsg.getBodyFile().read()))
def _sendMessageFetchResponse(self, msgId, msg, query, uid): seenUID = False response = [] for part in query: if part.type == 'envelope': response.extend(('ENVELOPE', getEnvelope(msg))) elif part.type == 'flags': response.extend(('FLAGS', msg.getFlags())) elif part.type == 'internaldate': response.extend(('INTERNALDATE...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
hdrs = [': '.join((k, '\r\n'.join(v.splitlines()))) for (k, v) in items]
hdrs = [': '.join((k.title(), '\r\n'.join(v.splitlines()))) for (k, v) in items]
def _formatHeaders(headers, order=None): if order is not None: headers = dict([(h.lower(), v) for (h, v) in headers.iteritems()]) items = [(h, headers[h.lower()]) for h in order if h.lower() in headers] else: items = headers.iteritems() hdrs = [': '.join((k, '\r\n'.join(v.splitlines()))) for (k, v) in items] hdrs = '\r...
eb8d902d2b64789da87345b7689551f2803c111a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eb8d902d2b64789da87345b7689551f2803c111a/imap4.py
return ('enum', self.original)
return ('enum', self.values)
def toTuple(self): return ('enum', self.original)
f803947528fb6dc602fee30101646b2cc605160f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f803947528fb6dc602fee30101646b2cc605160f/typemap.py
"""A factory for SSL context objects, for server SSL connections.
""" A factory for SSL context objects for both SSL servers and clients.
def selfSignedCert(self, serialNumber, **kw): dn = DN(**kw) return PrivateCertificate.fromCertificateAndKeyPair( self.signRequestObject(dn, self.requestObject(dn), serialNumber), self)
b3b288f39cb40b0ae3697f7809a7edc3e8ef7c07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b3b288f39cb40b0ae3697f7809a7edc3e8ef7c07/_sslverify.py
isFile, name = self.wasAFile.pop(d)
isFile, name = self.wasAFile[d] del self.wasAFile[d]
def packet_HANDLE(self, data): d, data = self._parseRequest(data) isFile, name = self.wasAFile.pop(d) if isFile: cb = ClientFile(self, getNS(data)[0]) else: cb = ClientDirectory(self, getNS(data)[0]) cb.name = name d.callback(cb)
7c161ad551824db1e5ae068c15e06c6413ba06e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7c161ad551824db1e5ae068c15e06c6413ba06e7/filetransfer.py
def set_x(self, x): self.y = x self.reallySet('x',x)
a57f52c9ebce3c38d56307950e538fd29530fb19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a57f52c9ebce3c38d56307950e538fd29530fb19/test_reflect.py
def get_z(self): self.q = 1 return 1
a57f52c9ebce3c38d56307950e538fd29530fb19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a57f52c9ebce3c38d56307950e538fd29530fb19/test_reflect.py
self.results.append("a", arg)
self.results.append(("a", arg))
def a(self, arg): self.results.append("a", arg)
a57f52c9ebce3c38d56307950e538fd29530fb19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a57f52c9ebce3c38d56307950e538fd29530fb19/test_reflect.py
self.results.append("b", arg)
self.results.append(("b", arg))
def b(self, arg): self.results.append("b", arg)
a57f52c9ebce3c38d56307950e538fd29530fb19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a57f52c9ebce3c38d56307950e538fd29530fb19/test_reflect.py
def b(self, arg): self.results.append("b", arg)
a57f52c9ebce3c38d56307950e538fd29530fb19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a57f52c9ebce3c38d56307950e538fd29530fb19/test_reflect.py
return [db.getBug(self.bug_id).addCallback(self._cbBug),
return [db.getBug(self.bug_id).addCallback(self._cbBug), "\n<hr>\n",
def display(self, request): self.bug_id = int(request.args.get('bug_id',[0])[0]) db = self.database return [db.getBug(self.bug_id).addCallback(self._cbBug), db.getBugComments(self.bug_id).addCallback(self._cbComments)]
69f3d9f473b7af514e3260ad3e360aea73c3943d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/69f3d9f473b7af514e3260ad3e360aea73c3943d/gadgets.py
desc = result[0][13]
desc = result[0][12]
def _cbBug(self, result): l = [] desc = result[0][13] email = cgi.escape(result[0][2], 1) result = map(cgi.escape, result[0]) l.append('<h3>%s</h3>\n' % result[11]) l.append('<p>\n<b>Submitted by <a href="mailto:%s">%s</a> on %s</b><br>\n' % (email, result[1], result[4])) l.append('<b>Last modified:</b> %s<br>\n' % res...
69f3d9f473b7af514e3260ad3e360aea73c3943d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/69f3d9f473b7af514e3260ad3e360aea73c3943d/gadgets.py
result = map(cgi.escape, result[0])
result = map(cgi.escape, map(str, result[0]))
def _cbBug(self, result): l = [] desc = result[0][13] email = cgi.escape(result[0][2], 1) result = map(cgi.escape, result[0]) l.append('<h3>%s</h3>\n' % result[11]) l.append('<p>\n<b>Submitted by <a href="mailto:%s">%s</a> on %s</b><br>\n' % (email, result[1], result[4])) l.append('<b>Last modified:</b> %s<br>\n' % res...
69f3d9f473b7af514e3260ad3e360aea73c3943d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/69f3d9f473b7af514e3260ad3e360aea73c3943d/gadgets.py
l.append('<b>Version:<b> %s<br>\n'% result[6])
l.append('<b>Version:</b> %s<br>\n'% result[6])
def _cbBug(self, result): l = [] desc = result[0][13] email = cgi.escape(result[0][2], 1) result = map(cgi.escape, result[0]) l.append('<h3>%s</h3>\n' % result[11]) l.append('<p>\n<b>Submitted by <a href="mailto:%s">%s</a> on %s</b><br>\n' % (email, result[1], result[4])) l.append('<b>Last modified:</b> %s<br>\n' % res...
69f3d9f473b7af514e3260ad3e360aea73c3943d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/69f3d9f473b7af514e3260ad3e360aea73c3943d/gadgets.py
l.append('<b>Type:<b> %s<br>\n' % result[8])
l.append('<b>Type:</b> %s<br>\n' % result[8])
def _cbBug(self, result): l = [] desc = result[0][13] email = cgi.escape(result[0][2], 1) result = map(cgi.escape, result[0]) l.append('<h3>%s</h3>\n' % result[11]) l.append('<p>\n<b>Submitted by <a href="mailto:%s">%s</a> on %s</b><br>\n' % (email, result[1], result[4])) l.append('<b>Last modified:</b> %s<br>\n' % res...
69f3d9f473b7af514e3260ad3e360aea73c3943d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/69f3d9f473b7af514e3260ad3e360aea73c3943d/gadgets.py
preserveCase = 0 caseInsensitive = 0
def writexml(self, stream, indent='', addindent='', newl='', strip=0): stream.write("<![CDATA[") stream.write(self.nodeValue) stream.write("]]>")
9134df3589b7fbc0871d8cf8803b8a3b06659d91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9134df3589b7fbc0871d8cf8803b8a3b06659d91/microdom.py
x['host'] = tuple(x['host']) x['client'] = tuple(x['client'])
x['host'] = _addressToTuple(x['host']) x['client'] = _addressToTuple(x['client'])
def getStateToCopyFor(self, issuer): x = self.__dict__.copy() del x['transport'] # XXX refactor this attribute out; it's from protocol # del x['server'] del x['channel'] del x['content'] del x['site'] self.content.seek(0, 0) x['content_data'] = self.content.read() x['remote'] = pb.ViewPoint(issuer, self)
46643cbbf5ea405da33c1dc25a78607ea4e16a89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/46643cbbf5ea405da33c1dc25a78607ea4e16a89/server.py
return latestFunction(oldFunc)
return latestFunction(object)
def latestVersionOf(self, object): """Get the latest version of an object.
cbe508f1f736363db7c399615fd6dbfe6caa3290 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cbe508f1f736363db7c399615fd6dbfe6caa3290/rebuild.py
return latestClass(obejct)
return latestClass(object)
def latestVersionOf(self, object): """Get the latest version of an object.
cbe508f1f736363db7c399615fd6dbfe6caa3290 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cbe508f1f736363db7c399615fd6dbfe6caa3290/rebuild.py
'build_scripts': build_scripts_twisted, }
'build_scripts': build_scripts_twisted} if sys.version_info[:3] < (2, 3, 0): kw['cmdclass']['build_py'] = build_py_twisted
def setup(**kw): """ An alternative to distutils' setup() which is specially designed for Twisted subprojects. Pass twisted_subproject=projname if you want package and data files to automatically be found for you. Pass detectExtensions=detecterFunction if your project has extension modules. detecterFunction will be c...
056bbf2c5c81d90ea7863b97ff6c4acb2808bd9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/056bbf2c5c81d90ea7863b97ff6c4acb2808bd9b/dist.py
log.msg('continuing gex group')
def _continueGEX_GROUP(self, ignored, pubKey, f, signature): log.msg('continuing gex group') serverKey = keys.getPublicKeyObject(data = pubKey) sharedSecret = _MPpow(f, self.x, DH_PRIME) h = sha.new() h.update(NS(self.ourVersionString)) h.update(NS(self.otherVersionString)) h.update(NS(self.ourKexInitPayload)) h.update...
8b23e7d9ae34300843f05e62d44998aa4c80240c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8b23e7d9ae34300843f05e62d44998aa4c80240c/transport.py
log.msg('continuing gex reply %s'%ignored)
def _continueGEX_REPLY(self, ignored, pubKey, f, signature): log.msg('continuing gex reply %s'%ignored) serverKey = keys.getPublicKeyObject(data = pubKey) sharedSecret = _MPpow(f, self.x, self.p) h = sha.new() h.update(NS(self.ourVersionString)) h.update(NS(self.otherVersionString)) h.update(NS(self.ourKexInitPayload))...
8b23e7d9ae34300843f05e62d44998aa4c80240c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8b23e7d9ae34300843f05e62d44998aa4c80240c/transport.py
in this file should be \r\n-style.
in this file should be \\r\\n-style.
def append(self, mailbox, message, flags = (), date = None): """Add the given message to the currently selected mailbox
5d07d646317cba03dae3d21022861b9408fff275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5d07d646317cba03dae3d21022861b9408fff275/imap4.py
d.addCallback(lambda _: reactor.stop)
d.addCallback(lambda _: reactor.stop())
def run(argv=sys.argv): opt=TksetupOptions() try: opt.parseOptions(argv[1:]) except usage.UsageError, e: print str(opt) print str(e) sys.exit(1) root=Tkinter.Tk() root.title('One Moment.') root.withdraw() root.protocol('WM_DELETE_WINDOW', reactor.stop) tksupport.install(root) prog=ProgressBar(root, value=0, labelColo...
0aca80c9fbd2c3262ec4ddeb461a3abaaa22f5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0aca80c9fbd2c3262ec4ddeb461a3abaaa22f5f9/tkunzip.py
"""Get the identies in the db. Used by web admin interface.
"""Get the identities in the db. Used by web admin interface.
def getIdentities(self): """Get the identies in the db. Used by web admin interface. """ sql="""SELECT identity_name, password, (SELECT count(*) FROM twisted_perspectives WHERE twisted_perspectives.identity_name = twisted_identities.identity_name) FROM twisted_identities""" return self.runQuery(sql)
d7dc7d3ae88e73f3b29886f327b959a201193ce0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7dc7d3ae88e73f3b29886f327b959a201193ce0/dbcred.py
return defer.fail(defer.failure.Failure( Error(400,"unknown authorization type")))
return defer.fail(defer.failure.Failure(MalformedAuthentication))
def authenticate(self, request): method = request.method auth = request.getHeader('Authorization') if not auth: self.requestAuthentication(request) return defer.succeed(False) (authtype, auth) = auth.split(" ", 1) if 'Digest' != authtype: # is not there a better way to wrap an exception? return defer.fail(defer.failure...
52482b65e90682cb9571f422a75ae1a278bccffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/52482b65e90682cb9571f422a75ae1a278bccffa/digest.py
return defer.fail(defer.failure.Failure( Error(400,"mailformed credentials")))
return defer.fail(defer.failure.Failure(MalformedAuthentication))
def authenticate(self, request): method = request.method auth = request.getHeader('Authorization') if not auth: self.requestAuthentication(request) return defer.succeed(False) (authtype, auth) = auth.split(" ", 1) if 'Digest' != authtype: # is not there a better way to wrap an exception? return defer.fail(defer.failure...
52482b65e90682cb9571f422a75ae1a278bccffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/52482b65e90682cb9571f422a75ae1a278bccffa/digest.py
data = Data("<html><body>protected resource</body></head>","text/html")
data = Data("<html><body>protected resource</body></head>\n","text/html")
def test(): from twisted.internet import reactor from twisted.web.server import Site from twisted.web.static import Data realm = "tag:clarkevans.com,2002:testing" data = Data("<html><body>protected resource</body></head>","text/html") def gethash(realm,username): """ dummy password hash, where user password is just re...
52482b65e90682cb9571f422a75ae1a278bccffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/52482b65e90682cb9571f422a75ae1a278bccffa/digest.py
return dsplit[0].upper(), _funcs[dsplit[0]](factory, *args, **kw)
return (dsplit[0].upper(),)+_funcs[dsplit[0]](factory, *args, **kw)
def parse(description, factory): if ':' not in description: description = 'tcp:'+description dsplit = description.split(":") args = [arg for arg in dsplit[1:] if '=' not in arg] kw = {} for (name, val) in [arg.split('=', 1) for arg in dsplit if '=' in arg]: kw[name] = val return dsplit[0].upper(), _funcs[dsplit[0]](fac...
29c2f22811c6d6d21edb1fee64df27061b15666a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/29c2f22811c6d6d21edb1fee64df27061b15666a/ports.py
name, (args, kw) = parse(description, factory)
name, args, kw = parse(description, factory)
def service(description, factory): from twisted.application import internet name, (args, kw) = parse(description, factory) return getattr(internet, name+'Server')(*args, **kw)
29c2f22811c6d6d21edb1fee64df27061b15666a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/29c2f22811c6d6d21edb1fee64df27061b15666a/ports.py
name, (args, kw) = parse(description, factory)
name, args, kw = parse(description, factory)
def listen(description, factory): from twisted.internet import reactor name, (args, kw) = parse(description, factory) return getattr(reactor, 'listen'+name)(*args, **kw)
29c2f22811c6d6d21edb1fee64df27061b15666a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/29c2f22811c6d6d21edb1fee64df27061b15666a/ports.py
def write(stuff): """Write some data to the log. DEPRECATED. Use L{msg} instead.""" warnings.warn("Use log.msg, not log.write.", DeprecationWarning, stacklevel=2) msg(str(stuff)) def debug(*stuff,**otherstuff): """ Write some debug data to the log. It passes debug=1 in the log dict. DEPRECATED (Since Twisted 2.1): P...
def callWithLogger(logger, func, *args, **kw): """ Utility method which wraps a function in a try:/except:, logs a failure if one occurrs, and uses the system's logPrefix. """ try: lp = logger.logPrefix() except KeyboardInterrupt: raise except: lp = '(buggy logPrefix method)' err(system=lp) try: return callWithContext(...
1b7562e6c25153400d8fc8466bf93de84b049a75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1b7562e6c25153400d8fc8466bf93de84b049a75/log.py