mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-05 05:15:12 +00:00
start using util.resource_path
This commit is contained in:
parent
67d080b34a
commit
5a1778b7fe
2 changed files with 5 additions and 5 deletions
|
@ -14,8 +14,8 @@ from typing import Sequence
|
||||||
|
|
||||||
from .bitcoin import COIN
|
from .bitcoin import COIN
|
||||||
from .i18n import _
|
from .i18n import _
|
||||||
from .util import PrintError, ThreadJob, make_dir, log_exceptions
|
from .util import (PrintError, ThreadJob, make_dir, log_exceptions,
|
||||||
from .util import make_aiohttp_session
|
make_aiohttp_session, resource_path)
|
||||||
from .network import Network
|
from .network import Network
|
||||||
from .simple_config import SimpleConfig
|
from .simple_config import SimpleConfig
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ def dictinvert(d):
|
||||||
return inv
|
return inv
|
||||||
|
|
||||||
def get_exchanges_and_currencies():
|
def get_exchanges_and_currencies():
|
||||||
path = os.path.join(os.path.dirname(__file__), 'currencies.json')
|
path = resource_path('currencies.json')
|
||||||
try:
|
try:
|
||||||
with open(path, 'r', encoding='utf-8') as f:
|
with open(path, 'r', encoding='utf-8') as f:
|
||||||
return json.loads(f.read())
|
return json.loads(f.read())
|
||||||
|
|
|
@ -30,7 +30,7 @@ import string
|
||||||
|
|
||||||
import ecdsa
|
import ecdsa
|
||||||
|
|
||||||
from .util import print_error
|
from .util import print_error, resource_path
|
||||||
from .bitcoin import is_old_seed, is_new_seed
|
from .bitcoin import is_old_seed, is_new_seed
|
||||||
from . import version
|
from . import version
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ def normalize_text(seed: str) -> str:
|
||||||
return seed
|
return seed
|
||||||
|
|
||||||
def load_wordlist(filename):
|
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:
|
with open(path, 'r', encoding='utf-8') as f:
|
||||||
s = f.read().strip()
|
s = f.read().strip()
|
||||||
s = unicodedata.normalize('NFKD', s)
|
s = unicodedata.normalize('NFKD', s)
|
||||||
|
|
Loading…
Add table
Reference in a new issue