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


Python Core.detect_frontends方法代码示例

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


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

示例1: len

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import detect_frontends [as 别名]
                    help = "Autodetect available workers and add them to the instance")
  parser.add_option("--add-example-work-sources", action = "store_true", default = False,
                    help = "Add the example work sources to the instance")
  (options, args) = parser.parse_args()
  
  # Figure out instance name
  if len(args) == 0: instancename = "default"
  elif len(args) == 1: instancename = args[0]
  else: parser.error("Incorrect number of arguments")

  # Create core instance, will load saved instance state if present
  core = Core(instance = instancename, default_loglevel = options.default_loglevel)
  
  # Autodetect appropriate frontends if requested or if a new instance is being set up
  if options.detect_frontends or core.is_new_instance:
    core.detect_frontends()
  
  # Autodetect available workers if requested or if a new instance is being set up
  if options.detect_workers or core.is_new_instance:
    core.detect_workers()

  # Add example work sources if requested or if a new instance is being set up
  if options.add_example_work_sources or core.is_new_instance:
    from core.blockchain import Blockchain
    from core.worksourcegroup import WorkSourceGroup
    from modules.theseven.bcjsonrpc.bcjsonrpcworksource import BCJSONRPCWorkSource
    # Find the Bitcoin block chain, or create it if neccessary
    blockchain = core.get_blockchain_by_name("Bitcoin")
    if not blockchain:
      blockchain = Blockchain(core)
      blockchain.settings.name = "Bitcoin"
开发者ID:ARudik,项目名称:ardulon-miner,代码行数:33,代码来源:run-mpbm.py


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