Esempio n. 1
0
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
Esempio n. 2
0
def install():
    """
	Install the epoll() reactor.
	"""
    p = EPollReactor()
    from lib.twisted.internet.main import installReactor
    installReactor(p)
Esempio n. 3
0
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
Esempio n. 4
0
def install():
	"""
	Configure the twisted mainloop to be run inside the glib mainloop.
	"""
	reactor = Glib2Reactor()
	from lib.twisted.internet.main import installReactor
	installReactor(reactor)
Esempio n. 5
0
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
Esempio n. 6
0
def install():
	"""
	Install the epoll() reactor.
	"""
	p = EPollReactor()
	from lib.twisted.internet.main import installReactor
	installReactor(p)
Esempio n. 7
0
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
Esempio n. 8
0
def install():
    """
	Configure the twisted mainloop to be run inside the glib mainloop.
	"""
    reactor = Glib2Reactor()
    from lib.twisted.internet.main import installReactor
    installReactor(reactor)
Esempio n. 9
0
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
Esempio n. 10
0
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
Esempio n. 11
0
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
Esempio n. 12
0
def install():
    k = KQueueReactor()
    main.installReactor(k)
Esempio n. 13
0
def install():
	k = KQueueReactor()
	main.installReactor(k)
Esempio n. 14
0
def install():
    """Configure the twisted mainloop to be run using the select() reactor.
	"""
    reactor = SelectReactor()
    from lib.twisted.internet.main import installReactor
    installReactor(reactor)
Esempio n. 15
0
def install():
	r = IOCPReactor()
	main.installReactor(r)
Esempio n. 16
0
def install():
	"""Configure the twisted mainloop to be run using the select() reactor.
	"""
	reactor = SelectReactor()
	from lib.twisted.internet.main import installReactor
	installReactor(reactor)
Esempio n. 17
0
def install():
    r = IOCPReactor()
    main.installReactor(r)