1
0

use named callbacks with the interface

This commit is contained in:
thomasv
2012-10-22 11:34:21 +02:00
parent 33eb749c6a
commit 4fbd2ea66e
6 changed files with 40 additions and 32 deletions

View File

@@ -185,8 +185,10 @@ if __name__ == '__main__':
sys.exit("Error: Unknown GUI: " + pref_gui )
gui = gui.ElectrumGui(wallet, config)
wallet.interface = Interface(config, True, gui.server_list_changed)
wallet.interface.start()
interface = Interface(config, True)
interface.register_callback('peers', gui.server_list_changed)
interface.start()
wallet.interface = interface
WalletSynchronizer(wallet, config).start()
WalletVerifier(wallet, config).start()
@@ -293,8 +295,10 @@ if __name__ == '__main__':
# open session
if cmd not in offline_commands and not options.offline:
wallet.interface = Interface(config)
wallet.interface.start()
interface = Interface(config)
interface.register_callback('connected', lambda: print_error("Connected to " + interface.connection_msg))
interface.start()
wallet.interface = interface
WalletSynchronizer(wallet, config).start()
wallet.update()
wallet.save()