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

181 Commits

Author SHA1 Message Date
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
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