new 'set' command for the CLI

This commit is contained in:
ThomasV 2012-10-20 10:23:34 +02:00
parent bb74a6c393
commit d0a6e244b1
1 changed files with 11 additions and 1 deletions

View File

@ -82,6 +82,8 @@ options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address
'Verifies a signature\nSyntax: verifymessage <address> <signature> <message>\nIf you want to lead or end a message with spaces, or want double spaces inside the message make sure you quote the string. I.e. " Hello This is a weird String "',
'eval':
"Run python eval() on an object\nSyntax: eval <expression>\nExample: eval \"wallet.aliases\"",
'set':
"Set wallet parameter. (gui)",
'deseed':
"Remove seed from the wallet. The seed is stored in a file that has the name of the wallet plus '.seed'",
'reseed':
@ -98,7 +100,7 @@ offline_commands = [ 'password', 'mktx',
'label', 'contacts',
'help', 'validateaddress',
'signmessage', 'verifymessage',
'eval', 'create', 'addresses',
'eval', 'set', 'create', 'addresses',
'import', 'seed',
'deseed','reseed',
'freeze','unfreeze',
@ -418,6 +420,14 @@ if __name__ == '__main__':
print eval(args[1])
wallet.save()
elif cmd == 'set':
key, value = args[1:3]
if key in ['gui', 'server', 'proxy', 'fee', 'gap_limit', 'use_change']:
wallet.config.set_key(key, value, True)
print True
else:
print False
elif cmd in [ 'addresses']:
for addr in wallet.all_addresses():
if options.show_all or not wallet.is_change(addr):