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

197 Commits

Author SHA1 Message Date
A_D
81dfbdfb8e
Added timeout_session, made inara use it
timeout_session provides two things, TimeoutAdapter, a HTTP adapter
subclass that automatically adds timeouts to all requests, and
new_session, which automatically creates a request.Session with the
adapter in the correct place.
2020-07-31 15:53:20 +02:00
A_D
21a285e6e9
added some more type hints 2020-07-31 15:47:28 +02:00
A_D
f8d4731472
fixed incorrect indexing 2020-07-31 15:47:27 +02:00
A_D
eba318430a
Removed todos about unused args 2020-07-31 15:47:27 +02:00
A_D
446c812485
replaced oneline logic with multiline 2020-07-31 15:47:26 +02:00
A_D
67a260c07f
added type hints to literals 2020-07-31 15:47:26 +02:00
A_D
9005798862
fixed incorrect comment 2020-07-31 15:47:25 +02:00
A_D
bb1def48cd
replaced list comp with filter 2020-07-31 15:47:25 +02:00
A_D
a699ab062d
fixed station link logic 2020-07-31 15:47:24 +02:00
A_D
e74c5c8ceb
replaced list comp with filter 2020-07-31 15:47:23 +02:00
A_D
820b29f7dd
replace dict(list-comp) with dict comp 2020-07-31 15:47:23 +02:00
A_D
539580e38d
Consistently formatted multi-line add_event calls 2020-07-31 15:47:22 +02:00
A_D
96279cb0af
Replaced repeated entry['event'] with variable 2020-07-31 15:47:21 +02:00
A_D
71ad0f92ac
removed outdated comment 2020-07-31 15:47:21 +02:00
A_D
8e49066ca4
Replaced convoluted or-based logic with terneries 2020-07-31 15:47:20 +02:00
A_D
9db9ed4dfc
Cleaned up overlong lines 2020-07-31 15:47:19 +02:00
A_D
13c2679c38
Added spacing around scope changes 2020-07-31 15:47:19 +02:00
A_D
160013e3e5
Added type annotations and docstrings 2020-07-31 15:47:18 +02:00
A_D
eec4c2ebd6
autoformat with autopep8 2020-07-31 15:47:18 +02:00
A_D
ce4149efd5 Added debug logs 2020-07-29 14:58:17 +01:00
A_D
d4299c224f
dont force a send on exit
just try and send if we can
2020-07-27 15:12:32 +02:00
A_D
bb817eee3b
removed outdated comment 2020-07-27 15:08:47 +02:00
A_D
340f8928b3
switched to using config for last update time 2020-07-27 15:08:47 +02:00
A_D
34760683e5
added some debug logging 2020-07-27 15:08:46 +02:00
A_D
72498b3bbc
Switched to using a timer for inara updates
This adds a new thread that will run in a loop sending inara events once
ever 30 seconds. The old method of sending once for "special" events has
been removed.
2020-07-27 15:08:46 +02:00
Athanasius
d7c2372417 Flake8 cleanup round #2 2020-07-27 10:14:16 +01:00
Athanasius
f9a23cc831 Clean up flake8 output for this branch 2020-07-27 09:37:10 +01:00
Athanasius
2e58d106bd logging.getLogger(appname) instead of import from EDMarketConnector
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.
2020-07-27 06:57:52 +01:00
Athanasius
8e1f3b8a90 plugins/inara: Fix typo on except: 2020-07-27 06:57:52 +01:00
Athanasius
7d060aa325 plugins/inara: Convert to proper logging 2020-07-27 06:57:52 +01:00
Athanasius
b6f6365566 plugins/edsm: Fix missing line of code
Bad paste or something, who knows ?
2020-07-21 18:25:03 +01:00
Athanasius
01d4c12027 plugins/inara: population recording fix, and misc cleanups 2020-07-21 17:29:03 +01:00
Athanasius
e2c74ed11d plugins/inara: Removed commented out inara_notify_location() code 2020-07-21 17:29:03 +01:00
Athanasius
f7896f3b6a plugins/inara: Track more system/station info, fix URLs
* Track all of: this.system_address, this.system_population,
 this.system_marketid
* Use this.system_address if set (only from journal) for no-dupes Inara
 system URL.
* Added the "'x' if undocked and show system info" functionality from
  EDDB plugin.
* This version will set target station name/link if you request docking
 with it, whether that succeeds or not.  Cleared not only on Undock, but
 also FSDJump and SupercruiseEntry (in case you never actually docked).
* No longer bothering setting system and station URLs from Inara API
 response as we have working ones anyway.  So even those without Inara
 API Key set get the functionality now.
2020-07-21 17:29:03 +01:00
Athanasius
bb28a4fa2f plugins/inara.py: Add two TODOs
* Artie added a 'by-systemaddress' system lookup, use it.
* This means we probably no longer need to update URLs in the
 inara_notify_location() function.
2020-07-21 17:29:03 +01:00
Athanasius
4da1ae331d plugins/inara.py: Track system and station in cmdr_data, and update links
NB: Still need to ensure journal_entry() updates them and links
properly.
2020-07-21 17:29:03 +01:00
Athanasius
63f5db3785 plugins/inara.py makes no use of import companion
So remove it.
2020-07-12 19:24:16 +01:00
A_D
f43141202b
Removed debug print 2020-07-11 20:55:18 +02:00
A_D
061fbddb2d
Fixed wording of comment on last_update_time 2020-07-11 20:53:48 +02:00
A_D
9b82464f88
Fixed updating inara cargo only on major events
This works by checking on _any_ event the status of the cargo vs the
current stored version. If the live cargo differs from the updated
cargo, _and_ we have not sent any update in the past 45 seconds (as this
would have contained the cargo anyway), we queue an actual send to the
API.

This unfortunately isn't checked only when docked, but on the plus side
miners will be happy to have their cargo updated relatively often.

Fixes #477. Possibly not quite what they wanted, but its about as close
as this will get
2020-07-11 20:53:47 +02:00
Athanasius
259bb3bbd6 Merge branch 'release-final-python27' into python3 2020-06-21 16:43:02 +01:00
Jonathan Harris
c62d110448 Plugin migration 2020-06-21 16:33:13 +01:00
Athanasius
4a7f4cd450 plugins/inara.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
bebc3648b8 plugins/inara.py: No need for encode('utf-8') 2020-06-21 16:23:00 +01:00
Athanasius
90b05d22c5 Now runs without console errors so far as pressing 'Update' is concerned.
There's an error on the console about an iterator when doing so
though.
2020-06-21 16:23:00 +01:00
Bernd Gollesch
38ba48c713 added carrier data to CarrierJump event 2020-06-18 17:46:16 +01:00
Bernd Gollesch
098613ea0a There is now an api event for 'CarrierJump' -> 'addCommanderTravelCarrierJump' 2020-06-18 17:46:06 +01:00
Bernd Gollesch
02649b8c6f there is also a 'Factions' list in the 'CarrierJump' event 2020-06-18 17:44:22 +01:00
Bernd Gollesch
b45df6b4fd keep track of location if the carrier you're docked at jumps 2020-06-18 17:44:14 +01:00
VAKazakov
994624d83b
changing division by int to float, as suggested 2020-03-05 11:52:34 +03:00