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

Python reactor.removeSystemEventTrigger函数代码示例

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

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



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

示例1: removeTrigger

 def removeTrigger(self, trigger):
     """
     Remove a trigger by its handle from the reactor and from
     C{self.triggers}.
     """
     reactor.removeSystemEventTrigger(trigger)
     self.triggers.remove(trigger)
开发者ID:Alberto-Beralix,项目名称:Beralix,代码行数:7,代码来源:test_internet.py


示例2: shutdown

 def shutdown(self):
     """Shutdown the worker thread.
     """
     self._q.put(self.SHUTDOWN)
     if self._shutdownTriggerId is not None:
         reactor.removeSystemEventTrigger(self._shutdownTriggerId)
         self._shutdownTriggerId = None
开发者ID:timparkin,项目名称:into-the-light,代码行数:7,代码来源:laxdb.py


示例3: processEnded

 def processEnded(self, status_object):
     if self.shutdown_trigger:
         reactor.removeSystemEventTrigger(self.shutdown_trigger)
         self.shutdown_trigger = None
     self.deferred.callback(status_object.value.exitCode)
     for d in self.shutdown_deferreds:
         d.callback(status_object.value.exitCode)
开发者ID:PR2,项目名称:linux_networking,代码行数:7,代码来源:system.py


示例4: shutdown

 def shutdown(self):
     self.shutting_down = True
     try:
         reactor.removeSystemEventTrigger(self.shutdown_trigger)
     except ValueError:
         pass # We may have been called automatically at shutdown.
     if self.proc:
         self.proc.signalProcess("INT")
开发者ID:PR2,项目名称:linux_networking,代码行数:8,代码来源:command_with_output.py


示例5: shutdown

 def shutdown(self):
     """Manually stop the pool.  This is only necessary from tests, as the
     pool will stop itself when the reactor stops under normal
     circumstances."""
     if not self._stop_evt:
         return # pool is already stopped
     reactor.removeSystemEventTrigger(self._stop_evt)
     self._stop()
开发者ID:cdavis5x,项目名称:buildbot,代码行数:8,代码来源:pool.py


示例6: close

 def close(self):
     """Close all pool connections and shutdown the pool"""
     if self.shutdownID:
         reactor.removeSystemEventTrigger(self.shutdownID)
         self.shutdownID = None
     if self.startID:
         reactor.removeSystemEventTrigger(self.startID)
         self.startID = None
     self.finalClose()
开发者ID:rolando-archive,项目名称:txrho,代码行数:9,代码来源:xapian.py


示例7: clean_up

 def clean_up(failure):
     if self.missing_timer is not None:
         self.missing_timer.cancel()
         self._substantiation_failed(failure)
     if self._shutdown_callback_handle is not None:
         handle = self._shutdown_callback_handle
         del self._shutdown_callback_handle
         reactor.removeSystemEventTrigger(handle)
     return failure
开发者ID:ABI-Software,项目名称:buildbot,代码行数:9,代码来源:base.py


示例8: insubstantiate

 def insubstantiate(self, fast=False):
     self._clearBuildWaitTimer()
     d = self.stop_instance(fast)
     if self._shutdown_callback_handle is not None:
         handle = self._shutdown_callback_handle
         del self._shutdown_callback_handle
         reactor.removeSystemEventTrigger(handle)
     self.substantiated = False
     self.building.clear() # just to be sure
     return d
开发者ID:Fieldbyte,项目名称:buildbot,代码行数:10,代码来源:buildslave.py


示例9: tearDown

 def tearDown(self):
     """
     Remove all remaining triggers from the reactor.
     """
     while self.triggers:
         trigger = self.triggers.pop()
         try:
             reactor.removeSystemEventTrigger(trigger)
         except (ValueError, KeyError):
             pass
开发者ID:Alberto-Beralix,项目名称:Beralix,代码行数:10,代码来源:test_internet.py


示例10: __init__

	def __init__(self, dbapiName, *connargs, **connkw):
		"""
		Create a new instance of the connection pool.
		
		This overridden constructor makes sure the Twisted reactor
		doesn't get started in non-twisted.web-hosted environments.
		"""
		TimeoutConnectionPool.__init__(self, dbapiName, *connargs, **connkw)
		from twisted.internet import reactor
		if(self.startID):
			reactor.removeSystemEventTrigger(self.startID)
开发者ID:philchristensen,项目名称:modu,代码行数:11,代码来源:dbapi.py


示例11: _cleanThreads

 def _cleanThreads(self):
     reactor = self._getReactor()
     if interfaces.IReactorThreads.providedBy(reactor):
         reactor.suggestThreadPoolSize(0)
         if getattr(reactor, "threadpool", None) is not None:
             try:
                 reactor.removeSystemEventTrigger(reactor.threadpoolShutdownID)
             except KeyError:
                 pass
             # Remove the threadpool, and let the reactor put it back again
             # later like a good boy
             reactor._stopThreadPool()
开发者ID:radical-software,项目名称:radicalspam,代码行数:12,代码来源:util.py


示例12: stop

    def stop(self):
        log.msg("IRCBotPlugin stopping...")
        if self.shutdown_trigger is not None:
            reactor.removeSystemEventTrigger(self.shutdown_trigger)
        self.stopTrying()
        if self.client:
            log.msg("Sending quit message")
            self.client.quit("Daisy, daisy...")

        # The server should disconnect us after a QUIT command, but just in
        # case, terminate the connection after 5 seconds.
        reactor.callLater(5, self.connector.disconnect)
开发者ID:L3viathan,项目名称:abbott,代码行数:12,代码来源:irc.py


示例13: insubstantiate

 def insubstantiate(self, fast=False):
     self.insubstantiating = True
     self._clearBuildWaitTimer()
     d = self.stop_instance(fast)
     if self._shutdown_callback_handle is not None:
         handle = self._shutdown_callback_handle
         del self._shutdown_callback_handle
         reactor.removeSystemEventTrigger(handle)
     self.substantiated = False
     self.building.clear()  # just to be sure
     yield d
     self.insubstantiating = False
     self.botmaster.maybeStartBuildsForWorker(self.name)
开发者ID:gracinet,项目名称:buildbot,代码行数:13,代码来源:base.py


示例14: unmapRTP

 def unmapRTP(self):
     from xshtoom.nat import getMapper
     if self.needSTUN is False:
         return defer.succeed(None)
     # Currently removing an already-fired trigger doesn't hurt,
     # but this seems likely to change.
     try:
         reactor.removeSystemEventTrigger(self._shutdownHook)
     except:
         pass
     d = getMapper()
     d.addCallback(self._cb_unmap_gotMapper)
     return d
开发者ID:habnabit,项目名称:divmod-sine,代码行数:13,代码来源:protocol.py


示例15: _stopServer

 def _stopServer(self, *ignored):
     self.stopping = True
     try:
         yield self._dispatch(self.stopServer)
     except Exception as e:
         self._error = failure.Failure(e)
     finally:
         try:
             self._cxn.disconnect()
         except Exception:
             pass
         # remove the event trigger, so we don't get
         # called again if the reactor shuts down later
         if hasattr(self, '_shutdownID'):
             reactor.removeSystemEventTrigger(self._shutdownID)
开发者ID:labrad,项目名称:pylabrad,代码行数:15,代码来源:server.py


示例16: shutdown

 def shutdown( self ):
     
     logger.debug( "Cleaning up before shutdown." )
     
     if self.shutdown_trigger_id is not None:        
         reactor.removeSystemEventTrigger( self.shutdown_trigger_id )
     
     deferreds = []
     
     if self.site is not None:
         logger.debug( "Stopping listening on main HTTP interface." )
         d = self.site_port.stopListening()
         if isinstance(d, Deferred):
             deferreds.append( d )
     
     if self.web_admin_site is not None:
         logger.debug( "Stopping listening on web admin interface." )
         d = self.web_admin_site_port.stopListening()
         if isinstance(d, Deferred):
             deferreds.append( d )
             
     if self.coordinateloop is not None:
         logger.debug( "Stopping coordinating loop." )
         d = self.coordinateloop.stop()
         if isinstance(d, Deferred):
             deferreds.append( d )
             
     if self.queryloop is not None:
         logger.debug( "Stopping query loop." )
         d = self.queryloop.stop()
         if isinstance(d, Deferred):
             deferreds.append( d )
             
     if self.aws_sdb_coordination_domain is not None:
         logger.debug( "Removing data from SDB coordination domain." )
         d = self.sdb.delete( self.aws_sdb_coordination_domain, self.uuid )
         d.addCallback(self._cleanupBeforeShutdown)
         d.addCallback(self.peerCheckRequest)
         deferreds.append( d )
     
     if len( deferreds ) > 0:
         logger.debug( "Combinining deferred shutdown processes." )
         d = DeferredList( deferreds )
         d.addCallback( self._shutdownCallback )
         return d
     else:
         logger.debug( "No deferred processes." )
         return self._shutdownCallback( None )
开发者ID:pombredanne,项目名称:awspider,代码行数:48,代码来源:__init__.py


示例17: cleanup

 def cleanup(self):
     """
     Cleans up the reactor stuff.
     @rtype: L{twisted.defer.DeferredList}
     """
     log.info("_cleanup the Master")
     deferreds = []
     reactor.removeSystemEventTrigger(self._shutdown_event_id)
     # quit all slaves
     for command in self.get_all_commands():
         if command.slave_state == STATE_RUNNING:
             deferreds.append(command.quit_slave())
     # stop the master's loop
     if self._looping_call.running:
         d = self._looping_call.deferred
         self._looping_call.stop() # FIXME
         deferreds.append(d)
     return defer.DeferredList(deferreds)
开发者ID:aalex,项目名称:ubuntu-lunch,代码行数:18,代码来源:master.py


示例18: _cancelCleanup

 def _cancelCleanup(self, result, call_id):
     reactor.removeSystemEventTrigger(call_id)
     return result
开发者ID:marineam,项目名称:nagcat,代码行数:3,代码来源:query_oracle.py


示例19: shutdown

 def shutdown(self):
     """End the pending webclient calls."""
     self.running = False
     # pylint: disable=E1101
     reactor.removeSystemEventTrigger(self.trigger_id)
开发者ID:Alberto-Beralix,项目名称:Beralix,代码行数:5,代码来源:txwebclient.py


示例20: tearDown

 def tearDown(self):
     for t in self.triggers:
         try:
             reactor.removeSystemEventTrigger(t)
         except:
             pass
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:6,代码来源:test_internet.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python reactor.resolve函数代码示例发布时间:2022-05-27
下一篇:
Python reactor.removeReader函数代码示例发布时间: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