diff --git a/README.md b/README.md index 1dc894d..a44af19 100644 --- a/README.md +++ b/README.md @@ -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]`. diff --git a/pirate/pirate.py b/pirate/pirate.py index 1e20007..7658169 100755 --- a/pirate/pirate.py +++ b/pirate/pirate.py @@ -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("")