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


Python SimpleConfig.get_wallet_path方法代码示例

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


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

示例1: run_gui

# 需要导入模块: from simple_config import SimpleConfig [as 别名]
# 或者: from simple_config.SimpleConfig import get_wallet_path [as 别名]
 def run_gui(self, config_options):
     config = SimpleConfig(config_options)
     if self.gui:
         if hasattr(self.gui, 'new_window'):
             path = config.get_wallet_path()
             self.gui.new_window(path, config.get('url'))
             response = "ok"
         else:
             response = "error: current GUI does not support multiple windows"
     else:
         response = "Error: Electrum is running in daemon mode. Please stop the daemon first."
     return response
开发者ID:ttytyper,项目名称:electrum,代码行数:14,代码来源:daemon.py

示例2: run_daemon

# 需要导入模块: from simple_config import SimpleConfig [as 别名]
# 或者: from simple_config.SimpleConfig import get_wallet_path [as 别名]
 def run_daemon(self, config_options):
     config = SimpleConfig(config_options)
     sub = config.get('subcommand')
     assert sub in [None, 'start', 'stop', 'status', 'load_wallet', 'close_wallet']
     if sub in [None, 'start']:
         response = "Daemon already running"
     elif sub == 'load_wallet':
         path = config.get_wallet_path()
         wallet = self.load_wallet(path, config.get('password'))
         self.cmd_runner.wallet = wallet
         response = True
     elif sub == 'close_wallet':
         path = config.get_wallet_path()
         if path in self.wallets:
             self.stop_wallet(path)
             response = True
         else:
             response = False
     elif sub == 'status':
         if self.network:
             p = self.network.get_parameters()
             response = {
                 'path': self.network.config.path,
                 'server': p[0],
                 'blockchain_height': self.network.get_local_height(),
                 'server_height': self.network.get_server_height(),
                 'spv_nodes': len(self.network.get_interfaces()),
                 'connected': self.network.is_connected(),
                 'auto_connect': p[4],
                 'version': ELECTRUM_VERSION,
                 'wallets': {k: w.is_up_to_date()
                             for k, w in self.wallets.items()},
                 'fee_per_kb': self.config.fee_per_kb(),
             }
         else:
             response = "Daemon offline"
     elif sub == 'stop':
         self.stop()
         response = "Daemon stopped"
     return response
开发者ID:Matoking,项目名称:electrum,代码行数:42,代码来源:daemon.py

示例3: run_cmdline

# 需要导入模块: from simple_config import SimpleConfig [as 别名]
# 或者: from simple_config.SimpleConfig import get_wallet_path [as 别名]
 def run_cmdline(self, config_options):
     password = config_options.get('password')
     new_password = config_options.get('new_password')
     config = SimpleConfig(config_options)
     config.fee_estimates = self.network.config.fee_estimates.copy()
     cmdname = config.get('cmd')
     cmd = known_commands[cmdname]
     if cmd.requires_wallet:
         path = config.get_wallet_path()
         wallet = self.wallets.get(path)
         if wallet is None:
             return {'error': 'Wallet not open. Use "electrum daemon load_wallet"'}
     else:
         wallet = None
     # arguments passed to function
     args = map(lambda x: config.get(x), cmd.params)
     # decode json arguments
     args = map(json_decode, args)
     # options
     args += map(lambda x: config.get(x), cmd.options)
     cmd_runner = Commands(config, wallet, self.network, password=password, new_password=new_password)
     func = getattr(cmd_runner, cmd.name)
     result = func(*args)
     return result
开发者ID:Matoking,项目名称:electrum,代码行数:26,代码来源:daemon.py


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