tadd timestamp to history command output, convert value to float - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 6bbfef51989ad9a9cac3513c6595bb7c725828dc DIR parent ed6c6bae2488d7f29b6c4f876d69bb09c93479cc HTML Author: ThomasV <thomasv@gitorious> Date: Wed, 19 Aug 2015 11:04:06 +0200 add timestamp to history command output, convert value to float Diffstat: M lib/commands.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- DIR diff --git a/lib/commands.py b/lib/commands.py t@@ -453,13 +453,18 @@ class Commands: for item in self.wallet.get_history(): tx_hash, conf, value, timestamp, balance = item try: - time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3] + time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3] except Exception: time_str = "----" - label, is_default_label = self.wallet.get_label(tx_hash) - - out.append({'txid':tx_hash, 'date':"%16s"%time_str, 'label':label, 'value':format_satoshis(value), 'confirmations':conf}) + out.append({ + 'txid':tx_hash, + 'timestamp':timestamp, + 'date':"%16s"%time_str, + 'label':label, + 'value':float(format_satoshis(value)) if value is not None else None, + 'confirmations':conf} + ) return out @command('w')