1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-27 05:52:12 +03:00

118 Commits

Author SHA1 Message Date
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
A_D
d31b0fdbf6 Fixed system link updating on FSDTarget
FSDTarget contains the target system under `SystemAddress`, meaning that
any time you selected a star other than the current one, plugins'
`this.system_address` was updated to that target, rather than the
current system. Said updating causes the links provided from system_url
to reflect that update (for providers that support ID64s).

This changes the journal_entry behaviour to only update
`this.system_address` when the event is any of Location, Docked,
or FSDJump, all of which contain only the current system.
2020-08-27 11:32:39 +01:00
Athanasius
113b6c427c station providers: Ensure the 'early station' functionality for all
* If you request docking successfully then show the station namd and
  have the link work.
* This is then only undone if you:
	1) Dock and undock
	2) Supercruise away
	3) Jump away
  It is *not* undone if you simply cancel the docking request.

Tested only with same provider for system and station for each of the
three, not the other 6 combinations.
2020-08-27 11:28:36 +01:00
Athanasius
daed08d206 system/station providers: Sanitise {system,station}_url logic
* Make all plugins use `requests.utils.requote_uri()`
* Make all plugins use roughly the same logic, without if/else trees
 (as the bodies do a `return ...`), ending with `return ''` if input
 parameters are None.

 This throws away the inara fallback to `this.station or this.system` as
 it's unlikely the in-plugin tracking did a better job than the
 monitor.py code.
2020-08-27 11:28:27 +01:00
Athanasius
7617ce7e9c system/station plugin providers: Don't override 'url'
By default the ttkHyperlinkLabels for 'system' and 'station' names have
their 'url' members set to the functions in EDMarketConnector.App.

The EDDB one used to override the function as it had to do that special
name -> EDDB ID lookup from systems.p.  When I changed the code to not
need that any more I didn't fully understand what these overrides were.

After updating the EDDB code I then made sure the same logic was also in
the other plugins which meant they *also* set static strings, overriding
the call to the EDMarketConnector.App functions (which chain through to
the current plugin providers).

Unfortunately I didn't quite update the EDSM code enough causing
journal_entry() code to *not* set a new system 'url' despite changing
the 'text'.  This meant that only CAPI updates (so docking and login)
caused the URL to change, despite updating the 'text' to the correct
system name.

Rather than have everything setting static strings just do away with the
overrides as they're not needed!
2020-08-27 11:25:30 +01:00
Athanasius
f75d8c9c9c plugins/edsm: Set system_link based on system_provider, not station_provider 2020-08-27 11:23:53 +01: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
7951463fba plugins/edsm: Converted 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
29e3cba67e plugins/edsm: Align with code tested in inara plugin
* Use same state logic as Inara plugin now has.
* this.system_link for the Tk item, this.system is the system name.
* Ensure station text+link set on prefs change.
# Add a set of future TODO items.
2020-07-21 17:29:03 +01:00
Athanasius
c25120e0aa plugins/edsm.py makes no use of import companion
So remove it.
2020-07-12 19:10:57 +01: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
35867cd3f9 plugins/edsm.py: De-future 2020-06-21 16:23:01 +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
690ef067b0 keep track of system location if fleet carrier jumps while docked 2020-06-18 17:35:35 +01:00
Jonathan Harris
37a1f0dd23 Notify other plugins of system's EDSM status 2019-01-28 17:22:14 +00:00
Jonathan Harris
52d99e18c7 Drop unused EDShipyard and Coriolis pseudo-events 2018-08-21 18:09:00 +01:00
Jonathan Harris
949a355b67 Don't import outfitting - it's not bundled in the OSX app
Fixes #340
2018-08-21 18:07:35 +01:00
Jonathan Harris
f203b8bc7e Export ship loadout to Coriolis in Journal Loadout format 2018-04-16 01:21:55 +01:00
Jonathan Harris
d62dae3f98 Link to stations tab if undocked 2018-04-04 19:43:45 +01:00
Jonathan Harris
3a3827f168 Make system and station links unclickable if URL not available 2018-04-04 19:34:35 +01:00
Jonathan Harris
37ec61a28d Fix for setting Coriolis link on cAPI Update 2018-04-03 14:41:27 +01:00
Jonathan Harris
0eaa61bdd9 Make system and station info websites configurable 2018-04-03 01:03:07 +01:00
Jonathan Harris
e2d79b9191 Batch up Scan events following NavBeaconScan 2018-03-04 02:38:57 +00:00
Jonathan Harris
c79398eb12 Merge branch 'beyond' 2018-02-26 17:57:49 +00:00
Jonathan Harris
88f323d36e Switch EDShipyard import to Loadout event 2018-02-18 02:38:30 +00:00
Jonathan Harris
d8dd7af2e2 Adjust batching for new startup event order 2018-02-18 02:38:30 +00:00
Jonathan Harris
196cf0fc98 Fix for EDSM outage handling
Fixes #279
2018-02-13 13:28:49 +00:00
Jonathan Harris
4e674f85d5 Log individual event errors 2018-02-10 17:09:32 +00:00
Jonathan Harris
7d1fa33aa0 Try to send any unsent events on closing 2018-01-27 17:51:00 +00:00
Jonathan Harris
bca3d63ffe Check that EDShipyard and Coriolis links shouldn't be discarded 2018-01-27 17:51:00 +00:00
Jonathan Harris
e2161cd108 Get system status from results of StartUp pseudo-event
Fixes #277
2018-01-07 19:04:53 +00:00
Jonathan Harris
8083b1978d Send _systemCoordinates with every event 2018-01-07 18:42:24 +00:00
Jonathan Harris
7d022016fe Don't send ship info to EDSM if EDSM sync not requested or on a crew
Fixes #280
2018-01-07 18:39:14 +00:00
Jonathan Harris
ba4809942a Treat return code 5xx as successfully sent 2018-01-03 17:54:30 +00:00
Jonathan Harris
61aab83244 Send shipID with EDShipyard and Coriolis links 2018-01-03 17:43:33 +00:00
Jonathan Harris
17c24fee81 Batch CommunityGoal events 2018-01-02 18:50:45 +00:00
Jonathan Harris
720a83db36 Send EDShipyard and Coriolis links 2018-01-02 17:16:43 +00:00
Jonathan Harris
b8eb9f979d Synthesise Cargo and Materials events on LoadGame 2018-01-02 16:48:42 +00:00