fix data_dir problem in UIManager

This commit is contained in:
Jack 2016-11-01 16:40:50 -04:00
parent 9de7354ea0
commit 96ef5089fc

View file

@ -1,7 +1,6 @@
import os import os
import logging import logging
import shutil import shutil
import sys
import json import json
from urllib2 import urlopen from urllib2 import urlopen
@ -13,7 +12,6 @@ from lbrynet.lbrynet_daemon.Resources import NoCacheStaticFile
from lbrynet import __version__ as lbrynet_version from lbrynet import __version__ as lbrynet_version
from lbryum.version import LBRYUM_VERSION as lbryum_version from lbryum.version import LBRYUM_VERSION as lbryum_version
from zipfile import ZipFile from zipfile import ZipFile
from appdirs import user_data_dir
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -21,17 +19,10 @@ log = logging.getLogger(__name__)
class UIManager(object): class UIManager(object):
def __init__(self, root): def __init__(self, root):
if sys.platform != "darwin": self.ui_root = os.path.join(settings.data_dir, "lbry-ui")
self.data_dir = os.path.join(os.path.expanduser("~"), '.lbrynet')
else:
self.data_dir = user_data_dir("LBRY")
self.ui_root = os.path.join(self.data_dir, "lbry-ui")
self.active_dir = os.path.join(self.ui_root, "active") self.active_dir = os.path.join(self.ui_root, "active")
self.update_dir = os.path.join(self.ui_root, "update") self.update_dir = os.path.join(self.ui_root, "update")
if not os.path.isdir(self.data_dir):
os.mkdir(self.data_dir)
if not os.path.isdir(self.ui_root): if not os.path.isdir(self.ui_root):
os.mkdir(self.ui_root) os.mkdir(self.ui_root)
if not os.path.isdir(self.active_dir): if not os.path.isdir(self.active_dir):