Browse Source

start using util.resource_path

sqlite_db
SomberNight 6 years ago
parent
commit
5a1778b7fe
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/exchange_rate.py
  2. 4
      electrum/mnemonic.py

6
electrum/exchange_rate.py

@ -14,8 +14,8 @@ from typing import Sequence
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob, make_dir, log_exceptions
from .util import make_aiohttp_session
from .util import (PrintError, ThreadJob, make_dir, log_exceptions,
make_aiohttp_session, resource_path)
from .network import Network
from .simple_config import SimpleConfig
@ -394,7 +394,7 @@ def dictinvert(d):
return inv
def get_exchanges_and_currencies():
path = os.path.join(os.path.dirname(__file__), 'currencies.json')
path = resource_path('currencies.json')
try:
with open(path, 'r', encoding='utf-8') as f:
return json.loads(f.read())

4
electrum/mnemonic.py

@ -30,7 +30,7 @@ import string
import ecdsa
from .util import print_error
from .util import print_error, resource_path
from .bitcoin import is_old_seed, is_new_seed
from . import version
@ -88,7 +88,7 @@ def normalize_text(seed: str) -> str:
return seed
def load_wordlist(filename):
path = os.path.join(os.path.dirname(__file__), 'wordlist', filename)
path = resource_path('wordlist', filename)
with open(path, 'r', encoding='utf-8') as f:
s = f.read().strip()
s = unicodedata.normalize('NFKD', s)

Loading…
Cancel
Save