From 69c5631b253e27650696ca9337032601d652f1c8 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 4 Jul 2016 19:53:01 -0400 Subject: [PATCH] make lbrycrddpath.conf if it doesnt exist, point to binary in app --- packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py index 56f02846f..c8dc04446 100644 --- a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py +++ b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py @@ -1,15 +1,32 @@ import AppKit import webbrowser import sys +import os import logging import socket import platform +import shutil +from appdirs import user_data_dir from PyObjCTools import AppHelper from twisted.internet import reactor from twisted.web import server +import Foundation +bundle = Foundation.NSBundle.mainBundle() +lbrycrdd_path = bundle.pathForResource_ofType_('lbrycrdd', None) +lbrycrdd_path_conf = os.path.join(os.path.expanduser("~"), ".lbrycrddpath.conf") +wallet_dir = user_data_dir("lbrycrd") + +if not os.path.isdir(wallet_dir): + shutil.os.mkdir(wallet_dir) + +if not os.path.isfile(lbrycrdd_path_conf): + f = open(lbrycrdd_path_conf) + f.write(lbrycrdd_path) + f.close() + from lbrynet.lbrynet_daemon.LBRYDaemonServer import LBRYDaemonServer from lbrynet.conf import API_PORT, API_INTERFACE, ICON_PATH, APP_NAME from lbrynet.conf import UI_ADDRESS