From e1757a3a993b67bab839a878d0a1a8f10f4a1534 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 22 Jan 2021 13:00:02 +0000 Subject: [PATCH] protocol: Don't use win32-specific edmc://auth if `--force-localserver-for-auth` Tested with a build/install and run with: "c:\Program Files (x86)\EDMarketConnector\EDMarketConnector.exe" --force-localserver-for-auth --trace 2021-01-22 12:57:11.020 - TRACE - protocol.ProtocolHandler.__init__:222: Web ser ver listening on http://localhost:53657/auth --- protocol.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protocol.py b/protocol.py index 886608e6..9dd9aba5 100644 --- a/protocol.py +++ b/protocol.py @@ -7,7 +7,9 @@ import sys from config import appname, config from constants import protocolhandler_redirect +from EDMCLogging import get_main_logger +logger = get_main_logger() if sys.platform == 'win32': from ctypes import * @@ -74,7 +76,7 @@ if sys.platform == 'darwin' and getattr(sys, 'frozen', False): protocolhandler.master.after(ProtocolHandler.POLL, protocolhandler.poll) -elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine: +elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine and not config.auth_force_localserver: class WNDCLASS(Structure): _fields_ = [('style', UINT), @@ -217,6 +219,7 @@ else: # Linux / Run from source GenericProtocolHandler.__init__(self) self.httpd = HTTPServer(('localhost', 0), HTTPRequestHandler) self.redirect = 'http://localhost:%d/auth' % self.httpd.server_port + logger.trace(f'Web server listening on {self.redirect}') self.thread = None def start(self, master):