本文整理汇总了Python中util.DaemonThread类的典型用法代码示例。如果您正苦于以下问题:Python DaemonThread类的具体用法?Python DaemonThread怎么用?Python DaemonThread使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DaemonThread类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, config, is_local, gui_name):
DaemonThread.__init__(self)
if is_local:
find = imp.find_module('plugins')
plugins = imp.load_module('electrum_plugins', *find)
else:
plugins = __import__('electrum_plugins')
self.pkgpath = os.path.dirname(plugins.__file__)
self.config = config
self.hw_wallets = {}
self.plugins = {}
self.gui_name = gui_name
self.descriptions = []
for loader, name, ispkg in pkgutil.iter_modules([self.pkgpath]):
m = loader.find_module(name).load_module(name)
d = m.__dict__
gui_good = gui_name in d.get('available_for', [])
details = d.get('registers_wallet_type')
if details:
self.register_plugin_wallet(name, gui_good, details)
if not gui_good:
continue
self.descriptions.append(d)
if not d.get('requires_wallet_type') and config.get('use_' + name):
self.load_plugin(config, name)
开发者ID:Emzy,项目名称:electrum,代码行数:25,代码来源:plugins.py
示例2: __init__
def __init__(self, config, fd):
DaemonThread.__init__(self)
self.config = config
if config.get('offline'):
self.network = None
else:
self.network = Network(config)
self.network.start()
self.gui = None
self.wallets = {}
# Setup server
cmd_runner = Commands(self.config, None, self.network)
host = config.get('rpchost', 'localhost')
port = config.get('rpcport', 0)
server = SimpleJSONRPCServer((host, port), logRequests=False,
requestHandler=RequestHandler)
os.write(fd, repr((server.socket.getsockname(), time.time())))
os.close(fd)
server.timeout = 0.1
for cmdname in known_commands:
server.register_function(getattr(cmd_runner, cmdname), cmdname)
server.register_function(self.run_cmdline, 'run_cmdline')
server.register_function(self.ping, 'ping')
server.register_function(self.run_daemon, 'daemon')
server.register_function(self.run_gui, 'gui')
self.server = server
开发者ID:ChainEXS,项目名称:electrum,代码行数:27,代码来源:daemon.py
示例3: __init__
def __init__(self, config, is_local, gui_name):
DaemonThread.__init__(self)
if is_local:
find = imp.find_module('plugins')
plugins = imp.load_module('electrum_plugins', *find)
else:
plugins = __import__('electrum_plugins')
self.pkgpath = os.path.dirname(plugins.__file__)
self.config = config
self.hw_wallets = {}
self.plugins = {}
self.gui_name = gui_name
self.descriptions = {}
self.device_manager = DeviceMgr()
self.load_plugins()
self.start()
开发者ID:prusso,项目名称:electrum,代码行数:16,代码来源:plugins.py
示例4: __init__
def __init__(self, config, fd):
DaemonThread.__init__(self)
self.config = config
if config.get('offline'):
self.network = None
self.fx = None
else:
self.network = Network(config)
self.network.start()
self.fx = FxThread(config, self.network)
self.network.add_jobs([self.fx])
self.gui = None
self.wallets = {}
# Setup JSONRPC server
self.cmd_runner = Commands(self.config, None, self.network)
self.init_server(config, fd)
开发者ID:Matoking,项目名称:electrum,代码行数:17,代码来源:daemon.py
示例5: __init__
def __init__(self, config, network):
DaemonThread.__init__(self)
self.config = config
self.network = network
self.gui = None
self.wallets = {}
self.wallet = None
self.cmd_runner = Commands(self.config, self.wallet, self.network)
host = config.get('rpchost', 'localhost')
port = config.get('rpcport', 0)
self.server = SimpleJSONRPCServer((host, port), requestHandler=RequestHandler, logRequests=False)
with open(lockfile(config), 'w') as f:
f.write(repr(self.server.socket.getsockname()))
self.server.timeout = 0.1
for cmdname in known_commands:
self.server.register_function(getattr(self.cmd_runner, cmdname), cmdname)
self.server.register_function(self.run_cmdline, 'run_cmdline')
self.server.register_function(self.ping, 'ping')
self.server.register_function(self.run_daemon, 'daemon')
self.server.register_function(self.run_gui, 'gui')
开发者ID:bontaq,项目名称:electrum,代码行数:20,代码来源:daemon.py
示例6: stop
def stop(self):
for k, wallet in self.wallets.items():
wallet.stop_threads()
DaemonThread.stop(self)
开发者ID:ttytyper,项目名称:electrum,代码行数:4,代码来源:daemon.py
注:本文中的util.DaemonThread类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论