forked from LBRYCommunity/lbry-sdk
Make directories lowercase, catch exception, initialize settings
This commit is contained in:
parent
ddde036e3a
commit
ebec2fe955
3 changed files with 8 additions and 8 deletions
|
@ -14,8 +14,8 @@ at anytime.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* Linux default downloads folder changed from `~/Downloads` to `XDG_DOWNLOAD_DIR`
|
* Linux default downloads folder changed from `~/Downloads` to `XDG_DOWNLOAD_DIR`
|
||||||
* Linux folders moved from the home directory to `~/.local/share/LBRY`
|
* Linux folders moved from the home directory to `~/.local/share/lbry`
|
||||||
* Windows folders moved from `%APPDATA%/Roaming/lbry` to `%APPDATA%/Local/LBRY`
|
* Windows folders moved from `%APPDATA%/Roaming/lbry` to `%APPDATA%/Local/lbry`
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fixed some log messages throwing exceptions
|
* Fixed some log messages throwing exceptions
|
||||||
|
|
|
@ -61,9 +61,8 @@ elif 'nt' in sys.platform:
|
||||||
default_data_dir = user_data_dir('lbrynet', 'lbry', roaming=True)
|
default_data_dir = user_data_dir('lbrynet', 'lbry', roaming=True)
|
||||||
default_lbryum_dir = user_data_dir('lbryum', 'lbry', roaming=True)
|
default_lbryum_dir = user_data_dir('lbryum', 'lbry', roaming=True)
|
||||||
else:
|
else:
|
||||||
default_data_dir = user_data_dir('lbrynet', 'LBRY')
|
default_data_dir = user_data_dir('lbrynet', 'lbry')
|
||||||
default_lbryum_dir = user_data_dir('lbryum', 'LBRY')
|
default_lbryum_dir = user_data_dir('lbryum', 'lbry')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platform = LINUX
|
platform = LINUX
|
||||||
|
|
||||||
|
@ -74,14 +73,14 @@ else:
|
||||||
default_lbryum_dir = os.path.expanduser('~/.lbryum')
|
default_lbryum_dir = os.path.expanduser('~/.lbryum')
|
||||||
default_download_dir = os.path.expanduser('~/Downloads')
|
default_download_dir = os.path.expanduser('~/Downloads')
|
||||||
else:
|
else:
|
||||||
default_data_dir = user_data_dir('LBRY/lbrynet')
|
default_data_dir = user_data_dir('lbry/lbrynet')
|
||||||
default_lbryum_dir = user_data_dir('LBRY/lbryum')
|
default_lbryum_dir = user_data_dir('lbry/lbryum')
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(user_config_dir(), 'user-dirs.dirs'), 'r') as xdg:
|
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.search(r'XDG_DOWNLOAD_DIR=(.+)', xdg.read()).group(1)
|
||||||
down_dir = re.sub('\$HOME', os.getenv('HOME'), down_dir)
|
down_dir = re.sub('\$HOME', os.getenv('HOME'), down_dir)
|
||||||
default_download_dir = re.sub('\"', '', down_dir)
|
default_download_dir = re.sub('\"', '', down_dir)
|
||||||
except:
|
except EnvironmentError:
|
||||||
default_download_dir = os.getenv('XDG_DOWNLOAD_DIR')
|
default_download_dir = os.getenv('XDG_DOWNLOAD_DIR')
|
||||||
|
|
||||||
if not default_download_dir:
|
if not default_download_dir:
|
||||||
|
|
|
@ -7,6 +7,7 @@ from twisted.internet import reactor
|
||||||
from lbrynet import conf
|
from lbrynet import conf
|
||||||
|
|
||||||
|
|
||||||
|
conf.initialize_settings()
|
||||||
log_dir = conf.settings['data_dir']
|
log_dir = conf.settings['data_dir']
|
||||||
LOG_FILENAME = os.path.join(log_dir, 'lbrynet-daemon.log')
|
LOG_FILENAME = os.path.join(log_dir, 'lbrynet-daemon.log')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue