Fix paths for os x

Fix paths to use binaries in the app bundle
This commit is contained in:
Jack 2015-12-20 03:29:13 -05:00
parent 9714985855
commit 0a7b2683ff
3 changed files with 18 additions and 3 deletions

View file

@ -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

View file

@ -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,6 +66,9 @@ class LBRYConsole():
self.lbrycrd_conf = lbrycrd_conf
self.lbrycrd_dir = lbrycrd_dir
if not self.lbrycrd_dir:
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")

View file

@ -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,7 +43,11 @@ 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:
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
@ -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)