aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/books.py3
-rwxr-xr-xroka.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/books.py b/lib/books.py
index 84754f6..6f3510b 100644
--- a/lib/books.py
+++ b/lib/books.py
@@ -15,7 +15,8 @@ JSON_PATH = os.path.join(CACHE_PATH, 'audiobooks.json')
# use Flask's config parser, configparser would be hacky
APP = Flask(__name__)
-APP.config.from_pyfile(os.path.join(ABS_PATH, '../', 'app.cfg'))
+if os.path.exists(os.path.join(ABS_PATH, '../', 'app.cfg')):
+ APP.config.from_pyfile(os.path.join(ABS_PATH, '../', 'app.cfg'))
class Books:
def __init__(self):
diff --git a/roka.py b/roka.py
index 4b6a523..8d81641 100755
--- a/roka.py
+++ b/roka.py
@@ -9,7 +9,8 @@ from lib.util import check_auth, escape, generate_rss, read_cache
abs_path = os.path.dirname(os.path.abspath(__file__))
app = Flask(__name__)
-app.config.from_pyfile(os.path.join(abs_path, 'app.cfg'))
+if os.path.exists(os.path.join(abs_path, 'app.cfg')):
+ app.config.from_pyfile(os.path.join(abs_path, 'app.cfg'))
cache_path = os.path.join(abs_path, 'cache')
json_path = os.path.join(cache_path, 'audiobooks.json')