Exemplo 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
Exemplo n.º 2
0
def install():
    """
	Install the epoll() reactor.
	"""
    p = EPollReactor()
    from lib.twisted.internet.main import installReactor
    installReactor(p)
Exemplo 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
Exemplo 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)
Exemplo 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
Exemplo n.º 6
0
def install():
	"""
	Install the epoll() reactor.
	"""
	p = EPollReactor()
	from lib.twisted.internet.main import installReactor
	installReactor(p)
Exemplo 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
Exemplo 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)
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo n.º 12
0
def install():
    k = KQueueReactor()
    main.installReactor(k)
Exemplo n.º 13
0
def install():
	k = KQueueReactor()
	main.installReactor(k)
Exemplo 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)
Exemplo n.º 15
0
def install():
	r = IOCPReactor()
	main.installReactor(r)
Exemplo 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)
Exemplo n.º 17
0
def install():
    r = IOCPReactor()
    main.installReactor(r)