Handle creation of settings directory in windows

This commit is contained in:
David Amrhein 2016-07-30 17:09:15 -04:00
parent 10742d7c51
commit 7bd05e9b16

View file

@ -171,6 +171,11 @@ class LBRYDaemon(jsonrpc.JSONRPC):
from lbrynet.winhelpers.knownpaths import get_path, FOLDERID, UserHandle
default_download_directory = get_path(FOLDERID.Downloads, UserHandle.current)
self.db_dir = os.path.join(get_path(FOLDERID.RoamingAppData, UserHandle.current), "lbrynet")
try:
os.makedirs(self.db_dir)
except OSError:
if not os.path.isdir(self.db_dir):
raise
elif sys.platform == "darwin":
default_download_directory = os.path.join(os.path.expanduser("~"), 'Downloads')
self.db_dir = user_data_dir("LBRY")