From b78a7ca58458712219e933931e6ba3f9eecdf71d Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Thu, 27 Jun 2019 23:54:49 +0200 Subject: [PATCH] Make globals overridable --- moulinette/globals.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/moulinette/globals.py b/moulinette/globals.py index 843097b0..885667c6 100644 --- a/moulinette/globals.py +++ b/moulinette/globals.py @@ -1,4 +1,8 @@ -DATA_DIR = '/usr/share/moulinette' -LIB_DIR = '/usr/lib/moulinette' -LOCALES_DIR = '/usr/share/moulinette/locale' -CACHE_DIR = '/var/cache/moulinette' +"""Moulinette global configuration core.""" + +from os import environ + +DATA_DIR = environ.get('MOULINETTE_DATA_DIR', '/usr/share/moulinette') +LIB_DIR = environ.get('MOULINETTE_LIB_DIR', '/usr/lib/moulinette') +LOCALES_DIR = environ.get('MOULINETTE_LOCALES_DIR', '/usr/share/moulinette/locale') +CACHE_DIR = environ.get('MOULINETTE_CACHE_DIR', '/var/cache/moulinette')