mirror of
https://github.com/vikstrous/pirate-get
synced 2025-04-19 01:18:38 +02:00
Merge 1398ba6d90
into e80155f744
This commit is contained in:
commit
1ec596d9df
@ -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]`.
|
||||
|
@ -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