本文整理汇总了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)
示例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
示例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
示例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
示例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
示例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
示例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
示例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