From 43c79b13cac4742fdd7101d45f1a507cfdd00636 Mon Sep 17 00:00:00 2001 From: jblu Date: Mon, 5 Jun 2023 23:16:19 -0500 Subject: [PATCH] changed apprise client --- AppriseClient.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/AppriseClient.py b/AppriseClient.py index c6f4aa9..f8a8992 100644 --- a/AppriseClient.py +++ b/AppriseClient.py @@ -10,20 +10,17 @@ def apprise_notify(req_obj, host, port, aurls, title, body): class AppriseClient: def __init__(self): - self.config = '' - try: - if os.get["DOCKER"]: - self.host = os.environ["host"] - self.port = os.environ["port"] - self.aurls = os.environ["aurls"] - self.title = os.environ["title"] - self.body = os.environ["body"] - if os.environ["toml_path"]: - config_file_path=os.environ["toml_path"] - with open(config_file_path, 'rb') as c: - self.config = load(c) - except: - KeyError + if os.getenv("DOCKER"): + self.host = os.getenv("host") + self.port = os.getenv("port") + self.aurls = os.getenv("aurls") + self.title = os.getenv("title") + self.body = os.getenv("body") + 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: