1
'''Reactor utilities.'''
4
def get_exitcode_reactor():
6
This is only neccesary until a fix like the one outlined here is
7
implemented for Twisted:
8
http://twistedmatrix.com/trac/ticket/2182
10
from twisted.internet.main import installReactor
11
from twisted.internet.selectreactor import SelectReactor
13
class ExitCodeReactor(SelectReactor):
15
def stop(self, exitStatus=0):
16
super(ExitCodeReactor, self).stop()
17
self.exitStatus = exitStatus
19
def run(self, *args, **kwargs):
20
super(ExitCodeReactor, self).run(*args, **kwargs)
21
return self.exitStatus
23
reactor = ExitCodeReactor()
24
installReactor(reactor)
29
reactor = get_exitcode_reactor()
31
from twisted.internet import reactor