electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit c45fa4860fea5ecd1245c6dfe3610208ea014913
parent a0d9a5efe4d7ccfa8319e7722bc0993d0674a38a
Author: ThomasV <thomasv@gitorious>
Date:   Tue,  8 Oct 2013 13:10:38 +0200

android interface update and minor fixes

Diffstat:
Mgui/android.py | 15++++++++-------
Mlib/simple_config.py | 20+++++++++++---------
2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/gui/android.py b/gui/android.py @@ -19,9 +19,11 @@ +from __future__ import absolute_import import android -from electrum import SimpleConfig, Wallet, WalletStorage, format_satoshis, mnemonic_encode, mnemonic_decode, is_valid +from electrum import SimpleConfig, Wallet, WalletStorage, format_satoshis, mnemonic_encode, mnemonic_decode +from electrum.bitcoin import is_valid from electrum import util from decimal import Decimal import datetime, re @@ -119,7 +121,7 @@ def select_from_addresses(): def protocol_name(p): if p == 't': return 'TCP' if p == 'h': return 'HTTP' - if p == 's': return 'TCP/SSL' + if p == 's': return 'SSL' if p == 'g': return 'HTTPS' @@ -498,7 +500,7 @@ do_refresh = False def update_callback(): global do_refresh - print "gui callback", network.is_connected(), wallet.up_to_date + print "gui callback", network.is_connected() do_refresh = True droid.eventPost("refresh",'z') @@ -791,7 +793,7 @@ def settings_loop(): if host in servers: protocol = protocol_dialog(host, protocol, servers[host]) z = servers[host] - port = z[p] + port = z[protocol] network_changed = True elif pos == "2": #port @@ -882,7 +884,6 @@ class ElectrumGui: def __init__(self, config, _network): global wallet, network - wallet = w network = _network network.register_callback('updated', update_callback) network.register_callback('connected', update_callback) @@ -894,8 +895,8 @@ class ElectrumGui: print "Wallet not found. try 'electrum create'" exit() - self.wallet = Wallet(storage) - self.wallet.start_threads(network) + wallet = Wallet(storage) + wallet.start_threads(network) def main(self, url): diff --git a/lib/simple_config.py b/lib/simple_config.py @@ -22,10 +22,8 @@ a SimpleConfig instance then reads the wallet file. if options.get('portable') is not True: self.read_system_config() - # read path - self.path = self.system_config.get('electrum_path') - if self.path is None: - self.path = user_dir() + # init path + self.init_path() # user conf, writeable self.user_config = {} @@ -35,19 +33,23 @@ a SimpleConfig instance then reads the wallet file. # command-line options self.options_config = options - # init path - self.init_path() - print_error( "electrum path", self.path) def init_path(self): - # Look for wallet file in the default data directory. - # Make wallet directory if it does not yet exist. + # Read electrum path in the system configuration + self.path = self.system_config.get('electrum_path') + + # If not set, use the user's default data directory. + if self.path is None: + self.path = user_dir() + + # Make directory if it does not yet exist. if not os.path.exists(self.path): os.mkdir(self.path) + print_error( "electrum directory", self.path) # portable wallet: use the same directory for wallet and headers file #if options.get('portable'):