From 8c8c0c626fb0635a3c25ecc5d4327f7deb773ce7 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Tue, 31 Mar 2020 02:10:46 +1100 Subject: [PATCH] Allow overriding config file location with LEDGER_PYREPORT_CONFIG environment variable --- ledger_pyreport/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ledger_pyreport/config.py b/ledger_pyreport/config.py index 0e6cb8c..da57a7f 100644 --- a/ledger_pyreport/config.py +++ b/ledger_pyreport/config.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import os import yaml -with open('config.yml', 'r') as f: +with open(os.getenv('LEDGER_PYREPORT_CONFIG', 'config.yml'), 'r') as f: config = yaml.safe_load(f)