• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python main.installReactor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中twisted.internet.main.installReactor函数的典型用法代码示例。如果您正苦于以下问题:Python installReactor函数的具体用法?Python installReactor怎么用?Python installReactor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了installReactor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

	def __init__(self, evManager):
		self.state = ReactorSpinController.STATE_STOPPED
		self.evManager = evManager
		self.evManager.RegisterListener( self )
		self.reactor = SelectReactor()
		installReactor(self.reactor)
		self.loopingCall = LoopingCall(self.FireTick)
开发者ID:ClashTeak,项目名称:writing_games_tutorial,代码行数:7,代码来源:client.py


示例2: install

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 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 twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:BarnetteME1,项目名称:indeed_scraper,代码行数:28,代码来源:cfreactor.py


示例3: portableInstall

def portableInstall():
    """Configure the twisted mainloop to be run inside the gtk mainloop.
    """
    reactor = PortableGtkReactor()
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:galaxysd,项目名称:BitTorrent,代码行数:7,代码来源:gtkreactor.py


示例4: install

def install():
    """
    Configure the twisted mainloop to be run inside the qt mainloop.
    """
    from twisted.internet import main
    reactor = QTReactor()
    main.installReactor(reactor)
开发者ID:AlickHill,项目名称:Lantern,代码行数:7,代码来源:qt4reactor.py


示例5: install

def install():
    """
    Install the epoll() reactor.
    """
    p = EPollReactor()
    from twisted.internet.main import installReactor
    installReactor(p)
开发者ID:AndyPanda95,项目名称:python-for-android,代码行数:7,代码来源:epollreactor.py


示例6: install

def install():
    """Configure the twisted mainloop to be run using the select() reactor.
    """
    reactor = ThreadedSelectReactor()
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:JohnDoes95,项目名称:project_parser,代码行数:7,代码来源:_threadedselect.py


示例7: install

def install():
    """
    Configure the twisted mainloop to be run inside the glib mainloop.
    """
    reactor = Glib2Reactor()
    from twisted.internet.main import installReactor
    installReactor(reactor)
开发者ID:0004c,项目名称:VTK,代码行数:7,代码来源:glib2reactor.py


示例8: install

def install():
    """
    Install the Qt reactor.
    """
    p = QtReactor()
    from twisted.internet.main import installReactor
    installReactor(p)
开发者ID:FreshXOpenSource,项目名称:wallaby-frontend-qt,代码行数:7,代码来源:qtreactor.py


示例9: install

def install():
  """Install the context tracking reactor."""

  # Install logging patches.
  originalFormatter = log.textFromEventDict

  def newFormatter(*args, **kw):
    """Augmented log formatter that includes context information."""
    originalResult = originalFormatter(*args, **kw)
    values = AsyncFrame.currentFrame.getLocals()
    if values:
      originalResult += ' %r' % values
    return originalResult

  log.textFromEventDict = newFormatter


  # Patch threads.deferToThread(Pool)
  originalDeferToThreadPool = threads.deferToThreadPool

  def deferToThreadPool(*args, **kw):
    """Patches defer to thread pool to install the context when running the callback."""
    deferred = originalDeferToThreadPool(*args, **kw)
    # pylint: disable=W0212
    deferred._startRunCallbacks = wrapped(deferred._startRunCallbacks, 'Thread')
    return deferred

  threads.deferToThreadPool = deferToThreadPool


  # Overwrite the reactor.
  del sys.modules['twisted.internet.reactor']
  r = FrameTrackingReactor()
  from twisted.internet.main import installReactor
  installReactor(r)
开发者ID:yiminlong,项目名称:greplin-twisted-utils,代码行数:35,代码来源:thread.py


示例10: install

def install(app=None):
	"""
	Configure the twisted mainloop to be run inside the e2 mainloop.
	"""
	from twisted.internet import main
	reactor = e2reactor()
	main.installReactor(reactor)
开发者ID:st7TEAM,项目名称:dreambox,代码行数:7,代码来源:e2reactor.py


示例11: install

def install():
    """
    Install the kqueue() reactor.
    """
    p = KQueueReactor()
    from twisted.internet.main import installReactor
    installReactor(p)
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:7,代码来源:kqreactor.py


示例12: posixinstall

def posixinstall():
    """
    Install the Qt reactor.
    """

    from twisted.internet.main import installReactor
    p = QtReactor()
    installReactor(p)
开发者ID:joepie91,项目名称:aether-public,代码行数:8,代码来源:qt5reactor.py


示例13: install

def install():
    """
    Configure the twisted mainloop to be run inside the npyscreen mainloop.
    """
    reactor = NpyscreenReactor()
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:dummys,项目名称:npyscreenreactor,代码行数:8,代码来源:__init__.py


示例14: install

def install():
    """
    Setup Twisted+Pyglet integration based on the Pyglet event loop.
    """
    reactor = PygletReactor()
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:kendase3,项目名称:pyglet-twisted,代码行数:8,代码来源:pygletreactor.py


示例15: win32install

def win32install():
    """
    Install the Qt reactor.
    """
    p = QtEventReactor()
    from twisted.internet.main import installReactor
    installReactor(p)
    return p
开发者ID:pyrf,项目名称:qtreactor,代码行数:8,代码来源:qt4reactor.py


示例16: install

def install(io_loop=None):
    """Install this package as the default Twisted reactor."""
    if not io_loop:
        io_loop = IOLoop.instance()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:dvdotsenko,项目名称:pfkaplr,代码行数:8,代码来源:twisted.py


示例17: win32install

def win32install():
    """
    Install the Qt reactor.
    """
    p = pyqt4eventreactor()
    from twisted.internet.main import installReactor

    installReactor(p)
开发者ID:brianbirke,项目名称:qtreactor,代码行数:8,代码来源:pyside4reactor.py


示例18: posixinstall

def posixinstall():
    """
    Install the Qt reactor.
    """
    p = pyqt4reactor()
    from twisted.internet.main import installReactor

    installReactor(p)
开发者ID:brianbirke,项目名称:qtreactor,代码行数:8,代码来源:pyside4reactor.py


示例19: install

def install(runLoop=None):
    """Configure the twisted mainloop to be run inside CFRunLoop.
    """
    reactor = CFReactor(runLoop=runLoop)
    reactor.addSystemEventTrigger('after', 'shutdown', reactor.cleanup)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:8,代码来源:cfreactor.py


示例20: install

def install(io_loop=None):
    """Install this package as the default Twisted reactor."""
    if not io_loop:
        io_loop = webalchemy.tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
开发者ID:C4ptainCrunch,项目名称:webalchemy,代码行数:8,代码来源:twisted.py



注:本文中的twisted.internet.main.installReactor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pollreactor.install函数代码示例发布时间:2022-05-27
下一篇:
Python kqreactor.install函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap