From efc3c9030d211c09c5af869bb654153693fceabe Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 6 Apr 2021 17:58:29 +0100 Subject: [PATCH] protocol.py: Silence web server INFO if running without UI Testing the outfitting.py changes brought this to light. I know, e.g. TCE that uses EDMC.exe likes to have no extraneous output. --- protocol.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protocol.py b/protocol.py index 471876b1..eff33e5e 100644 --- a/protocol.py +++ b/protocol.py @@ -1,5 +1,6 @@ """protocol handler for cAPI authorisation.""" +import os import sys import threading import urllib.error @@ -336,7 +337,9 @@ else: # Linux / Run from source super().__init__() self.httpd = HTTPServer(('localhost', 0), HTTPRequestHandler) self.redirect = f'http://localhost:{self.httpd.server_port}/auth' - logger.info(f'Web server listening on {self.redirect}') + if not os.getenv("EDMC_NO_UI"): + logger.info(f'Web server listening on {self.redirect}') + self.thread: Optional[threading.Thread] = None def start(self, master) -> None: