mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-05 01:43:16 +03:00
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
This commit is contained in:
parent
3b2b658881
commit
e1757a3a99
@ -7,7 +7,9 @@ import sys
|
|||||||
|
|
||||||
from config import appname, config
|
from config import appname, config
|
||||||
from constants import protocolhandler_redirect
|
from constants import protocolhandler_redirect
|
||||||
|
from EDMCLogging import get_main_logger
|
||||||
|
|
||||||
|
logger = get_main_logger()
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
from ctypes import *
|
from ctypes import *
|
||||||
@ -74,7 +76,7 @@ if sys.platform == 'darwin' and getattr(sys, 'frozen', False):
|
|||||||
protocolhandler.master.after(ProtocolHandler.POLL, protocolhandler.poll)
|
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):
|
class WNDCLASS(Structure):
|
||||||
_fields_ = [('style', UINT),
|
_fields_ = [('style', UINT),
|
||||||
@ -217,6 +219,7 @@ else: # Linux / Run from source
|
|||||||
GenericProtocolHandler.__init__(self)
|
GenericProtocolHandler.__init__(self)
|
||||||
self.httpd = HTTPServer(('localhost', 0), HTTPRequestHandler)
|
self.httpd = HTTPServer(('localhost', 0), HTTPRequestHandler)
|
||||||
self.redirect = 'http://localhost:%d/auth' % self.httpd.server_port
|
self.redirect = 'http://localhost:%d/auth' % self.httpd.server_port
|
||||||
|
logger.trace(f'Web server listening on {self.redirect}')
|
||||||
self.thread = None
|
self.thread = None
|
||||||
|
|
||||||
def start(self, master):
|
def start(self, master):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user