1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 00:07:14 +03:00

Move the 'duplicate' constants into a new constants.py

1. So now they're only defined in one place.
2. config.py does an import of them, and `from config import ...` then
   chains through, so no need to update other users.
3. No need to ' # noqa E402' the killswitch/config imports now.
This commit is contained in:
Athanasius 2021-01-13 15:23:11 +00:00
parent 9fcaee9c88
commit 2ec767405f
2 changed files with 5 additions and 5 deletions

View File

@ -16,11 +16,10 @@ from sys import platform
from time import localtime, strftime, time
from typing import TYPE_CHECKING, Any, Mapping, Optional, Tuple, cast
from constants import applongname, appname, protocolhandler_redirect
# config will now cause an appname logger to be set up, so we need the
# console redirect before this
appname = 'EDMarketConnector' # TODO: Must match config.appname, add test
applongname = 'E:D Market Connector' # TODO: Must match config.applongname, add test
protocolhandler_redirect = 'edmc://auth' # TODO: Must match protocolhandler.redirect, add test
if __name__ == '__main__':
def no_other_instance_running() -> bool: # noqa: CCR001
"""
@ -143,8 +142,8 @@ if __name__ == '__main__':
# TODO: Test: Make *sure* this redirect is working, else py2exe is going to cause an exit popup
# isort: off
import killswitch # noqa: E402 # Will cause a logging import/startup so needs to be after the redirect
from config import applongname, appname, appversion, appversion_nobuild, config, copyright # noqa: E402
import killswitch # Will cause a logging import/startup so needs to be after the redirect
from config import appversion, appversion_nobuild, config, copyright
# isort: on

View File

@ -7,6 +7,7 @@ import sys
from EDMCLogging import get_main_logger
from config import config
from constants import protocolhandler_redirect
logger = get_main_logger()