From 1e192e9ca919fb8c66cf2bf7ed5684bd6236121b Mon Sep 17 00:00:00 2001 From: thomasv Date: Mon, 14 May 2012 14:09:50 +0200 Subject: [PATCH] test the existence of modules in the main script --- electrum | 13 +++++++++++++ lib/wallet.py | 16 ++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/electrum b/electrum index c1d7dde6b..32b5388d7 100755 --- a/electrum +++ b/electrum @@ -18,6 +18,19 @@ import re, sys, getpass +try: + import ecdsa +except: + print "python-ecdsa does not seem to be installed. Try 'sudo pip install ecdsa'" + sys.exit(1) + +try: + import aes +except: + print "AES does not seem to be installed. Try 'sudo pip install slowaes'" + sys.exit(1) + + import electrum from optparse import OptionParser from decimal import Decimal diff --git a/lib/wallet.py b/lib/wallet.py index 5bf3cd472..d65704399 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -18,20 +18,8 @@ import sys, base64, os, re, hashlib, copy, operator, ast, threading, random - -try: - import ecdsa - from ecdsa.util import string_to_number, number_to_string -except: - print "python-ecdsa does not seem to be installed. Try 'sudo pip install ecdsa'" - sys.exit(1) - -try: - import aes -except: - print "AES does not seem to be installed. Try 'sudo pip install slowaes'" - sys.exit(1) - +import slowaes, ecdsa +from ecdsa.util import string_to_number, number_to_string ############ functions from pywallet #####################