1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-04-19 01:18:38 +02:00
This commit is contained in:
Nova Trauben 2017-09-06 22:47:12 +00:00 committed by GitHub
commit 1ec596d9df
2 changed files with 10 additions and 1 deletions

View File

@ -8,6 +8,8 @@ Make sure you have python 3.4 and pip installed. On Ubuntu 14.04 you may also ne
Run `pip3 install pirate-get`
Or if repository is cloned, run `python3 setup.py install`
## Usage
To search use `pirate-get [search term]`.

View File

@ -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("")