本文整理汇总了Python中core.core.Core.set_root_work_source方法的典型用法代码示例。如果您正苦于以下问题:Python Core.set_root_work_source方法的具体用法?Python Core.set_root_work_source怎么用?Python Core.set_root_work_source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.core.Core
的用法示例。
在下文中一共展示了Core.set_root_work_source方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WorkSourceGroup
# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import set_root_work_source [as 别名]
newroot = WorkSourceGroup(core)
# Copy the old root work source's name to the new one
newroot.settings.name = usersources.settings.name
# Reconfigure the old root work source
usersources.settings.name = "User work sources"
usersources.settings.priority = 1000
usersources.apply_settings()
newroot.add_work_source(usersources)
# Create example work source group
examplesources = WorkSourceGroup(core)
examplesources.settings.name = "Example/donation work sources"
examplesources.settings.priority = 10
examplesources.apply_settings()
newroot.add_work_source(examplesources)
# Register the new root work source
core.set_root_work_source(newroot)
# Add example work sources to their group
worksource = BCJSONRPCWorkSource(core)
worksource.set_blockchain(blockchain)
worksource.settings.name = "BTCMP (donation)"
worksource.settings.priority = 1
worksource.settings.host = "rr.btcmp.com"
worksource.settings.port = 7332
worksource.settings.username = "TheSeven.worker"
worksource.settings.password = "TheSeven"
worksource.apply_settings()
examplesources.add_work_source(worksource)
worksource = BCJSONRPCWorkSource(core)
worksource.set_blockchain(blockchain)
worksource.settings.name = "BTCGuild (donation)"
worksource.settings.priority = 1