diff --git a/delojza.py b/delojza.py index aac2830..6dc76b9 100755 --- a/delojza.py +++ b/delojza.py @@ -11,7 +11,7 @@ import subprocess import sys import tempfile import unicodedata -from configparser import ConfigParser +from configparser import ConfigParser, NoSectionError from datetime import datetime, timedelta from glob import glob from operator import itemgetter @@ -796,10 +796,15 @@ if __name__ == '__main__': logging.warning("Didn't find `initial.txt`, continuing without markov blabbering!") markov = None + try: + redirects = config.items('redirects') + except NoSectionError: + redirects = {} + delojza = DelojzaBot(config.get('delojza', 'tg_api_key'), config.get('delojza', 'OUT_DIR', fallback=os.path.join(_DIR_, "out")), tmp_dir=config.get('delojza', 'tmp_dir', fallback=tempfile.gettempdir()), - redirects=config.items('redirects'), + redirects=redirects, protected_password=config.get('delojza', 'protected_password', fallback=None), acoustid_key=config.get('delojza', 'acoustid_api_key', fallback=None), tumblr_name=config.get('tumblr', 'blog_name', fallback=None),