mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
remove appdata_dir and data_dir
This commit is contained in:
parent
4794ccfaf2
commit
e389745491
5 changed files with 3 additions and 37 deletions
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
|
|
||||||
import threading, time, Queue, os, sys, shutil
|
import threading, time, Queue, os, sys, shutil
|
||||||
from util import user_dir, appdata_dir, print_error
|
from util import user_dir, print_error
|
||||||
from bitcoin import *
|
from bitcoin import *
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import random
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
from util import user_dir, appdata_dir, print_error, print_msg
|
from util import user_dir, print_error, print_msg
|
||||||
from bitcoin import *
|
from bitcoin import *
|
||||||
import interface
|
import interface
|
||||||
from blockchain import Blockchain
|
from blockchain import Blockchain
|
||||||
|
|
33
lib/util.py
33
lib/util.py
|
@ -61,39 +61,6 @@ def user_dir():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def data_dir():
|
|
||||||
import __builtin__
|
|
||||||
if __builtin__.use_local_modules:
|
|
||||||
return local_data_dir()
|
|
||||||
else:
|
|
||||||
is_frozen = getattr(sys, 'frozen', False)
|
|
||||||
if is_frozen:
|
|
||||||
if is_frozen == "macosx_app":
|
|
||||||
basedir = os.path.abspath(".")
|
|
||||||
else:
|
|
||||||
basedir = sys._MEIPASS
|
|
||||||
|
|
||||||
return os.path.join(basedir, 'data')
|
|
||||||
else:
|
|
||||||
return appdata_dir()
|
|
||||||
|
|
||||||
def usr_share_dir():
|
|
||||||
return os.path.join(sys.prefix, "share")
|
|
||||||
|
|
||||||
def appdata_dir():
|
|
||||||
"""Find the path to the application data directory; add an electrum folder and return path."""
|
|
||||||
if platform.system() == "Windows":
|
|
||||||
return os.path.join(os.environ["APPDATA"], "Electrum")
|
|
||||||
elif platform.system() == "Linux":
|
|
||||||
return os.path.join(usr_share_dir(), "electrum")
|
|
||||||
elif (platform.system() == "Darwin" or
|
|
||||||
platform.system() == "DragonFly" or
|
|
||||||
platform.system() == "OpenBSD" or
|
|
||||||
platform.system() == "FreeBSD" or
|
|
||||||
platform.system() == "NetBSD"):
|
|
||||||
return "/Library/Application Support/Electrum"
|
|
||||||
else:
|
|
||||||
raise Exception("Unknown system")
|
|
||||||
|
|
||||||
|
|
||||||
def get_resource_path(*args):
|
def get_resource_path(*args):
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
|
|
||||||
import threading, time, Queue, os, sys, shutil
|
import threading, time, Queue, os, sys, shutil
|
||||||
from util import user_dir, appdata_dir, print_error
|
from util import user_dir, print_error
|
||||||
from bitcoin import *
|
from bitcoin import *
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ except ImportError as e:
|
||||||
from electrum.plugins import BasePlugin, hook
|
from electrum.plugins import BasePlugin, hook
|
||||||
from electrum.i18n import _, set_language
|
from electrum.i18n import _, set_language
|
||||||
from electrum.util import user_dir
|
from electrum.util import user_dir
|
||||||
from electrum.util import appdata_dir
|
|
||||||
from electrum.util import format_satoshis
|
from electrum.util import format_satoshis
|
||||||
from electrum_gui.qt import ElectrumGui
|
from electrum_gui.qt import ElectrumGui
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue