mirror of
https://github.com/vikstrous/pirate-get
synced 2025-04-19 01:18:38 +02:00
Merge 722bbc2581
into e80155f744
This commit is contained in:
commit
f9e338724b
@ -52,17 +52,24 @@ def parse_config_file(text):
|
||||
|
||||
return config
|
||||
|
||||
|
||||
def load_config():
|
||||
# user-defined config files
|
||||
config_home = os.getenv('XDG_CONFIG_HOME', '~/.config')
|
||||
config = expanduser(os.path.join(config_home, 'pirate-get'))
|
||||
|
||||
# read config file
|
||||
|
||||
if os.path.isfile(config):
|
||||
with open(config) as f:
|
||||
return parse_config_file(f.read())
|
||||
|
||||
# sees if local database exists
|
||||
try:
|
||||
os.path.isfile('/root/downloads/pirate-get/db')
|
||||
|
||||
except FileNotFoundError:
|
||||
return "piratebay local database does not exists!"
|
||||
|
||||
return parse_config_file("")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user