* Use `Exception` not `BaseException` for `EDMCCAPIFailedRequest.exception`.
* Initialise Auth.request_session in its `__init__()`. This *should* fix
#1727 - as there'll then be no way for a `Session` to have methods invoked
without this set up.
* Added `capi.request.<endpoint>` killswitches at appropriate call points.
* Added `eddn.capi_export.<type>` killswitches. This allows for killing
just the EDDN export of such CAPI-derived data, without stopping the actual
queries, as other plugins/functionality might still have harmless use of
the data.
* PLUGINS.md: Actually describe the contents of `data` passed to plugins, and
point out it might not always contain market or shipyard data. This is
not only because of the new killswitches, but could already have happened
if the station/port docked at didn't have the services.
* Some misc typing cleanups.
* New CL arge `--killswitches-file`. This needs to reference a file either
with an absolute path, or relative to the CWD of the process.
* Internally if the argument is provided it is prefixed with `"file:"` in
order to actually be loaded. This is because `requests` doesn't have an
adapter for `file:` URLs.
* Also fixes a visual bug with reporting of active killswitches. The entire
SingleKill object was used instead of just its `reason` property. mypy
type checks caught this.
* The older version didn't like `check_untyped_defs = True` in .mypy.ini.
* Trying `-repo: local` lead to an error about config options.
* We really need a way to have this track the non-pre-commit version of mypy.
But, as it turns out, the uses of this code and data are very minimal.
No-one's been complaining about things being out of date or not working.
All of these *_map dictionaries are just for mapping parts of module
identifiers to English Text. In the end they only end up in the output of
`EDMC.py -e <file>`, which despite being called "E:D Shipyard plain text
format" isn't actually supported by edsy.org.
* eddn: Don't schedule `queue_check_and_send()` if EDMC_NO_UI.
* `export_(commodites|outfitting|shipyard)` lost the `is_odyssey` argument
in 556ace5306bebbcf34c1a56a9023a822218a73f1 .
* EDDNSender: Helper `set_ui_status()` in which the check for EDMC_NO_UI
is performed. Used in `send_message()`. In the EDMC_NO_UI case it will
INFO log the text instead.
* Additional Allowed Imports `from companion ...`.
* Plugin authors will still need to chain `cmdr_data_legacy()` to calling
`cmdr_data()`, but with sanctioned access to `data.source_host` they can
then determine the galaxy data source.
* Re-worked the documentation for CAPI data a little to make all of this as
clear as possible.
It can be `tk.NORMAL` or `tk.DISABLED`. Why `True` was ever used I don't
know, possibly relying on undefined behaviour.
However, those 'types' end up as `Literal['normal']` and `Literal['disabled']`
and the only way to declare a Union of those is to be explicit with the
actual strings. tk.(NORMAL|DISABLED) are not a types.
`mypy EDMarketConnector.py` was throwing a warning:
By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
for some things. Bizarrely including e.g.
play_bad: bool = False
* Renames `plug.notify_newdata()` to the more precise `notify_capidata()`.
* If CAPI data was from SERVER_LEGACY, then use plugin `cmdr_data_legacy()`
instead of `cmdr_data()`.