def run_command(cmd, password = None, args = []):
cmd_runner = Commands(wallet, network)
- func = eval('cmd_runner.' + cmd)
+ func = getattr(cmd_runner, cmd)
cmd_runner.password = password
try:
result = func(*args[1:])
if is_android:
config_options = {'portable':True, 'verbose':True, 'gui':'android', 'auto_cycle':True}
else:
- config_options = eval(str(options))
+ config_options = vars(options)
for k, v in config_options.items():
if v is None: config_options.pop(k)
seed = getpass.getpass(prompt = "seed:", stream = None) if options.concealed else raw_input("seed:")
try:
seed.decode('hex')
- except:
+ except Exception:
print_error("Warning: Not hex, trying decode.")
seed = mnemonic_decode( seed.split(' ') )
if not seed:
else:
print_msg("Warning: Found no history for this wallet")
else:
- wallet.create_accounts()
wallet.synchronize()
print_msg("Warning: This wallet was restored offline. It may contain more addresses than displayed.")
else:
wallet.init_seed(None)
wallet.save_seed()
- wallet.create_accounts()
wallet.synchronize()
print_msg("Your wallet generation seed is:\n\"%s\""% wallet.get_mnemonic(None))
print_msg("Please keep it in a safe place; if you lose it, you will not be able to restore your wallet.")
# check password
try:
seed = wallet.get_seed(password)
- except:
+ except Exception:
print_msg("Error: This password does not decode this wallet.")
exit(1)
else: