本文整理汇总了Python中electrum.wallet.Wallet.addresses方法的典型用法代码示例。如果您正苦于以下问题:Python Wallet.addresses方法的具体用法?Python Wallet.addresses怎么用?Python Wallet.addresses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类electrum.wallet.Wallet
的用法示例。
在下文中一共展示了Wallet.addresses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from electrum.wallet import Wallet [as 别名]
# 或者: from electrum.wallet.Wallet import addresses [as 别名]
class ElectrumGui:
def __init__(self, config, network, daemon, plugins):
self.network = network
self.config = config
storage = WalletStorage(config.get_wallet_path())
if not storage.file_exists:
print "Wallet not found. try 'electrum create'"
exit()
self.done = 0
self.last_balance = ""
set_verbosity(False)
self.str_recipient = ""
self.str_description = ""
self.str_amount = ""
self.str_fee = ""
self.wallet = Wallet(storage)
self.wallet.start_threads(network)
self.contacts = StoreDict(self.config, "contacts")
network.register_callback(self.on_network, ["updated", "banner"])
self.commands = [
_("[h] - displays this help text"),
_("[i] - display transaction history"),
_("[o] - enter payment order"),
_("[p] - print stored payment order"),
_("[s] - send stored payment order"),
_("[r] - show own receipt addresses"),
_("[c] - display contacts"),
_("[b] - print server banner"),
_("[q] - quit"),
]
self.num_commands = len(self.commands)
def on_network(self, event, *args):
if event == "updated":
self.updated()
elif event == "banner":
self.print_banner()
def main_command(self):
self.print_balance()
c = raw_input("enter command: ")
if c == "h":
self.print_commands()
elif c == "i":
self.print_history()
elif c == "o":
self.enter_order()
elif c == "p":
self.print_order()
elif c == "s":
self.send_order()
elif c == "r":
self.print_addresses()
elif c == "c":
self.print_contacts()
elif c == "b":
self.print_banner()
elif c == "n":
self.network_dialog()
elif c == "e":
self.settings_dialog()
elif c == "q":
self.done = 1
else:
self.print_commands()
def updated(self):
s = self.get_balance()
if s != self.last_balance:
print (s)
self.last_balance = s
return True
def print_commands(self):
self.print_list(self.commands, "Available commands")
def print_history(self):
width = [20, 40, 14, 14]
delta = (80 - sum(width) - 4) / 3
format_str = (
"%"
+ "%d" % width[0]
+ "s"
+ "%"
+ "%d" % (width[1] + delta)
+ "s"
+ "%"
+ "%d" % (width[2] + delta)
+ "s"
+ "%"
+ "%d" % (width[3] + delta)
+ "s"
)
b = 0
messages = []
#.........这里部分代码省略.........