From 48550beb601f38d9922b3c7b3f2773588935c749 Mon Sep 17 00:00:00 2001 From: gauthiier Date: Thu, 27 Jul 2017 16:29:23 +0200 Subject: [PATCH] fixing relative path issues with archives/ (bis) --- .gitignore | 1 + search/archive.py | 3 ++- www/__init__.py | 1 + www/archives.py | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 74e0d3b..951da93 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # mailinglists specific archives/ +config.py # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/search/archive.py b/search/archive.py index 5301b88..3dff99f 100644 --- a/search/archive.py +++ b/search/archive.py @@ -5,7 +5,8 @@ class Archive(): def __init__(self, archives_dir=None): if archives_dir==None: - self.archives_dir = "archives/" + from www import config + self.archives_dir = config.ARCHIVES_PATH else: self.archives_dir = archives_dir diff --git a/www/__init__.py b/www/__init__.py index be9899a..325dcc6 100644 --- a/www/__init__.py +++ b/www/__init__.py @@ -3,6 +3,7 @@ from flask import Flask app = Flask(__name__) from www import routes +from www import config # import logging # logging.basicConfig(level=logging.DEBUG) diff --git a/www/archives.py b/www/archives.py index 8adfbec..71813b8 100644 --- a/www/archives.py +++ b/www/archives.py @@ -11,7 +11,8 @@ class Archives(metaclass=Singleton): def __init__(self, archives_dir=None): if archives_dir==None: - self.archives_dir = "archives/" + from www import config + self.archives_dir = config.ARCHIVES_PATH else: self.archives_dir = archives_dir