mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-22 03:06:59 +03:00
plugins/eddn: Use correct logging function & new_data typing
* `logger.INFO` will, at best, be a constant, it should be `logger.info()`. * When we're not interested in the `new_data` 2nd part of the tuple from `killswitches.check_killswitch()` we can't use `_` as there's a potential class with the `l10n.py` injection of `_()` as a builtin. And you can't declare types withing first-use in a return-tuple. So, declare them on their own lines, with throwaway default values instead.
This commit is contained in:
1 file changed
+7
-1
+7
-1
@@ -379,7 +379,7 @@ class EDDNSender:
|
||||
:param text: The status text to be set/logged.
|
||||
"""
|
||||
if os.getenv('EDMC_NO_UI'):
|
||||
logger.INFO(text)
|
||||
logger.info(text)
|
||||
return
|
||||
|
||||
self.eddn.parent.children['status']['text'] = text
|
||||
@@ -635,6 +635,8 @@ class EDDN:
|
||||
:param data: a dict containing the starport data
|
||||
:param is_beta: whether or not we're currently in beta mode
|
||||
"""
|
||||
should_return: bool = False
|
||||
new_data: Dict[str, Any] = {}
|
||||
should_return, new_data = killswitch.check_killswitch('capi.request./market', {})
|
||||
if should_return:
|
||||
logger.warning("capi.request./market has been disabled by killswitch. Returning.")
|
||||
@@ -766,6 +768,8 @@ class EDDN:
|
||||
:param data: dict containing the outfitting data
|
||||
:param is_beta: whether or not we're currently in beta mode
|
||||
"""
|
||||
should_return: bool = False
|
||||
new_data: Dict[str, Any] = {}
|
||||
should_return, new_data = killswitch.check_killswitch('capi.request./shipyard', {})
|
||||
if should_return:
|
||||
logger.warning("capi.request./shipyard has been disabled by killswitch. Returning.")
|
||||
@@ -832,6 +836,8 @@ class EDDN:
|
||||
:param data: dict containing the shipyard data
|
||||
:param is_beta: whether or not we are in beta mode
|
||||
"""
|
||||
should_return: bool = False
|
||||
new_data: Dict[str, Any] = {}
|
||||
should_return, new_data = killswitch.check_killswitch('capi.request./shipyard', {})
|
||||
if should_return:
|
||||
logger.warning("capi.request./shipyard has been disabled by killswitch. Returning.")
|
||||
|
||||
Reference in new issue
Block a user