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


Python Wallet.get_action方法代码示例

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


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

示例1: load_wallet

# 需要导入模块: from wallet import Wallet [as 别名]
# 或者: from wallet.Wallet import get_action [as 别名]
 def load_wallet(self, path):
     if path in self.wallets:
         wallet = self.wallets[path]
         return wallet
     storage = WalletStorage(path)
     if not storage.file_exists:
         return
     wallet = Wallet(storage)
     action = wallet.get_action()
     if action:
         return
     wallet.start_threads(self.network)
     self.wallets[path] = wallet
     return wallet
开发者ID:Marcdnd,项目名称:electrum-cesc,代码行数:16,代码来源:daemon.py

示例2: run

# 需要导入模块: from wallet import Wallet [as 别名]
# 或者: from wallet.Wallet import get_action [as 别名]
    def run(self, network, storage):
        '''The main entry point of the wizard.  Open a wallet from the given
        filename.  If the file doesn't exist launch the GUI-specific
        install wizard proper, created by calling create_wizard().'''
        need_sync = False
        is_restore = False

        if storage.file_exists:
            wallet = Wallet(storage)
            if wallet.imported_keys:
                self.update_wallet_format(wallet)
        else:
            cr, wallet = self.create_or_restore(storage)
            if not wallet:
                return
            need_sync = True
            is_restore = (cr == 'restore')

        while True:
            action = wallet.get_action()
            if not action:
                break
            need_sync = True
            self.run_wallet_action(wallet, action)
            # Save the wallet after each action
            wallet.storage.write()

        if network:
            # Show network dialog if config does not exist
            if self.config.get('auto_connect') is None:
                self.choose_server(network)
        else:
            self.show_warning(_('You are offline'))

        if need_sync:
            self.create_addresses(wallet)

        # start wallet threads
        if network:
            wallet.start_threads(network)

        if is_restore:
            self.show_restore(wallet, network)

        self.finished()

        return wallet
开发者ID:santiagorp,项目名称:electrum,代码行数:49,代码来源:wizard.py

示例3: load_wallet

# 需要导入模块: from wallet import Wallet [as 别名]
# 或者: from wallet.Wallet import get_action [as 别名]
 def load_wallet(self, path, get_wizard=None):
     if path in self.wallets:
         wallet = self.wallets[path]
     else:
         storage = WalletStorage(path)
         if storage.file_exists:
             wallet = Wallet(storage)
             action = wallet.get_action()
         else:
             action = 'new'
         if action:
             if get_wizard is None:
                 return None
             wizard = get_wizard()
             wallet = wizard.run(self.network, storage)
         else:
             wallet.start_threads(self.network)
         if wallet:
             self.wallets[path] = wallet
     return wallet
开发者ID:FairCoinTeam,项目名称:electrum-fair,代码行数:22,代码来源:daemon.py

示例4: open_wallet

# 需要导入模块: from wallet import Wallet [as 别名]
# 或者: from wallet.Wallet import get_action [as 别名]
    def open_wallet(self, network, filename):
        '''The main entry point of the wizard.  Open a wallet from the given
        filename.  If the file doesn't exist launch the GUI-specific
        install wizard proper.'''
        storage = WalletStorage(filename)
        if storage.file_exists:
            wallet = Wallet(storage)
            self.update_wallet_format(wallet)
            task = None
        else:
            cr, wallet = self.create_or_restore(storage)
            if not wallet:
                return
            task = lambda: self.show_restore(wallet, network, cr)

        need_sync = False
        while True:
            action = wallet.get_action()
            if not action:
                break
            need_sync = True
            self.run_wallet_action(wallet, action)
            # Save the wallet after each action
            wallet.storage.write()

        if network:
            self.choose_server(network)
        else:
            self.show_warning(_('You are offline'))

        if need_sync:
            self.create_addresses(wallet)

        # start wallet threads
        if network:
            wallet.start_threads(network)

        if task:
            task()

        return wallet
开发者ID:MarcoPon,项目名称:electrum,代码行数:43,代码来源:wizard.py

示例5: run

# 需要导入模块: from wallet import Wallet [as 别名]
# 或者: from wallet.Wallet import get_action [as 别名]
    def run(self, network, storage):
        '''The main entry point of the wizard.  Open a wallet from the given
        filename.  If the file doesn't exist launch the GUI-specific
        install wizard proper, created by calling create_wizard().'''
        need_sync = False
        is_restore = False

        if storage.file_exists:
            wallet = Wallet(storage)
            if wallet.imported_keys:
                self.update_wallet_format(wallet)
            action = wallet.get_action()
            if action != 'new':
                self.hide()
                path = storage.path
                msg = _("The file '%s' contains an incompletely created wallet.\n"
                        "Do you want to complete its creation now?") % path
                if not self.question(msg):
                    if self.question(_("Do you want to delete '%s'?") % path):
                        import os
                        os.remove(path)
                        self.show_warning(_('The file was removed'))
                        return
                    return
                self.show()
        else:
            cr, wallet = self.create_or_restore(storage)
            if not wallet:
                return
            need_sync = True
            is_restore = (cr == 'restore')

        while True:
            action = wallet.get_action()
            if not action:
                break
            need_sync = True
            self.run_wallet_action(wallet, action)
            # Save the wallet after each action
            wallet.storage.write()

        if network:
            # Show network dialog if config does not exist
            if self.config.get('auto_connect') is None:
                self.choose_server(network)
        else:
            self.show_warning(_('You are offline'))

        if need_sync:
            self.create_addresses(wallet)

        # start wallet threads
        if network:
            wallet.start_threads(network)

        if is_restore:
            self.show_restore(wallet, network)

        self.finished()

        return wallet
开发者ID:dzyk,项目名称:electrum,代码行数:63,代码来源:wizard.py


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