From 7bb8a0354d63f56b600d7c3f31b823826f2ea989 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 4 Apr 2012 01:13:12 +0200 Subject: [PATCH] android --- client/electrum4a.py | 104 +++++++++++++++++++++++++++++++++---------- client/gui_qt.py | 13 ++++++ 2 files changed, 93 insertions(+), 24 deletions(-) diff --git a/client/electrum4a.py b/client/electrum4a.py index 2b93fe0ac..3e8d82443 100755 --- a/client/electrum4a.py +++ b/client/electrum4a.py @@ -25,6 +25,7 @@ from wallet import format_satoshis from decimal import Decimal +import datetime droid = android.Android() @@ -34,26 +35,29 @@ wallet.read() def get_history_layout(n): - lines = wallet.get_tx_history()[-n:] rows = "" - for line in lines: - import datetime + for line in wallet.get_tx_history()[-n:]: v = line['value'] - if line.has_key('timestamp'): + try: dt = datetime.datetime.fromtimestamp( line['timestamp'] ) if dt.date() == dt.today().date(): time_str = str( dt.time() ) else: time_str = str( dt.date() ) - else: + except: + print line['timestamp'] time_str = 'pending' label = line.get('label') - if not label: label = line['tx_hash'] + #if not label: label = line['tx_hash'] + is_default_label = (label == '') or (label is None) + if is_default_label: label = line['default_label'] rows += """ - + + android:stretchColumns="1"> %s """% rows @@ -95,7 +99,8 @@ def show_addresses(): -main_layout = """ +def main_layout(): + return """ payto_layout=""" + android:id="@+id/background" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#ff000000"> + + android:gravity="left"> + + + + + + + + + + + android:tag="Tag Me" android:inputType="numberDecimal"> - -