From f4d011094d11f39f2d746aa4544da43252303264 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 16 Nov 2011 18:26:06 +0300 Subject: [PATCH] create --- client/electrum.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/electrum.py b/client/electrum.py index 575e4a664..457d4e98c 100755 --- a/client/electrum.py +++ b/client/electrum.py @@ -631,7 +631,7 @@ class Wallet: from optparse import OptionParser if __name__ == '__main__': - known_commands = ['help', 'balance', 'contacts', 'payto', 'sendtx', 'password', 'newaddress', 'addresses', 'history', 'label', 'gui', 'mktx','seed'] + known_commands = ['help', 'balance', 'contacts', 'create', 'payto', 'sendtx', 'password', 'newaddress', 'addresses', 'history', 'label', 'gui', 'mktx','seed'] usage = "usage: %prog [options] command args\nCommands: "+ (', '.join(known_commands)) @@ -656,7 +656,7 @@ if __name__ == '__main__': wallet = Wallet(options.wallet_dir) - if cmd=='gui': + if cmd == 'gui': import gui gui.init_wallet(wallet) gui = gui.BitcoinGUI(wallet) @@ -665,7 +665,14 @@ if __name__ == '__main__': sys.exit(0) if not wallet.read() and cmd != 'help': - print "wallet not found" + print "wallet not found." + print "type 'electrum.py create' to create a wallet, or provide the path to your wallet with the -d option" + sys.exit(0) + + if cmd == 'create': + if wallet.read(): + print "remove the existing wallet first!" + sys.exit(0) if has_encryption: password = getpass.getpass("Password (hit return if you do not wish to encrypt your wallet):") if password: