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

32 Commits

Author SHA1 Message Date
A_D
b27e4a3628
fixed tk import and type annotations 2020-07-27 15:15:56 +02:00
A_D
cad5f72b0a
updated type annotation 2020-07-27 15:15:55 +02:00
A_D
7b231fb244
removed unicode specifier from string
python3 strings are always unicode
2020-07-27 15:15:55 +02:00
A_D
07c43d3057
added type annotations to globals 2020-07-27 15:15:54 +02:00
A_D
e0462d8719
Replaced complex oneliner with multiline if 2020-07-27 15:15:54 +02:00
A_D
37181264c9
Added newline after scope changes 2020-07-27 15:15:53 +02:00
A_D
4eed4404c6
Added Any type hint to this
Resolves most type warnings
2020-07-27 15:15:53 +02:00
A_D
ab58aa6355
autoformatted file 2020-07-27 15:15:52 +02: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
99d1578780 plugins/eddb: 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.
* List some tests to pass (and later to be implemented as unittests).
* Be paranoid about URIs, quote them.
* Ensure station text+link set on prefs change.
2020-07-21 17:29:03 +01:00
Athanasius
4c4511a66d plugins/eddb: Remove misleading comments about 'Only use CAPI...'
This is needed for "not even running the game" CAPI update to be useful.
2020-07-21 17:29:03 +01:00
Athanasius
ec32849a17 plugins/eddb: Fallback to system_name if no system_address
* Cleans up imports.
* Fixes some '<tab># ...' to use 2 spaces.
* Add type hints to system_url().
* Always store, even if not current provider: this.{system_address,
  station_marketid,system_population}
2020-07-13 22:12:29 +01:00
Athanasius
f3e25f0340 EDDB system URL: Don't pick up system_address from CAPI at all 2020-07-13 21:03:57 +01:00
Athanasius
317a0f6b63 EDDB is default station provider, do station_marketid as needed
We need a better way to do provider defaults.  Heck, settings defaults period.
Let's assume we'll put in place a "standard" config file once we move to one.
2020-07-11 19:47:30 +01:00
Athanasius
6932fdc883 EDDB: Use CAPI for system_address/station_marketid only if not already set
See issue #586 - a user had incorrect system_address set, but only sometimes.

This could possibly be due to CAPI errors/lag, so only use it as the source
when the values aren't yet set.  Otherwise Journal should always have provided
the correct value in a timely manner.
2020-07-11 18:57:04 +01:00
Athanasius
cd02d1664a Change EDDB system_url to use SystemAddress
* This means storing this.system_address from both cmdr_data and journal_entry.  NB: If the current value in the event or data is 'None' it will retain the previous value.  Without this Journal entries without SystemAddress erase the stored value.
 * The station_url() fallback to system_url() similarly uses this.system_address in the call.

Addresses #512
2020-07-01 15:51:14 +01:00
Athanasius
f6b3109a09 Remove the last of the {stations,systems}.p code from EDDB plugin
There is one tiny regression for a very, very corner case.

  In 3.46 if you use EDDB as the 'Station' provider and:

	1. Dock at Station A, in System X
	2. Jump out to System Y, which is also populated
	3. Exit out of the game
	4. (Re-)Start EDMC
	5. Hit 'Update' to manually trigger CAPI data retrieval

you will see a "×" character as the Station Name, and can click on it to
take you to the EDDB *System* page.  It is only there because of EDMC
using systems.p to check if System Y is populated.

  With this version in that circumstance there's no way to know that
System Y is populated, so the code assumes not and doesn't show the
"×", and thus there's nothing to click to go to the EDDB *System* page
for System Y.

  But so long as the user is actually running the game and EDMC together
then populated status is detected from Journal events and the "×" will
be there whenever you're undocked but in a populated system.
  Caveat: We know Frontier have allowed some systems that are
technically populated, but show a Population of zero.  This code assumes
that means they're *not* populated.
2020-07-01 15:51:14 +01:00
Athanasius
0541e404ec Track system population in monitor, and use in eddb
EDDB station link now triggers off this.system_population, which is
received via monitor passing 'Population' through in Startup, Location,
FSDJump and CarrierJump events.

  One fewer use cases for systems.p (populated status in this case).
2020-07-01 15:51:14 +01:00
Athanasius
ad81339495 Check eddb.system_name is set before attempting to quote it
urllib.parse.quote does *not* like being passed None.
2020-07-01 15:51:14 +01:00
Athanasius
6ed7590ba9 Update eddb.station_marketid from CarrierJump as well
This shouldn't actually be necessary, the marketid shouln't change
because of a jump, and would have been picked up from the other events
anyway, but it should do no harm to set it again from this.
2020-07-01 15:51:14 +01:00
Athanasius
2df8610e42 eddb: Ensure system_name is quoted for URL 2020-07-01 15:51:14 +01:00
Athanasius
1a11202aea Implement tracking station MarketID, and use in eddb plugin
* Adds monitor.station_marketid, tracked at the same points as
   monitor.station (name).
 * Changes EDDB plugin to also track its own this.station_marketid so
   that it can be used in /market-id/ EDDB URL.
   This removes a use case for stations.p file.
2020-07-01 15:51:14 +01:00
Athanasius
553c7980c1 Change EDDB system_url() to using by-name URL
This removes a use case for systems.p file
2020-07-01 15:51:14 +01:00
Jonathan Harris
e192c2ca2e Plugin migration 2019-10-02 03:01:08 +01:00
Athanasius
a505402d2a plugins/eddb.py: De-future 2019-09-26 11:40:42 +01:00
Athanasius
9910024004 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.
2019-09-26 11:40:41 +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
6887a225bb Add bubble and Colonia systems to eddb database 2018-04-04 13:52:51 +01:00
Jonathan Harris
0eaa61bdd9 Make system and station info websites configurable 2018-04-03 01:03:07 +01:00
Jonathan Harris
698b37b7bd Update eddb database 2017-10-17 00:21:35 +01:00
Jonathan Harris
60ad3b4c09 Inform plugins of Cmdr and Beta status
Notify plugins when Cmdr or Beta status changes while the preferences dialog
is open.

Display a note on the Credentials tab when Cmdr is not set. Addresses #224
2017-07-29 15:36:43 +01:00
Jonathan Harris
fe0835be10 Switch eddb integration to a plugin 2017-07-29 14:42:00 +01:00