當前位置: 首頁>>代碼示例>>Python>>正文


Python error.ReactorNotRunning方法代碼示例

本文整理匯總了Python中twisted.internet.error.ReactorNotRunning方法的典型用法代碼示例。如果您正苦於以下問題:Python error.ReactorNotRunning方法的具體用法?Python error.ReactorNotRunning怎麽用?Python error.ReactorNotRunning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在twisted.internet.error的用法示例。


在下文中一共展示了error.ReactorNotRunning方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: goodbye

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def goodbye(reason):
        """
        Stop the process if stdin is closed.
        """
        try:
            reactor.stop()
        except ReactorNotRunning:
            pass
        return origLost(reason) 
開發者ID:apple,項目名稱:ccs-twistedextensions,代碼行數:11,代碼來源:spawnsvc.py

示例2: clientConnectionFailed

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def clientConnectionFailed(self, connector, reason):
        self.rx._callback('error', 'connection %s failed, reason=%s' % (connector, reason))
        if reactor.running:
            try: 
                reactor.stop()
            except error.ReactorNotRunning:
		pass 
開發者ID:rstms,項目名稱:txTrader,代碼行數:9,代碼來源:monitor.py

示例3: clientConnectionLost

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def clientConnectionLost(self, connector, reason):
        self.rx._callback('error', 'connection %s lost, reason=%s' % (connector, reason))
        if reactor.running:
            try:
                reactor.stop()
            except error.ReactorNotRunning:
		pass 
開發者ID:rstms,項目名稱:txTrader,代碼行數:9,代碼來源:monitor.py

示例4: stop

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def stop(self):
        """
        See twisted.internet.interfaces.IReactorCore.stop.
        """
        if self._stopped:
            raise error.ReactorNotRunning(
                "Can't stop reactor that isn't running.")
        self._stopped = True
        self._justStopped = True
        self._startedBefore = True 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:12,代碼來源:base.py

示例5: stop

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def stop(self):
        """
        Stop the reactor.
        """
        if not self._running:
            raise error.ReactorNotRunning()
        self._running = False 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:9,代碼來源:test_task.py

示例6: postStartService

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def postStartService(self):
        """
        Quit right away
        """
        from twisted.internet import reactor
        from twisted.internet.error import ReactorNotRunning
        try:
            reactor.stop()
        except ReactorNotRunning:
            # I don't care.
            pass 
開發者ID:apple,項目名稱:ccs-calendarserver,代碼行數:13,代碼來源:upgrade.py

示例7: fatal_error

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def fatal_error(stop_reactor=True):
    global __system_failed
    __system_failed = True

    if stop_reactor:
        try:
            reactor.stop()
        except ReactorNotRunning:
            pass 
開發者ID:svpcom,項目名稱:wifibroadcast,代碼行數:11,代碼來源:common.py

示例8: stop

# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def stop(self):
        """
        See twisted.internet.interfaces.IReactorCore.stop.
        """
        if self._stopped:
            raise error.ReactorNotRunning(
                "Can't stop reactor that isn't running.")
        self._stopped = True
        self._justStopped = True 
開發者ID:kuri65536,項目名稱:python-for-android,代碼行數:11,代碼來源:base.py


注:本文中的twisted.internet.error.ReactorNotRunning方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。