From b6346ac33513bf308999ba16c0192acf028558b1 Mon Sep 17 00:00:00 2001 From: jblu Date: Mon, 5 Jun 2023 22:42:00 -0500 Subject: [PATCH] fixed config init --- qbit-maid.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qbit-maid.py b/qbit-maid.py index 9fab02b..fba8df9 100755 --- a/qbit-maid.py +++ b/qbit-maid.py @@ -12,16 +12,17 @@ from collections import Counter import csv import requests as r import os -import sys + class Qbt: def __init__(self): """Main object, should be calling functions from qlist.py, qlogging.py and qprocess.py""" # Open the config. Needs a json file with the data in config.json.example self.st = datetime.datetime.now() - config_file_path=os.environ["toml_path"] - with open(config_file_path, 'rb') as c: - self.config = load(c) + if os.getenv("toml_path"): + config_file_path=os.getenv("toml_path") + with open(config_file_path, 'rb') as c: + self.config = load(c) if os.path.exists('./config.toml'): config_file_path = './config.toml' with open(config_file_path, 'rb') as c: -- 2.45.2