forked from LBRYCommunity/lbry-sdk
Fix paths for os x
Fix paths to use binaries in the app bundle
This commit is contained in:
parent
9714985855
commit
0a7b2683ff
3 changed files with 18 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
import sys
|
||||
from lbrynet.interfaces import IRequestCreator, IQueryHandlerFactory, IQueryHandler, ILBRYWallet
|
||||
from lbrynet.core.client.ClientRequest import ClientRequest
|
||||
from lbrynet.core.Error import UnknownNameError, InvalidStreamInfoError, RequestCanceledError
|
||||
|
@ -372,6 +373,8 @@ class LBRYcrdWallet(object):
|
|||
self.lbrycrdd = subprocess.Popen([self.lbrycrdd_path, "-datadir=%s" % self.wallet_dir,
|
||||
"-conf=%s" % self.wallet_conf], startupinfo=si)
|
||||
else:
|
||||
if sys.platform == 'darwin':
|
||||
os.chdir("/Applications/LBRY.app/Contents/Resources")
|
||||
self.lbrycrdd = subprocess.Popen([self.lbrycrdd_path, "-datadir=%s" % self.wallet_dir,
|
||||
"-conf=%s" % self.wallet_conf])
|
||||
self.started_lbrycrdd = True
|
||||
|
|
|
@ -4,6 +4,7 @@ import os.path
|
|||
import argparse
|
||||
import requests
|
||||
import locale
|
||||
import sys
|
||||
from yapsy.PluginManager import PluginManager
|
||||
from twisted.internet import defer, threads, stdio, task, error
|
||||
# from lbrynet.core.client.AutoDownloader import AutoFetcher
|
||||
|
@ -65,7 +66,10 @@ class LBRYConsole():
|
|||
self.lbrycrd_conf = lbrycrd_conf
|
||||
self.lbrycrd_dir = lbrycrd_dir
|
||||
if not self.lbrycrd_dir:
|
||||
self.lbrycrd_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd")
|
||||
if sys.platform == "darwin":
|
||||
self.lbrycrd_dir = os.path.join(os.path.expanduser("~"), "Library/Application Support/lbrycrd")
|
||||
else:
|
||||
self.lbrycrd_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd")
|
||||
if not self.lbrycrd_conf:
|
||||
self.lbrycrd_conf = os.path.join(self.lbrycrd_dir, "lbrycrd.conf")
|
||||
# self.autofetcher_conf = os.path.join(self.lbrycrd_dir, "autofetcher.conf")
|
||||
|
|
|
@ -20,6 +20,7 @@ from lbrynet.lbryfile.client.LBRYFileOptions import add_lbry_file_to_sd_identifi
|
|||
import os
|
||||
import requests
|
||||
import shutil
|
||||
import sys
|
||||
from twisted.internet import threads, defer, task
|
||||
|
||||
|
||||
|
@ -42,8 +43,12 @@ class LBRYDownloader(object):
|
|||
self.download_directory = get_path(FOLDERID.Downloads, UserHandle.current)
|
||||
self.wallet_dir = os.path.join(get_path(FOLDERID.RoamingAppData, UserHandle.current), "lbrycrd")
|
||||
else:
|
||||
self.download_directory = os.path.join(os.path.expanduser("~"), "Downloads")
|
||||
self.wallet_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd")
|
||||
if sys.platform == 'darwin':
|
||||
self.download_directory = os.path.join(os.path.expanduser("~"), "Downloads")
|
||||
self.wallet_dir = os.path.join(os.path.expanduser("~"), "Library/Application Support/lbrycrd")
|
||||
else:
|
||||
self.download_directory = os.getcwd()
|
||||
self.wallet_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd")
|
||||
self.wallet_conf = os.path.join(self.wallet_dir, "lbrycrd.conf")
|
||||
self.wallet_user = None
|
||||
self.wallet_password = None
|
||||
|
@ -297,6 +302,9 @@ class LBRYDownloader(object):
|
|||
if not lbrycrdd_path:
|
||||
lbrycrdd_path = self.default_lbrycrdd_path
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
os.chdir("/Applications/LBRY.app/Contents/Resources")
|
||||
|
||||
wallet = LBRYcrdWallet(self.db_dir, wallet_dir=self.wallet_dir, wallet_conf=self.wallet_conf,
|
||||
lbrycrdd_path=lbrycrdd_path)
|
||||
|
||||
|
|
Loading…
Reference in a new issue