1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-16 17:12:21 +03:00

298 Commits

Author SHA1 Message Date
Athanasius
3d3baaea8e EDSM: Finer-grained and more detailed logging of API results 2020-10-01 11:47:31 +01:00
Athanasius
a4b334dcfb EDSM: When we API call a Location event, log all events in that call. 2020-09-28 15:34:39 +01:00
Athanasius
abc1507aa0 Also allow sending empty commodities from Market.json 2020-09-28 13:02:10 +01:00
Athanasius
dea7b3660a Minor formatting cleanups 2020-09-28 12:48:53 +01:00
Athanasius
e908cce242 Change the multi-line conditional to using () not \\n 2020-09-28 12:41:44 +01:00
Athanasius
ca4214fff8 EDDN: Catch and log 'we tried to send empty market'.
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
2020-09-28 12:26:09 +01:00
Athanasius
9564d8ab4f EDDN: Allow sending of empty market data for updating FCs. 2020-09-28 12:00:28 +01:00
Athanasius
1aba1a0596 Trace: Change several calls from debug to trace. 2020-09-23 22:07:18 +01:00
Athanasius
85d45aadd7 Place detailed logging for "Location" events.
To try and track down what's happening with #713
2020-09-23 11:45:48 +01:00
Athanasius
a3b69fd94d Switch internal plugins to EDMCLogging.get_main_logger() 2020-09-22 16:20:05 +01:00
Athanasius
a1ae87ed39
Merge pull request #705 from A-UNDERSCORE-D/cleanup/inara-2
Continued inara cleanup
2020-09-22 14:15:32 +01:00
A_D
c02b292f50
Removed uneeded list comps 2020-09-22 14:51:45 +02:00
A_D
f8523e0a9f
removed parens around tuple unpack 2020-09-22 14:49:24 +02:00
A_D
e930911415
remove double assign 2020-09-22 14:49:23 +02:00
A_D
9710a5e9bb
repalced assert with log and continue 2020-09-22 14:49:23 +02:00
A_D
375573c0a8
fixed docstrings 2020-09-22 14:49:22 +02:00
A_D
615a36452d
Added docstrings 2020-09-22 14:49:22 +02:00
A_D
4a7cddc48b
removed assert False 2020-09-22 14:48:54 +02:00
A_D
26be93f92e
replaced magic number row with var 2020-09-22 14:48:53 +02:00
A_D
fb080f8080
Removed unused imports 2020-09-22 14:48:53 +02:00
A_D
893cab3c23
cleaned up logic where possible 2020-09-22 14:48:52 +02:00
A_D
f2add920c7
replaced constant contains checks with tuples 2020-09-22 14:48:52 +02:00
A_D
62f3203c3f
Added type checker hint for unbound names
Due to the fact that cmdr and entry are only assigned if item exists, a
situation can arise where any access to the names will raise an
UnboundLocalException, this tells the type checker to ignore that
possibility by using a TYPE_CHECKING guarded assignment to those names.

This does not fix the issue at runtime, it just tells the type checker
that its fine. As this remains a bug, I have left TODOs in to note its
existence.
2020-09-22 14:48:51 +02:00
A_D
7ab697a807
Used default option for .get on dicts 2020-09-22 14:48:00 +02:00
A_D
25adf29779
Fixed possible error if credentials is None 2020-09-22 14:48:00 +02:00
A_D
2c2ade05e0
fixed some naming 2020-09-22 14:46:23 +02:00
A_D
20357b3deb
replaced modulo formatting with fstrings 2020-09-22 14:46:22 +02:00
A_D
81c977d0da
Added type annotations to functions 2020-09-22 14:46:22 +02:00
A_D
14617e72da
cleaned up overlong lines 2020-09-22 14:43:24 +02:00
A_D
199e76701d
Added line breaks around scope changes 2020-09-22 14:43:24 +02:00
A_D
743984eb11
Added fake definition for _
_ is added by magic in the plugin loading system, which means there are
no imports to indicate its existence to static analysis tools.
2020-09-22 14:41:34 +02:00
A_D
d2a1f09fac
sorted imports 2020-09-22 14:41:34 +02:00
A_D
37c53e233e
autoformatted code with autopep8 2020-09-22 14:41:33 +02:00
Athanasius
0f12959d53 plugins/edsm: Also DEBUG log Location and Docked events. 2020-09-22 12:26:54 +01:00
Athanasius
0efe38540f Extend logging to FSDJump as well for ease of testing.
FSDJump happens, relatively, seldom enough to not be too spammy.
2020-09-18 15:33:18 +01:00
Athanasius
3f001a383f plugins/edsm: Add extra logging for CarrierJump events.
We've had reports about EDSM not updating for these, so add logging to
see if it's a bug our end.
2020-09-18 15:15:02 +01:00
Athanasius
f485ffa737 Correctly return and receive bare Tuple, not nested. 2020-09-18 12:59:09 +01:00
Athanasius
22a8da5bf7 Add ships sanity checking, and it's all in a helper function now.
* Moved these modules and ships checks to safe_modules_and_ships().
* Applied some paranoia checks to ships as well.
2020-09-18 11:38:20 +01:00
Athanasius
81f71c88ff Catch where station modules from CAPI is an empty list.
Out of paranoia we're also checking if it's a non-empty list and logging
that as an error if encountered.  It should be a dictionary!
2020-09-18 11:15:15 +01:00
A_D
6fc2ab063e
finished type annotation 2020-09-18 07:28:30 +02:00
A_D
5af2511137
Updated docstrings 2020-09-18 06:44:20 +02:00
Athanasius
31203270bc Switch to "thing is None" on tests. 2020-09-14 15:43:15 +01:00
Athanasius
735e37e10e Revert is_horizons to modules: MAP_STR_ANY as it works 2020-09-14 13:32:06 +01:00
Athanasius
d45070c249 plugins/eddn: Tweak ships/modules in export of shipyard and outfitting from CAPI
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
2020-09-14 13:26:20 +01:00
Athanasius
99bac688af eddn: Tweak replay.jsonl try/except flow
* Catch OSError instead of Exception (which is *too* general).
* Put the set of self.replaylog in try/else so it only runs when there
  are no errors.
2020-09-09 14:36:38 +01:00
Athanasius
5e35012611 eddn: flake8 cleanups
* That "EDDN send failed" was too long, so now it's '''-formatted.
* journal_entry() cognitive complexity isn't changing any time soon.
2020-09-09 14:17:39 +01:00
Athanasius
48077f6a30 eddn: Straighten out replay.jsonl opening & minor cleanups.
* 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().
2020-09-09 14:03:40 +01:00
Athanasius
5d612822da eddn: Tweak the extra EDDN failed message logging format.
It's more readable with \n between each part, and added a prefix.
2020-09-09 13:51:15 +01:00
Athanasius
e693af1283 EDDN: Log the message we tried to send if it fails. 2020-09-08 18:51:17 +01:00
Athanasius
c1d8a61c60 Whitespace and keyring in requirements sync to develop 2020-08-27 12:56:34 +01:00