mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 02:35:20 +00:00
Implementing a better print_error routine
This commit is contained in:
parent
c533b797e0
commit
4e5dfbeade
9 changed files with 55 additions and 72 deletions
66
electrum
66
electrum
|
@ -17,19 +17,18 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import re, sys
|
import re, sys
|
||||||
|
from lib.util import print_error
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ecdsa
|
import ecdsa
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: python-ecdsa does not seem to be installed. Try 'sudo pip install ecdsa'\n")
|
print_error("Error: python-ecdsa does not seem to be installed. Try 'sudo pip install ecdsa'")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import aes
|
import aes
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: AES does not seem to be installed. Try 'sudo pip install slowaes'\n")
|
print_error("Error: AES does not seem to be installed. Try 'sudo pip install slowaes'")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -144,8 +143,7 @@ if __name__ == '__main__':
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import electrum.gui_lite as gui
|
import electrum.gui_lite as gui
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("Error: Unknown GUI: " + options.gui + "\n")
|
print_error("Error: Unknown GUI: " + options.gui)
|
||||||
sys.stderr.flush()
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
gui = gui.ElectrumGui(wallet)
|
gui = gui.ElectrumGui(wallet)
|
||||||
|
@ -173,14 +171,13 @@ if __name__ == '__main__':
|
||||||
cmd = 'help'
|
cmd = 'help'
|
||||||
|
|
||||||
if not wallet.file_exists and cmd not in ['help','create','restore']:
|
if not wallet.file_exists and cmd not in ['help','create','restore']:
|
||||||
sys.stderr.write("Error: Wallet file not found.\n")
|
print_error("Error: Wallet file not found.")
|
||||||
sys.stderr.write("Type 'electrum create' to create a new wallet, or provide a path to a wallet with the -w option\n")
|
print_error("Type 'electrum create' to create a new wallet, or provide a path to a wallet with the -w option")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if cmd in ['create', 'restore']:
|
if cmd in ['create', 'restore']:
|
||||||
if wallet.file_exists:
|
if wallet.file_exists:
|
||||||
sys.stderr.write("Error: Remove the existing wallet first!\n")
|
print_error("Error: Remove the existing wallet first!")
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
password = prompt_password("Password (hit return if you do not wish to encrypt your wallet):")
|
password = prompt_password("Password (hit return if you do not wish to encrypt your wallet):")
|
||||||
|
@ -203,12 +200,10 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
seed.decode('hex')
|
seed.decode('hex')
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Warning: Not hex, trying decode.\n")
|
print_error("Warning: Not hex, trying decode.")
|
||||||
sys.stderr.flush()
|
|
||||||
seed = mnemonic.mn_decode( seed.split(' ') )
|
seed = mnemonic.mn_decode( seed.split(' ') )
|
||||||
if not seed:
|
if not seed:
|
||||||
sys.stderr.write("Error: No seed\n")
|
print_error("Error: No seed")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
wallet.seed = str(seed)
|
wallet.seed = str(seed)
|
||||||
|
@ -222,12 +217,10 @@ if __name__ == '__main__':
|
||||||
if wallet.is_found():
|
if wallet.is_found():
|
||||||
print "Recovery successful"
|
print "Recovery successful"
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("Warning: Found no history for this wallet\n")
|
print_error("Warning: Found no history for this wallet")
|
||||||
sys.stderr.flush()
|
|
||||||
wallet.fill_addressbook()
|
wallet.fill_addressbook()
|
||||||
wallet.save()
|
wallet.save()
|
||||||
sys.stderr.write("Wallet saved in '" + wallet.path + "'\n")
|
print_error("Wallet saved in '" + wallet.path)
|
||||||
sys.stderr.flush()
|
|
||||||
else:
|
else:
|
||||||
wallet.new_seed(None)
|
wallet.new_seed(None)
|
||||||
wallet.init_mpk( wallet.seed )
|
wallet.init_mpk( wallet.seed )
|
||||||
|
@ -276,8 +269,7 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
wallet.pw_decode( wallet.seed, password)
|
wallet.pw_decode( wallet.seed, password)
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: This password does not decode this wallet.\n")
|
print_error("Error: This password does not decode this wallet.")
|
||||||
sys.stderr.flush()
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if cmd == 'import':
|
if cmd == 'import':
|
||||||
|
@ -287,12 +279,12 @@ if __name__ == '__main__':
|
||||||
wallet.save()
|
wallet.save()
|
||||||
print "Keypair imported"
|
print "Keypair imported"
|
||||||
except BaseException, e:
|
except BaseException, e:
|
||||||
sys.stderr.write("Error: Keypair import failed: " + str(e) + "\n")
|
print_error("Error: Keypair import failed: " + str(e))
|
||||||
sys.stderr.flush()
|
|
||||||
|
|
||||||
if cmd=='help':
|
if cmd=='help':
|
||||||
cmd2 = firstarg
|
cmd2 = firstarg
|
||||||
if cmd2 not in known_commands:
|
if cmd2 not in known_commands:
|
||||||
|
print_error("Error: Command not found.")
|
||||||
print "Type 'electrum help <command>' to see the help for a specific command"
|
print "Type 'electrum help <command>' to see the help for a specific command"
|
||||||
print "Type 'electrum --help' to see the list of options"
|
print "Type 'electrum --help' to see the list of options"
|
||||||
print "List of commands:", ', '.join(known_commands)
|
print "List of commands:", ', '.join(known_commands)
|
||||||
|
@ -305,11 +297,9 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
elif cmd == 'deseed':
|
elif cmd == 'deseed':
|
||||||
if not wallet.seed:
|
if not wallet.seed:
|
||||||
sys.stderr.write("Error: This wallet has no seed\n")
|
print_error("Error: This wallet has no seed")
|
||||||
sys.stderr.flush()
|
|
||||||
elif wallet.use_encryption:
|
elif wallet.use_encryption:
|
||||||
sys.stderr.write("Error: This wallet is encrypted\n")
|
print_error("Error: This wallet is encrypted")
|
||||||
sys.stderr.flush()
|
|
||||||
else:
|
else:
|
||||||
ns = wallet.path + '.seed'
|
ns = wallet.path + '.seed'
|
||||||
print "Warning: you are going to extract the seed from '%s'\nThe seed will be saved in '%s'"%(wallet.path,ns)
|
print "Warning: you are going to extract the seed from '%s'\nThe seed will be saved in '%s'"%(wallet.path,ns)
|
||||||
|
@ -322,8 +312,7 @@ if __name__ == '__main__':
|
||||||
wallet.save()
|
wallet.save()
|
||||||
print "Done."
|
print "Done."
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("Action canceled.\n")
|
print_error("Action canceled.")
|
||||||
sys.stderr.flush()
|
|
||||||
|
|
||||||
elif cmd == 'reseed':
|
elif cmd == 'reseed':
|
||||||
if wallet.seed:
|
if wallet.seed:
|
||||||
|
@ -335,8 +324,7 @@ if __name__ == '__main__':
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Seed file not found\n")
|
print_error("Error: Seed file not found")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit()
|
sys.exit()
|
||||||
try:
|
try:
|
||||||
import ast
|
import ast
|
||||||
|
@ -344,8 +332,7 @@ if __name__ == '__main__':
|
||||||
seed = d['seed']
|
seed = d['seed']
|
||||||
imported_keys = d.get('imported_keys',{})
|
imported_keys = d.get('imported_keys',{})
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Error with seed file\n")
|
print_error("Error: Error with seed file")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
mpk = wallet.master_public_key
|
mpk = wallet.master_public_key
|
||||||
|
@ -357,8 +344,7 @@ if __name__ == '__main__':
|
||||||
wallet.save()
|
wallet.save()
|
||||||
print "Done: " + wallet.path
|
print "Done: " + wallet.path
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("Error: Master public key does not match\n")
|
print_error("Error: Master public key does not match")
|
||||||
sys.stderr.flush()
|
|
||||||
|
|
||||||
elif cmd == 'validateaddress':
|
elif cmd == 'validateaddress':
|
||||||
addr = args[1]
|
addr = args[1]
|
||||||
|
@ -437,8 +423,7 @@ if __name__ == '__main__':
|
||||||
tx = args[1]
|
tx = args[1]
|
||||||
label = ' '.join(args[2:])
|
label = ' '.join(args[2:])
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error. Syntax: label <tx_hash> <text>\n")
|
print_error("Error. Syntax: label <tx_hash> <text>")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
wallet.labels[tx] = label
|
wallet.labels[tx] = label
|
||||||
wallet.save()
|
wallet.save()
|
||||||
|
@ -451,8 +436,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):
|
||||||
sys.stderr.write("Error: Invalid key pair\n")
|
print_error("Error: Invalid key pair")
|
||||||
sys.stderr.flush()
|
|
||||||
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()
|
||||||
|
@ -496,8 +480,7 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
seed = wallet.pw_decode( wallet.seed, password)
|
seed = wallet.pw_decode( wallet.seed, password)
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Password does not decrypt this wallet.\n")
|
print_error("Error: Password does not decrypt this wallet.")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
new_password = prompt_password('New password:')
|
new_password = prompt_password('New password:')
|
||||||
|
@ -516,8 +499,7 @@ if __name__ == '__main__':
|
||||||
signature = args[2]
|
signature = args[2]
|
||||||
message = ' '.join(args[3:])
|
message = ' '.join(args[3:])
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Not all parameters were given, displaying help instead.\n")
|
print_error("Error: Not all parameters were given, displaying help instead.")
|
||||||
sys.stderr.flush()
|
|
||||||
print known_commands[cmd]
|
print known_commands[cmd]
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if len(args) > 4:
|
if len(args) > 4:
|
||||||
|
|
|
@ -23,6 +23,7 @@ import pygtk
|
||||||
pygtk.require('2.0')
|
pygtk.require('2.0')
|
||||||
import gtk, gobject
|
import gtk, gobject
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
from lib.util import print_error
|
||||||
|
|
||||||
import pyqrnative, mnemonic
|
import pyqrnative, mnemonic
|
||||||
|
|
||||||
|
@ -206,8 +207,7 @@ def run_recovery_dialog(wallet):
|
||||||
try:
|
try:
|
||||||
seed.decode('hex')
|
seed.decode('hex')
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Warning: Not hex, trying decode\n")
|
print_error("Warning: Not hex, trying decode")
|
||||||
sys.stderr.flush()
|
|
||||||
seed = mnemonic.mn_decode( seed.split(' ') )
|
seed = mnemonic.mn_decode( seed.split(' ') )
|
||||||
if not seed:
|
if not seed:
|
||||||
show_message("no seed")
|
show_message("no seed")
|
||||||
|
|
|
@ -18,13 +18,13 @@
|
||||||
|
|
||||||
import sys, time, datetime, re
|
import sys, time, datetime, re
|
||||||
from i18n import _
|
from i18n import _
|
||||||
|
from lib.util import print_error
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import PyQt4
|
import PyQt4
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Could not import PyQt4\n")
|
print_error("Error: Could not import PyQt4")
|
||||||
sys.stderr.write("on Linux systems, you may try 'sudo apt-get install python-qt4'\n")
|
print_error("on Linux systems, you may try 'sudo apt-get install python-qt4'")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
|
@ -36,9 +36,8 @@ from interface import DEFAULT_SERVERS
|
||||||
try:
|
try:
|
||||||
import icons_rc
|
import icons_rc
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Could not import icons_rc.py\n")
|
print_error("Error: Could not import icons_rc.py")
|
||||||
sys.stderr.write("Please generate it with: 'pyrcc4 icons.qrc -o lib/icons_rc.py'\n")
|
print_error("Please generate it with: 'pyrcc4 icons.qrc -o lib/icons_rc.py'")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
from wallet import format_satoshis
|
from wallet import format_satoshis
|
||||||
|
@ -390,8 +389,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
if text not in self.wallet.aliases.keys():
|
if text not in self.wallet.aliases.keys():
|
||||||
self.wallet.labels[addr] = text
|
self.wallet.labels[addr] = text
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("Error: This is one of your aliases\n")
|
print_error("Error: This is one of your aliases")
|
||||||
sys.stderr.flush()
|
|
||||||
label = self.wallet.labels.get(addr,'')
|
label = self.wallet.labels.get(addr,'')
|
||||||
item.setText(column_label, QString(label))
|
item.setText(column_label, QString(label))
|
||||||
else:
|
else:
|
||||||
|
@ -1144,8 +1142,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
seed = unicode(seed_e.text())
|
seed = unicode(seed_e.text())
|
||||||
seed.decode('hex')
|
seed.decode('hex')
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Warning: Not hex, trying decode\n")
|
print_error("Warning: Not hex, trying decode")
|
||||||
sys.stderr.flush()
|
|
||||||
try:
|
try:
|
||||||
seed = mnemonic.mn_decode( seed.split(' ') )
|
seed = mnemonic.mn_decode( seed.split(' ') )
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -21,6 +21,7 @@ import random, socket, ast, re
|
||||||
import threading, traceback, sys, time, json, Queue
|
import threading, traceback, sys, time, json, Queue
|
||||||
|
|
||||||
from version import ELECTRUM_VERSION
|
from version import ELECTRUM_VERSION
|
||||||
|
from lib.util import print_error
|
||||||
|
|
||||||
DEFAULT_TIMEOUT = 5
|
DEFAULT_TIMEOUT = 5
|
||||||
DEFAULT_SERVERS = [ 'ecdsa.org:50001:t',
|
DEFAULT_SERVERS = [ 'ecdsa.org:50001:t',
|
||||||
|
@ -247,8 +248,7 @@ class TcpStratumInterface(Interface):
|
||||||
print "Connected to %s:%d"%(self.host,self.port)
|
print "Connected to %s:%d"%(self.host,self.port)
|
||||||
except:
|
except:
|
||||||
self.is_connected = False
|
self.is_connected = False
|
||||||
sys.stderr.write("Not connected\n")
|
print_error("Not connected")
|
||||||
sys.stderr.flush()
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
|
@ -328,8 +328,7 @@ class WalletSynchronizer(threading.Thread):
|
||||||
elif protocol == 'h':
|
elif protocol == 'h':
|
||||||
InterfaceClass = HttpStratumInterface
|
InterfaceClass = HttpStratumInterface
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("Error: Unknown protocol\n")
|
print_error("Error: Unknown protocol")
|
||||||
sys.stderr.flush()
|
|
||||||
InterfaceClass = TcpStratumInterface
|
InterfaceClass = TcpStratumInterface
|
||||||
|
|
||||||
self.interface = InterfaceClass(host, port, self.wallet.debug_server)
|
self.interface = InterfaceClass(host, port, self.wallet.debug_server)
|
||||||
|
@ -386,8 +385,7 @@ class WalletSynchronizer(threading.Thread):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
sys.stderr.write("Error: Unknown message:" + method + ", " + params + ", " + result)
|
print_error("Error: Unknown message:" + method + ", " + params + ", " + result)
|
||||||
sys.stderr.flush()
|
|
||||||
|
|
||||||
|
|
||||||
def start_interface(self):
|
def start_interface(self):
|
||||||
|
|
|
@ -2,6 +2,13 @@ import os
|
||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
def print_error(*args):
|
||||||
|
for item in args:
|
||||||
|
sys.stderr.write(str(item))
|
||||||
|
|
||||||
|
sys.stderr.write("\n")
|
||||||
|
sys.stderr.flush()
|
||||||
|
|
||||||
def appdata_dir():
|
def appdata_dir():
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
return os.path.join(os.environ["APPDATA"], "Electrum")
|
return os.path.join(os.environ["APPDATA"], "Electrum")
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
import sys, base64, os, re, hashlib, copy, operator, ast, threading, random, getpass
|
import sys, base64, os, re, hashlib, copy, operator, ast, threading, random, getpass
|
||||||
import aes, ecdsa
|
import aes, ecdsa
|
||||||
from ecdsa.util import string_to_number, number_to_string
|
from ecdsa.util import string_to_number, number_to_string
|
||||||
|
from lib.util import print_error
|
||||||
|
|
||||||
############ functions from pywallet #####################
|
############ functions from pywallet #####################
|
||||||
|
|
||||||
|
@ -156,8 +157,7 @@ def prompt_password(prompt, confirm=True):
|
||||||
password2 = getpass.getpass("Confirm: ")
|
password2 = getpass.getpass("Confirm: ")
|
||||||
|
|
||||||
if password != password2:
|
if password != password2:
|
||||||
sys.stderr.write("Error: Passwords do not match.\n")
|
print_error("Error: Passwords do not match.")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -21,6 +21,7 @@ import time, thread, sys, socket
|
||||||
# see http://code.google.com/p/jsonrpclib/
|
# see http://code.google.com/p/jsonrpclib/
|
||||||
import jsonrpclib
|
import jsonrpclib
|
||||||
from wallet import Wallet
|
from wallet import Wallet
|
||||||
|
from lib.util import print_error
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Simple wallet daemon for webservers.
|
Simple wallet daemon for webservers.
|
||||||
|
@ -99,8 +100,7 @@ if __name__ == '__main__':
|
||||||
elif cmd == 'stop':
|
elif cmd == 'stop':
|
||||||
out = server.stop()
|
out = server.stop()
|
||||||
except socket.error:
|
except socket.error:
|
||||||
sys.stderr.write("Server not running\n")
|
print_error("Server not running")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
print out
|
print out
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -6,9 +6,10 @@ from distutils.core import setup
|
||||||
from lib.version import ELECTRUM_VERSION as version
|
from lib.version import ELECTRUM_VERSION as version
|
||||||
import lib.util as util
|
import lib.util as util
|
||||||
import os, sys, platform
|
import os, sys, platform
|
||||||
|
from lib.util import print_error
|
||||||
|
|
||||||
if sys.version_info[:3] < (2,6,0):
|
if sys.version_info[:3] < (2,6,0):
|
||||||
sys.stderr.write("Electrum requires Python version >= 2.6.0... exiting\n")
|
print_error("Error: Electrum requires Python version >= 2.6.0...")
|
||||||
sys.stderr.flush()
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
10
upgrade.py
10
upgrade.py
|
@ -6,6 +6,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from electrum import prompt_password
|
from electrum import prompt_password
|
||||||
|
|
||||||
|
from lib.uril import print_error
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,15 +31,13 @@ if __name__ == "__main__":
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: File not found: " + path + "\n")
|
print_error("Error: File not found: " + path)
|
||||||
sys.stderr.flush()
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
x = ast.literal_eval(data)
|
x = ast.literal_eval(data)
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Could not parse wallet\n")
|
print_error("Error: Could not parse wallet")
|
||||||
sys.stderr.flush()
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# version <= 0.33 uses a tuple
|
# version <= 0.33 uses a tuple
|
||||||
|
@ -65,8 +64,7 @@ if __name__ == "__main__":
|
||||||
seed = DecodeAES( secret, wallet.seed )
|
seed = DecodeAES( secret, wallet.seed )
|
||||||
private_keys = ast.literal_eval( DecodeAES( secret, wallet.private_keys ) )
|
private_keys = ast.literal_eval( DecodeAES( secret, wallet.private_keys ) )
|
||||||
except:
|
except:
|
||||||
sys.stderr.write("Error: Password does not decrypt this wallet.\n")
|
print_error("Error: Password does not decrypt this wallet.")
|
||||||
sys.stderr.flush()
|
|
||||||
exit(1)
|
exit(1)
|
||||||
seed_version = 2
|
seed_version = 2
|
||||||
s = repr( (seed_version, use_encryption, fee, host, port, blocks, seed, all_addresses, private_keys, change_indexes, status, history, labels, addressbook ))
|
s = repr( (seed_version, use_encryption, fee, host, port, blocks, seed, all_addresses, private_keys, change_indexes, status, history, labels, addressbook ))
|
||||||
|
|
Loading…
Add table
Reference in a new issue