Browse Source

print_error -> print_msg

master
ThomasV 13 years ago
parent
commit
c68bf5a1d7
  1. 22
      electrum

22
electrum

@ -378,7 +378,7 @@ if __name__ == '__main__':
try: try:
wallet.pw_decode( wallet.seed, password) wallet.pw_decode( wallet.seed, password)
except: except:
print_error("Error: This password does not decode this wallet.") print_msg("Error: This password does not decode this wallet.")
exit(1) exit(1)
if cmd == 'import': if cmd == 'import':
@ -391,8 +391,8 @@ if __name__ == '__main__':
wallet.import_key(keypair,password) wallet.import_key(keypair,password)
wallet.save() wallet.save()
print_msg("Keypair imported") print_msg("Keypair imported")
except BaseException(e): except BaseException as e:
print_error("Error: Keypair import failed: " + str(e)) print_msg("Error: Keypair import failed: " + str(e))
if cmd == 'help': if cmd == 'help':
cmd2 = firstarg cmd2 = firstarg
@ -410,9 +410,9 @@ if __name__ == '__main__':
elif cmd == 'deseed': elif cmd == 'deseed':
if not wallet.seed: if not wallet.seed:
print_error("Error: This wallet has no seed") print_msg("Error: This wallet has no seed")
elif wallet.use_encryption: elif wallet.use_encryption:
print_error("Error: This wallet is encrypted") print_msg("Error: This wallet is encrypted")
else: else:
ns = wallet.config.path + '.seed' ns = wallet.config.path + '.seed'
print_msg("Warning: you are going to extract the seed from '%s'\nThe seed will be saved in '%s'"%(wallet.config.path,ns)) print_msg("Warning: you are going to extract the seed from '%s'\nThe seed will be saved in '%s'"%(wallet.config.path,ns))
@ -425,7 +425,7 @@ if __name__ == '__main__':
wallet.save() wallet.save()
print_msg("Done.") print_msg("Done.")
else: else:
print_error("Action canceled.") print_msg("Action canceled.")
elif cmd == 'reseed': elif cmd == 'reseed':
if wallet.seed: if wallet.seed:
@ -455,7 +455,7 @@ if __name__ == '__main__':
wallet.save() wallet.save()
print_msg("Done: " + wallet.config.path) print_msg("Done: " + wallet.config.path)
else: else:
print_error("Error: Master public key does not match") print_msg("Error: Master public key does not match")
elif cmd == 'validateaddress': elif cmd == 'validateaddress':
addr = args[1] addr = args[1]
@ -543,7 +543,7 @@ if __name__ == '__main__':
tx = args[1] tx = args[1]
label = ' '.join(args[2:]) label = ' '.join(args[2:])
except: except:
print_error("Error. Syntax: label <tx_hash> <text>") print_msg("Error. Syntax: label <tx_hash> <text>")
sys.exit(1) sys.exit(1)
wallet.labels[tx] = label wallet.labels[tx] = label
wallet.save() wallet.save()
@ -556,7 +556,7 @@ if __name__ == '__main__':
keypair = from_addr keypair = from_addr
from_addr = keypair.split(':')[0] from_addr = keypair.split(':')[0]
if not wallet.import_key(keypair,password): if not wallet.import_key(keypair,password):
print_error("Error: Invalid key pair") print_msg("Error: Invalid key pair")
exit(1) exit(1)
wallet.history[from_addr] = interface.retrieve_history(from_addr) wallet.history[from_addr] = interface.retrieve_history(from_addr)
wallet.update_tx_history() wallet.update_tx_history()
@ -607,7 +607,7 @@ if __name__ == '__main__':
elif cmd == 'signmessage': elif cmd == 'signmessage':
if len(args) < 3: if len(args) < 3:
print_error("Error: Invalid usage of signmessage.") print_msg("Error: Invalid usage of signmessage.")
print_msg(known_commands[cmd]) print_msg(known_commands[cmd])
sys.exit(1) sys.exit(1)
address = args[1] address = args[1]
@ -622,7 +622,7 @@ if __name__ == '__main__':
signature = args[2] signature = args[2]
message = ' '.join(args[3:]) message = ' '.join(args[3:])
except: except:
print_error("Error: Not all parameters were given, displaying help instead.") print_msg("Error: Not all parameters were given, displaying help instead.")
print_msg(known_commands[cmd]) print_msg(known_commands[cmd])
sys.exit(1) sys.exit(1)
if len(args) > 4: if len(args) > 4:

Loading…
Cancel
Save