当前位置: 首页>>代码示例>>Python>>正文


Python Basic.validate_result方法代码示例

本文整理汇总了Python中common.utils.Basic.validate_result方法的典型用法代码示例。如果您正苦于以下问题:Python Basic.validate_result方法的具体用法?Python Basic.validate_result怎么用?Python Basic.validate_result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common.utils.Basic的用法示例。


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

示例1: _on_bank_stopped

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _on_bank_stopped(self, result):
   Basic.validate_result(result, "bank_stopped")
   #now stop tor:
   log_msg("Waiting for Tor to shut down...", 3)
   d = None
   if self.torApp:
     d = self.torApp.stop()
   if not d:
     d = self._on_tor_stopped(True)
   else:
     d.addCallback(self._on_tor_stopped)
     d.addErrback(self._on_tor_stopped)
   return d
开发者ID:clawplach,项目名称:BitBlinder,代码行数:15,代码来源:BitBlinder.py

示例2: _on_applications_stopped

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _on_applications_stopped(self, result):
   Basic.validate_result(result, "applications_stopped")
   self.isReady = False
   HTTPClient.stop_all()
   #now stop the bank:
   log_msg("Waiting for the bank to shut down...", 3)
   d = None
   if self.bankApp:
     d = self.bankApp.stop()
   if not d:
     d = self._on_bank_stopped(True)
   else:
     d.addCallback(self._on_bank_stopped)
     d.addErrback(self._on_bank_stopped)
   return d
开发者ID:clawplach,项目名称:BitBlinder,代码行数:17,代码来源:BitBlinder.py

示例3: _startup_success

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _startup_success(self, result):
   self.startupDeferred = None
   self.isReady = True
   result = Basic.validate_result(result, "BitBlinder startup")
   if not result:
     self.stop()
   self._trigger_event("started")
   return result
开发者ID:clawplach,项目名称:BitBlinder,代码行数:10,代码来源:BitBlinder.py

示例4: _shutdown

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _shutdown(self, result):
   """Stop the main loop and cause the program to exit.
   This should ONLY be called after all Applications are shut down cleanly."""
   Basic.validate_result(result, "MainLoop::_shutdown")
   #close the server that listens for new versions of the app to start up:
   StartupServer.stop()
   #remove scheduled events:
   if self.updateEvent and self.updateEvent.active():
     self.updateEvent.cancel()
   ProgramState.DO_UPDATES = False
   self.updateEvent = None
   GlobalEvents.throw_event("shutdown")
   log_msg("Done with shutdown deferreds", 4)
   #close the main loop
   if ProgramState.USE_GTK:
     try:
       gtk.main_quit()
     except Exception, error:
       log_ex(error, "Couldn't kill the gtk main loop")
开发者ID:clawplach,项目名称:BitBlinder,代码行数:21,代码来源:MainLoop.py

示例5: _stop_done

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _stop_done(self, result):
   Basic.validate_result(result, "BitTorrentWindow::_stop_done")
   if not BitBlinder.get().is_running():
     GlobalEvents.throw_event("quit_signal")
   else:
     #are there any other apps using bitblinder?
     for app in BitBlinder.get().applications.values():
       #if there is another app, dont bother shutting down everything
       if app.is_running() and app != Bank.get():
         return
     #ok, check if there is a relay then
     if Tor.get().settings.beRelay:
       #then we should prompt about shutdown
       def callback(dialog, response):
         if response == gtk.RESPONSE_YES:
           self._do_quit()
       msgText = "BitBlinder is acting as a server and help others be anonymous, and earning you more credits!\n\nDo you also want to stop the server?"
       GUIController.get().show_preference_prompt(msgText, "Stop Relay?", callback, "promptAboutRelayQuit")
     else:
       #otherwise shutdown completely:
       self._do_quit()
开发者ID:clawplach,项目名称:BitBlinder,代码行数:23,代码来源:BitTorrentWindow.py

示例6: _stop_when_started

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _stop_when_started(self, result, cancelDeferred):
   Basic.validate_result(result, "_stop_when_started")
   self.stop().chainDeferred(cancelDeferred)
开发者ID:clawplach,项目名称:BitBlinder,代码行数:5,代码来源:Application.py

示例7: _quit_done

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _quit_done(self, result):
   Basic.validate_result(result, "BitTorrentWindow::_quit_done")
   GlobalEvents.throw_event("quit_signal")
开发者ID:clawplach,项目名称:BitBlinder,代码行数:5,代码来源:BitTorrentWindow.py

示例8: _on_tor_stopped

# 需要导入模块: from common.utils import Basic [as 别名]
# 或者: from common.utils.Basic import validate_result [as 别名]
 def _on_tor_stopped(self, result):
   Basic.validate_result(result, "tor_stopped")
   log_msg("BitBlinder finished.", 3)
   #finally done shutting down
   return defer.succeed(True)
开发者ID:clawplach,项目名称:BitBlinder,代码行数:7,代码来源:BitBlinder.py


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