trevert previous; fix qr code for make_address - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 0e4c51494b9573dc66d781fdcfd66cebcd7f383d DIR parent 04e366c3eea649cefd1230a10262f2267763a135 HTML Author: ThomasV <thomasv@gitorious> Date: Mon, 21 May 2012 17:18:46 +0200 revert previous; fix qr code for make_address Diffstat: M electrum4a.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) --- DIR diff --git a/electrum4a.py b/electrum4a.py t@@ -20,10 +20,10 @@ import android -import lib as electrum -from electrum import WalletSynchronizer, Wallet, format_satoshis -from electrum import mnemonic +from interface import WalletSynchronizer +from wallet import Wallet, format_satoshis +import mnemonic from decimal import Decimal import datetime, re t@@ -536,14 +536,20 @@ def make_new_contact(): code = droid.scanBarcode() r = code.result if r: - address = r['extras']['SCAN_RESULT'] - if address: - if wallet.is_valid(address): + data = r['extras']['SCAN_RESULT'] + if data: + if re.match('^bitcoin:', data): + address, _, _, _, _, _, _ = wallet.parse_url(data, None, None) + elif wallet.is_valid(data): + address = data + else: + address = None + if address: if modal_question('Add to contacts?', address): wallet.addressbook.append(address) wallet.save() else: - modal_dialog('Invalid address', address) + modal_dialog('Invalid address', data) do_refresh = False