def portableInstall(): """Configure the twisted mainloop to be run inside the gtk mainloop. """ reactor = PortableGtkReactor() from lib.twisted.internet.main import installReactor installReactor(reactor) return reactor
def install(): """ Install the epoll() reactor. """ p = EPollReactor() from lib.twisted.internet.main import installReactor installReactor(p)
def install(runLoop=None, runner=None): """ Configure the twisted mainloop to be run inside CFRunLoop. @param runLoop: the run loop to use. @param runner: the function to call in order to actually invoke the main loop. This will default to L{CFRunLoopRun} if not specified. However, this is not an appropriate choice for GUI applications, as you need to run NSApplicationMain (or something like it). For example, to run the Twisted mainloop in a PyObjC application, your C{main.py} should look something like this:: from PyObjCTools import AppHelper from lib.twisted.internet.cfreactor import install install(runner=AppHelper.runEventLoop) # initialize your application reactor.run() @return: The installed reactor. @rtype: L{CFReactor} """ reactor = CFReactor(runLoop=runLoop, runner=runner) from lib.twisted.internet.main import installReactor installReactor(reactor) return reactor
def install(): """ Configure the twisted mainloop to be run inside the glib mainloop. """ reactor = Glib2Reactor() from lib.twisted.internet.main import installReactor installReactor(reactor)
def install(): """ Configure the twisted mainloop to be run inside the wxPython mainloop. """ reactor = WxReactor() from lib.twisted.internet.main import installReactor installReactor(reactor) return reactor
def install(useGtk=True): """ Configure the twisted mainloop to be run inside the gtk mainloop. @param useGtk: should glib rather than GTK+ event loop be used (this will be slightly faster but does not support GUI). """ reactor = Gtk2Reactor(useGtk) from lib.twisted.internet.main import installReactor installReactor(reactor) return reactor
def install(): k = KQueueReactor() main.installReactor(k)
def install(): """Configure the twisted mainloop to be run using the select() reactor. """ reactor = SelectReactor() from lib.twisted.internet.main import installReactor installReactor(reactor)
def install(): r = IOCPReactor() main.installReactor(r)