electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 0606a308042aeb53a34e5420672388f2f25669fb
parent 5b84cbe9fbfb6570a5b5062262a02ccf3a851e6c
Author: ThomasV <thomasv@gitorious>
Date:   Sat, 13 Sep 2014 09:58:11 +0200

move wordlists to data dir

Diffstat:
Rlib/wordlist/english.txt -> data/wordlist/english.txt | 0
Rlib/wordlist/japanese.txt -> data/wordlist/japanese.txt | 0
Rlib/wordlist/portuguese.txt -> data/wordlist/portuguese.txt | 0
Rlib/wordlist/spanish.txt -> data/wordlist/spanish.txt | 0
Mgui/qt/lite_window.py | 4+---
Mlib/mnemonic.py | 3++-
Mlib/util.py | 9+++++++++
Msetup.py | 5++++-
8 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/lib/wordlist/english.txt b/data/wordlist/english.txt diff --git a/lib/wordlist/japanese.txt b/data/wordlist/japanese.txt diff --git a/lib/wordlist/portuguese.txt b/data/wordlist/portuguese.txt diff --git a/lib/wordlist/spanish.txt b/data/wordlist/spanish.txt diff --git a/gui/qt/lite_window.py b/gui/qt/lite_window.py @@ -76,9 +76,7 @@ def theme_dirs_from_prefix(prefix): def load_theme_paths(): theme_paths = {} - prefixes = (util.local_data_dir(), util.appdata_dir()) - for prefix in prefixes: - theme_paths.update(theme_dirs_from_prefix(prefix)) + theme_paths.update(theme_dirs_from_prefix(util.data_dir())) return theme_paths diff --git a/lib/mnemonic.py b/lib/mnemonic.py @@ -26,6 +26,7 @@ import string import ecdsa import pbkdf2 +import util from util import print_error from bitcoin import is_old_seed, is_new_seed import version @@ -46,7 +47,7 @@ class Mnemonic(object): def __init__(self, lang='en'): filename = filenames.get(lang[0:2], 'english.txt') - path = os.path.join(os.path.dirname(__file__), 'wordlist', filename) + path = os.path.join(util.appdata_dir(), 'wordlist', filename) s = open(path,'r').read().strip() s = unicodedata.normalize('NFKD', s.decode('utf8')) lines = s.split('\n') diff --git a/lib/util.py b/lib/util.py @@ -54,6 +54,15 @@ def user_dir(): #raise Exception("No home directory found in environment variables.") return + +def data_dir(): + import __builtin__ + if __builtin__.use_local_modules: + return local_data_dir() + else: + return appdata_dir() + + def appdata_dir(): """Find the path to the application data directory; add an electrum folder and return path.""" if platform.system() == "Windows": diff --git a/setup.py b/setup.py @@ -32,6 +32,7 @@ if (len(sys.argv) > 1 and (sys.argv[1] == "sdist")) or (platform.system() != 'Wi if os.path.exists('locale/%s/LC_MESSAGES/electrum.mo' % lang): data_files.append((os.path.join(usr_share, 'locale/%s/LC_MESSAGES' % lang), ['locale/%s/LC_MESSAGES/electrum.mo' % lang])) + appdata_dir = util.appdata_dir() if not os.access(appdata_dir, os.W_OK): appdata_dir = os.path.join(usr_share, "electrum") @@ -52,6 +53,9 @@ data_files += [ ]) ] +for lang in os.listdir('data/wordlist'): + data_files.append((os.path.join(appdata_dir, 'wordlist'), ['data/wordlist/%s' % lang])) + # replace tlslite because of https://github.com/trevp/tlslite/issues/15 os.system("pip install http://download.electrum.org/tlslite-0.4.5.tar.gz") @@ -91,7 +95,6 @@ setup( 'electrum.verifier', 'electrum.version', 'electrum.wallet', - 'electrum.wallet_bitkey', 'electrum.x509', 'electrum_gui.gtk', 'electrum_gui.qt.__init__',