1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 09:32:23 +03:00

315 Commits

Author SHA1 Message Date
A_D
278480b99f replaced ors with defaults in config usage 2021-04-01 14:45:46 +01:00
Athanasius
25852997c5 Updated all source to use new config methods
# Conflicts:
#	monitor.py
2021-04-01 14:45:46 +01:00
Athanasius
bd670b7ff1 Updated plugins to expect that CAPI data is safe
# Conflicts:
#	plugins/eddn.py
2021-04-01 14:45:45 +01:00
Athanasius
9b09d8bd07 plugins/inara: Close down logging & Remove unused this.queue.
* The new_worker/NewThis doesn't currently have a mechanism to ask the
 new_worker to exit.  It's relying on being a daemon thread and dying
 once all non-daemon (i.e. main) threads have exited.
2021-04-01 14:45:44 +01:00
Athanasius
8aac704fa1 plugins/edsm: start/stop detailed logging. 2021-04-01 14:45:44 +01:00
Athanasius
983e4d7acb plugins/eddn: Detailed stop logging. 2021-04-01 14:45:44 +01:00
Athanasius
96bb0959f5 EDDN: Only add missing StarPos if for current system
<https://github.com/EDCD/EDMarketConnector/issues/961>

It seems the game can report a Scan event *after* you've jumped to
another system.  So don't blindly set StarPos on Scan, check the
SystemAddress against where we think we are first.
2021-04-01 08:56:35 +01:00
Athanasius
aab2a58a2d Reduce some log spam:
* Comment out the traceback in plugins/eddn.py, the return is enough.
* 'Called with no event_queue' can be TRACE.
* Don't care about "Everything was alright, the near-neutral status just
  wasn't stored." from Inara.
2021-03-23 13:48:44 +00:00
Athanasius
b4d928246e Adjust logging to include type (and not strictly False). 2021-03-22 11:48:52 +00:00
Athanasius
34c0536a7e Paranoia check in sendreplay().
See #926
2021-03-22 11:43:44 +00:00
Athanasius
6bde36ad31 Extend is_horizons() paranoia to type of ships['shipyard_list']
The .values() is on this, so it also needs to be a dict.

I also made the logging of "FC or Damaged Station?" consistent
throughout this file.

Yes, we'll keep these as logger.debug() for now.
2021-03-17 11:26:34 +00:00
Athanasius
740d1bd38a Correct order of arguments to isinstance() 2021-03-15 19:21:17 +00:00
Athanasius
173cffdcfc Add extra logging to is_horizons() if things not as expected.
* Log the type(s) if not dict.
* Log if ships['shipyard_list'] isn't present, despite ships being a
  dict.
2021-03-15 17:06:26 +00:00
Athanasius
98be182922 plugins/eddn: Add paranoia about data in is_horizons()
A damaged station has `"modules": []`, so trips over modules.values().
2021-03-15 17:03:39 +00:00
Athanasius
462cd25312 config: Make config.shutting_down() a property, and change 'callers' 2021-01-11 16:54:09 +00:00
Athanasius
111f445cac plugins/inara: Avoid Tk event_generate() calls during shutdown 2021-01-11 16:45:45 +00:00
Athanasius
bca0231dfc plugins/edsm: Avoid Tk event_generate() calls during shutdown 2021-01-11 16:45:26 +00:00
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