Very tight check on this to be sure we don't ignore other errors.
r.status_code == 400 # Not a different code
$schemaRef == commodities
The message had empty commodities list
r.text == expected return from EDDN Gateway
There are cases where a station/FC doesn't have outfitting modules or a
ships list. Let's make the checks happen in both those functions and be
extra paranoid with some logging.
Closes#671
* The logic for opening replay.jsonl, and detecting if the file was
already there or not was tortured. No longer.
* Changed a few logger.debug(..., exc_info=) to logger.exception().
* Changed all logger.warn() (deprecated) to logger.warning().
Generally for the logic cleanups it was replacing giant list
comprehensions with slightly smaller filter calls. filter() is just
plain cleaner when all you're doing in a list comp is
[x for x in y if somecondition].
Using:
from EDMarketConnector import logger
causes issues if EDMarketConnector is already importing 'this' file.
So just get a logger using logger.getLogger(appname) instead.
`from config import appname` if needs be.
The UI for setting the 'anonymous' option was removed in
f17f5d3f257e2359d4728ce8c296d70dc5e7609f ("PKCE OAuth2 access to cAPI").
Since then there's been no way for a user to set, or unset, this option
(and the associated custom uploaderID). However anyone with the registry keys
still set would have had them take effect.
This commit removes the last bits of code that were making use of it.
Note that the EDDN Relay anonymises all uploaderID values, so no listener
has been seeing the 'raw' values for a long time now.
close#575
* new class `PrefsVersion` in prefs.py. A singleton `prefsSaved` (note
case) is created.
* When new preferences are added and require defaults on first run the
code should use:
`if prefsVersion.shouldSetDefaults(<prior release version>, [<optional old test>]):`
to check if defaults should be set in preferences. So if prior release
was '3.4.6.0' and you've added a new preference with defaults you should
call this with '3.4.6.0' as the first argument.
The <optional old test> is really only for historical purposes, as a
fallback in case no 'PrefsVersion' has yet been set in the user's
Registry/settings file.
* Any code that adds such a new preference **MUST** make changes to the
`versions` dictionary in the PrefsVersion class.
1. Add the predicted next version to the dictionary, with number one
higher than 'current'
2. Set 'current' equal to that new value.
Obviously if other post-last-release code has already done this then you
don't need to.
Failure to update the versions dictionary in this manner will lead to an
Exception being raised, and the code the preferences are for failing
(i.e. EDDN means no EDDN tab on Settings).
Closes#407
Change Output and EDDN options to only get set to defaults if key 'PrefsDidSave' is not present and true. This gets a value of 0x1 saved any time preferences are applied.
The issue was that if you had sufficient options set such that the saved 'output' value was 0x0 then that would evaluate to false and cause the defaults to get set.
Fixes#407