EDMC.py will also need to make CAPI queries using the new threaded
method, but it has no tkinter, thus we need to pass in the event name
when we expect one to be generated, and only generate it if this is not
None.
It will write a file containing JSON that has a top level dict with a
key per endpoint we have data for, and within each of those a dict with
keys for query_time and the raw_data.
Everything from the opening `{` in that raw_data value until the
matching closing `}` is the raw data from the CAPI service.
The whole file happily goes through `jq -S -C '.'` to examine the
output.
* Base the following on common EDMCCAPIReturn: EDMCFailedrequest,
EDMCCAPIRequest, EDMCCAPIResponse. This saves repeating a bunch of
variable types and comments.
* Use the above throughout the 'Update' button flow.
* Still need to address 'Save Raw Data', i.e. AppWindow.save_raw().
* Defined inner functions in the worker function to handle the actual
queries. This allows for *them* to simply return data or raise
exceptions to be caught by the main worker function. *IT* then
handles returning any error appropriately via the queue to AppWindow.
* Due to the coupling between AppWindow and these queries there are
several extra parameters passed into the queue worker and then back
out. This is largely due to having to split AppWindow.getandsend()
into two functions: capi_request_data() and capi_handle_response().
This might get changed to use a class to encapsulate those values,
rather than the bare tuple currently being used.
* No full flake8 & mypy pass done yet.
* Some companion.py globals renamed so their use is more obvious.
1. Sending back a spurious CredentialsError() to check it's now handled,
but other issues blocking the code from getting there currently.
2. Move the "Update suit data from CAPI" call into the AppWindow
handler.
3. Move some more of the old query() exception handling into the worker.
4. session.query() no longer returns anything, and neither should
anything that calls it (like session.station()). This is going to
take quite some unwinding and code moving.
Due to main app being Tk we can't just use Python async functionality.
So instead we have a class to hold a message and optional exception.
And instance of that goes into a queue.
The reading of that in the main thread is triggered by sending a Tk
event.
Much more to come.
* `--trace-on ...` no longer requires `--trace` as well.
* Corrected check for `--trace-on *|all`.
* Updated Contributing.md to reflect mandated use of
`logger.trace_if(...)`, with bare `logger.trace(...)` only for on the
fly, code not going to be merged, use.
A simple HTTP handler has been added that will dump any and all POST
data it gets to EDMC's log.
Additionally, a new command line argument to switch EDMC to using this
as its EDDN target has been added.
Docked at an EDO settlement means CAPI says we are, but we've forgotten
monitor.station because there's not enough Journal information and too
many corner cases to be *sure* of re-using old data.