From ebec2fe9550135594ba5a49fe41a30b939e2744c Mon Sep 17 00:00:00 2001 From: Zestyr Date: Mon, 19 Jun 2017 19:46:46 +0200 Subject: [PATCH] Make directories lowercase, catch exception, initialize settings --- CHANGELOG.md | 4 ++-- lbrynet/conf.py | 11 +++++------ lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc80f6b94..5c32e6abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,8 @@ at anytime. ### Changed * Linux default downloads folder changed from `~/Downloads` to `XDG_DOWNLOAD_DIR` - * Linux folders moved from the home directory to `~/.local/share/LBRY` - * Windows folders moved from `%APPDATA%/Roaming/lbry` to `%APPDATA%/Local/LBRY` + * Linux folders moved from the home directory to `~/.local/share/lbry` + * Windows folders moved from `%APPDATA%/Roaming/lbry` to `%APPDATA%/Local/lbry` ### Fixed * Fixed some log messages throwing exceptions diff --git a/lbrynet/conf.py b/lbrynet/conf.py index e9555b3e2..5182deff1 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -61,9 +61,8 @@ elif 'nt' in sys.platform: default_data_dir = user_data_dir('lbrynet', 'lbry', roaming=True) default_lbryum_dir = user_data_dir('lbryum', 'lbry', roaming=True) else: - default_data_dir = user_data_dir('lbrynet', 'LBRY') - default_lbryum_dir = user_data_dir('lbryum', 'LBRY') - + default_data_dir = user_data_dir('lbrynet', 'lbry') + default_lbryum_dir = user_data_dir('lbryum', 'lbry') else: platform = LINUX @@ -74,14 +73,14 @@ else: default_lbryum_dir = os.path.expanduser('~/.lbryum') default_download_dir = os.path.expanduser('~/Downloads') else: - default_data_dir = user_data_dir('LBRY/lbrynet') - default_lbryum_dir = user_data_dir('LBRY/lbryum') + default_data_dir = user_data_dir('lbry/lbrynet') + default_lbryum_dir = user_data_dir('lbry/lbryum') try: with open(os.path.join(user_config_dir(), 'user-dirs.dirs'), 'r') as xdg: down_dir = re.search(r'XDG_DOWNLOAD_DIR=(.+)', xdg.read()).group(1) down_dir = re.sub('\$HOME', os.getenv('HOME'), down_dir) default_download_dir = re.sub('\"', '', down_dir) - except: + except EnvironmentError: default_download_dir = os.getenv('XDG_DOWNLOAD_DIR') if not default_download_dir: diff --git a/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py b/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py index fa5d1314e..1cba26d3c 100644 --- a/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py +++ b/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py @@ -7,6 +7,7 @@ from twisted.internet import reactor from lbrynet import conf +conf.initialize_settings() log_dir = conf.settings['data_dir'] LOG_FILENAME = os.path.join(log_dir, 'lbrynet-daemon.log')