* A lot of this is commented out. It might be useful in the future, but
is just too noisy for now.
* Changed the protocol webserver to info, as it is.
* Left the EDSM 'not 1XX, 2XX or 5XX' in as it's a warning, so 'pass's
on the conditional bodies that would be empty now trace's are
commented.
Also refactors data.py to edmc_data.py as I'm having weird issues with
PyCharm debugger not starting, and this seems to be to do with module
name clashes.
* monitor.on_foot is now monitor.state['on_foot'] as plugins need to
access it.
* EDDB:journal_entry() now stores that in this.on_foot to check later.
* this.on_foot checked in cmdr_data() to actually set station name from
that data if needs be. This avoids setting it to STATION_UNDOCKED if
data['commander']['docked'] is False, when we're on_foot.
NB: No shipyard in tests because data['ships']['shipyard_list'] is an
empty list. This might be the bug not having been fixed, or the station
might genuinely have no ships for sale. We have no way to check in
Odyssey Alpha Phase 1.
Nothing other than /shipyard actually returns the modules and ships
data, so checking for it anywhere other than that automatically is just
asking for extra log noise and nothing else.
* The companion Session.query is called for *all* CAPI endpoints and
only the /profile one will return lastStartport data, which is where
ships/modules are if present, so only do these checks if we see
lastStarport.
Currently it is simply a dict subclass that does some of the cleanup
required to make everything happy. In future it will be changed to be a
NamedTuple or similar that can be typed
I was testing the new Steam or Epic CAPI auth. My EGS account hasn't
yet been used, so has no commander attached. EDMC thinks the auth has
succeeded in this case, but hitting 'Update' causes it to error because
the returned data is empty.
So, add some checks for lack of 'commander' key and a specific message
"CAPI: No commander data returned" for status line.
Without this there's a KeyError exception thrown, causing the status
line to just get 'commander' in it, which isn't helpful.
Else at least one caller to .station() blows up when it can't find the
commander data.
The call has to be to .station() so as to populate the market/shipyard
added dictionaries.
* Correct use of error[0] to just error.
* We don't want methods not referencing self to be static in this case,
so annotate them.
* Take suggestion of "if v == []:" equivalent to "if not v:".
* Preserve CAPIData typing throughout filter_ship().
* CAPI Data really is just a Dict. Define a custom type so it could
easily be a class in future with minimal edits.
* Auth.refresh() *can* also return a str (Access Token).
* Catch specific (but still quite loose) exceptions in Auth.refresh().
* Set self.server in Session.__init__.
* Remove some extraneous () on conditionals.