1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +01:00

Change config file location

This commit is contained in:
Rnhmjoj 2014-12-03 19:43:12 +01:00
parent 71cf8d2d82
commit e8bd35d658

View File

@ -82,15 +82,15 @@ def main():
# default options so we dont die later # default options so we dont die later
config.add_section('SaveToFile') config.add_section('SaveToFile')
config.set('SaveToFile', 'enabled', False) config.set('SaveToFile', 'enabled', 'false')
config.set('SaveToFile', 'directory', '~/Dropbox/pirate-get/') config.set('SaveToFile', 'directory', '~/downloads/pirate-get/')
# load user options, to override default ones # load user options, to override default ones
def config_to_load(): def config_to_load():
if os.path.isfile(os.path.expandvars('$XDG_CONFIG_HOME/pirate-get/pirate.cfg')): if os.path.isfile(os.path.expandvars('$XDG_CONFIG_HOME/pirate-get')):
return os.path.expandvars('$XDG_CONFIG_HOME/pirate-get/pirate.cfg') return os.path.expandvars('$XDG_CONFIG_HOME/pirate-get')
else: else:
return os.path.expanduser('~/.config/pirate-get/pirate.cfg') return os.path.expanduser('~/.config/pirate-get')
config.read([config_to_load()]) config.read([config_to_load()])