X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=gui%2Fstdio.py;h=8b0360ef368765291547360017ef943d593e20df;hb=HEAD;hp=f252a8af522d6cb80f8e60de6f4782d36cc7c612;hpb=a27ad97132728c25c12fecc5b985d300337567f5;p=electrum-nvc.git diff --git a/gui/stdio.py b/gui/stdio.py index f252a8a..8b0360e 100644 --- a/gui/stdio.py +++ b/gui/stdio.py @@ -1,10 +1,10 @@ from decimal import Decimal _ = lambda x:x #from i18n import _ -from electrum import mnemonic_encode, WalletStorage, Wallet -from electrum.util import format_satoshis, set_verbosity -from electrum.bitcoin import is_valid -from electrum.network import filter_protocol +from electrum_nvc import mnemonic_encode, WalletStorage, Wallet +from electrum_nvc.util import format_satoshis, set_verbosity +from electrum_nvc.bitcoin import is_valid +from electrum_nvc.network import filter_protocol import sys, getpass, datetime # minimal fdisk like gui for console usage @@ -17,7 +17,7 @@ class ElectrumGui: self.config = config storage = WalletStorage(config) if not storage.file_exists: - print "Wallet not found. try 'electrum create'" + print "Wallet not found. try 'electrum-nvc create'" exit() self.done = 0 @@ -104,7 +104,7 @@ class ElectrumGui: if confirmations: try: time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3] - except: + except Exception: time_str = "unknown" else: time_str = 'pending' @@ -124,8 +124,8 @@ class ElectrumGui: msg = _( "Synchronizing..." ) else: c, u = self.wallet.get_balance() - msg = _("Balance")+": %f "%(Decimal( c ) / 100000000) - if u: msg += " [%f unconfirmed]"%(Decimal( u ) / 100000000) + msg = _("Balance")+": %f "%(Decimal( c ) / 1000000) + if u: msg += " [%f unconfirmed]"%(Decimal( u ) / 1000000) else: msg = _( "Not connected" ) @@ -171,16 +171,16 @@ class ElectrumGui: def do_send(self): if not is_valid(self.str_recipient): - print(_('Invalid Bitcoin address')) + print(_('Invalid Novacoin address')) return try: - amount = int( Decimal( self.str_amount) * 100000000 ) - except: + amount = int( Decimal( self.str_amount) * 1000000 ) + except Exception: print(_('Invalid Amount')) return try: - fee = int( Decimal( self.str_fee) * 100000000 ) - except: + fee = int( Decimal( self.str_fee) * 1000000 ) + except Exception: print(_('Invalid Fee')) return @@ -198,7 +198,7 @@ class ElectrumGui: try: tx = self.wallet.mktx( [(self.str_recipient, amount)], password, fee) - except BaseException, e: + except Exception as e: print(str(e)) return @@ -208,7 +208,7 @@ class ElectrumGui: h = self.wallet.send_tx(tx) print(_("Please wait...")) self.wallet.tx_event.wait() - status, msg = self.wallet.receive_tx( h ) + status, msg = self.wallet.receive_tx( h, tx ) if status: print(_('Payment sent.')) @@ -218,12 +218,12 @@ class ElectrumGui: print(_('Error')) def network_dialog(self): - print("use 'electrum setconfig server/proxy' to change your network settings") + print("use 'electrum-nvc setconfig server/proxy' to change your network settings") return True def settings_dialog(self): - print("use 'electrum setconfig' to change your settings") + print("use 'electrum-nvc setconfig' to change your settings") return True def password_dialog(self):