Skip to content

Commit

Permalink
Add README.md url to error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
monk-time committed Jan 11, 2018
1 parent d13edfd commit 62c9d2f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions imdb_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

COOKIE_FNAME = 'imdb_cookie.txt'
ZIP_FNAME = 'imdb_exported_lists.zip'
README_REF = 'For more info check README.md.\n' \
'[https://github.com/monk-time/imdb-backup-lists/blob/master/README.md]'

MList = Dict[str, str]

Expand All @@ -36,7 +38,7 @@ def load_imdb_cookies():
return {'id': cookie_path.read_text().strip()}
else:
raise FileNotFoundError(f'\n\nCreate a file "{COOKIE_FNAME}" in the script directory\n'
'and put your IMDb cookie inside.\nFor more info see README.md.')
f'and put your IMDb cookie inside.\n{README_REF}')


def fetch_userid(cookies: dict) -> str:
Expand All @@ -46,8 +48,8 @@ def fetch_userid(cookies: dict) -> str:
m = re.search(r'ur\d+', r.headers['Location'])
if not m:
raise Exception("\n\nCan't log into IMDb.\n"
f"Make sure that your IMDb cookie in {COOKIE_FNAME} is correct.\n"
'For more info see README.md.')
f'Make sure that your IMDb cookie in {COOKIE_FNAME} is correct.\n'
f'{README_REF}')
return m.group()


Expand Down

0 comments on commit 62c9d2f

Please sign in to comment.