mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Set config flag for --force-edmc-protocol so protocol.py can test it
This commit is contained in:
parent
c466d17553
commit
ae2bbc8929
@ -111,6 +111,15 @@ if __name__ == '__main__': # noqa: C901
|
||||
if args.force_localserver_for_auth:
|
||||
config.set_auth_force_localserver()
|
||||
|
||||
if args.force_edmc_protocol:
|
||||
if sys.platform == 'win32':
|
||||
config.set_auth_force_edmc_protocol()
|
||||
|
||||
else:
|
||||
print("--force-edmc-protocol is only valid on Windows")
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
|
||||
def handle_edmc_callback_or_foregrounding() -> None: # noqa: CCR001
|
||||
"""Handle any edmc:// auth callback, else foreground existing window."""
|
||||
logger.trace('Begin...')
|
||||
|
14
config.py
14
config.py
@ -182,6 +182,7 @@ class AbstractConfig(abc.ABC):
|
||||
|
||||
__in_shutdown = False # Is the application currently shutting down ?
|
||||
__auth_force_localserver = False # Should we use localhost for auth callback ?
|
||||
__auth_force_edmc_protocol = False # Should we force edmc:// protocol ?
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.home_path = pathlib.Path.home()
|
||||
@ -212,6 +213,19 @@ class AbstractConfig(abc.ABC):
|
||||
"""
|
||||
return self.__auth_force_localserver
|
||||
|
||||
def set_auth_force_edmc_protocol(self):
|
||||
"""Set flag to force use of localhost web server for Frontier Auth callback."""
|
||||
self.__auth_force_edmc_protocol = True
|
||||
|
||||
@property
|
||||
def auth_force_edmc_protocol(self) -> bool:
|
||||
"""
|
||||
Determine if use of localhost is forced for Frontier Auth callback.
|
||||
|
||||
:return: bool - True if we should use localhost web server.
|
||||
"""
|
||||
return self.__auth_force_edmc_protocol
|
||||
|
||||
@property
|
||||
def app_dir(self) -> str:
|
||||
"""Return a string version of app_dir."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user