1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-05-27 21:59:38 +03:00

2153 Commits

Author SHA1 Message Date
Athanasius
c1dfc3ac1f Plugins "Not Python 3.x": Hacky escaping fix so translations work 2020-08-26 14:13:06 +01:00
Athanasius
8d6f761fb9 plugins/inara: return '' if can't otherwise make system_url 2020-08-26 12:01:45 +01:00
Athanasius
bf9d7dff89 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-26 11:55:23 +01:00
Athanasius
c9dee18d70 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-26 10:18:10 +01:00
Athanasius
d46358796f 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-25 21:38:22 +01:00
Athanasius
669f895ffa plugins/edsm: Set system_link based on system_provider, not station_provider 2020-08-25 13:37:26 +01:00
Athanasius
c0ff2ff612
Merge pull request #658 from A-UNDERSCORE-D/cleanup/eddn
Cleanup eddn plugin
2020-08-19 11:14:24 +01:00
Athanasius
397e24d8c8
Merge pull request #660 from A-UNDERSCORE-D/rewrite/inara-deque
Rewrote inara queue system
2020-08-19 11:09:03 +01:00
Athanasius
5083db9918 Release 4.0.4: Correct translations and update appcast length
* Pulling in latest translations meant needing to change %H:%M:%S back
 to {HH}:{MM}:{SS}.
* Built and tested, so has appcast length updated too.
2020-08-07 20:09:49 +01:00
Athanasius
f35d9542f6 Translations: Minor changes
* Back to {HH}:{MM}:{SS} for this.
* A few extra "Use alternate URL method" translations.
2020-08-07 20:09:39 +01:00
Athanasius
238817a68c Release 4.0.4: Post-build appcast length update 2020-08-07 20:08:46 +01:00
Athanasius
ab8aa732d7 Release 4.0.4: Mention Python 3.7.8 in changelogs. 2020-08-07 20:08:36 +01:00
Athanasius
ab494e6472 Release 4.0.4: Changelog, version, appcast
* Version 4.0.4
* ChangeLog.md
* edmarketconnector.xml (except length)
2020-08-07 20:08:10 +01:00
Athanasius
02cd8fc447 Merge branch 'release-4.0.4' into stable 2020-08-07 20:06:13 +01:00
A_D
de872cdfa6
Added warning log messages 2020-08-07 15:46:46 +02:00
A_D
7adf522de9
Replaced repeated code with helper function 2020-08-07 15:18:33 +02:00
A_D
a88cb454da
Removed todo related to Horizons 2020-08-07 14:54:43 +02:00
A_D
94418dc4fa
Switched to using pathlib 2020-08-07 14:54:04 +02:00
A_D
17f8433a6a
clarify comment 2020-08-07 14:45:48 +02:00
A_D
237e5ce52d
Replaced subscript and concat with replace() call 2020-08-07 14:43:53 +02:00
A_D
b5d3b89a3c
Added docstrings and further type annotations 2020-08-07 14:39:12 +02:00
A_D
265faf3cdd
Reordered imports 2020-08-07 13:45:06 +02:00
A_D
3155b929fa
Fixed docstring on Credentials, log wording 2020-08-07 13:37:19 +02:00
A_D
d5dd23ce38
Missed an add_event call 2020-08-07 13:34:31 +02:00
A_D
dd85fc0504
Rewrote inara queue system
This replaces the list+queue system that the inara plugin originally
used with a deque based one.

The main differences here are that the list the worker thread uses to
send to inara and the list that events are added to is the same, with
the worker thread making a duplicate and clearing the original each time
it sends events (losing events if it fails to upload three times).

The format of the data has changed as well, from simple tuples to
NamedTuple classes that provide some extra type safety and sanity when
accessing fields.

The event queue itself is actually multiple queues, one per
API/FID/CMDR_name triplicate, thus allowing multiple commander switches
while we're running without causing any weird issues
2020-08-07 13:34:30 +02:00
A_D
a21280ed3b
reordered imports 2020-08-07 13:32:01 +02:00
A_D
5aa6795773
Type annotate all the things! 2020-08-07 13:20:24 +02:00
A_D
94c4a7b7d0
Replaced static lists with tuples 2020-08-07 13:20:24 +02:00
A_D
cea8ac49ca
Ensured that regexps are raw strings
Ensures that there are no weird excaping issues
2020-08-07 13:20:23 +02:00
A_D
e477f89664
removed un-needed object subclass 2020-08-07 13:20:23 +02:00
A_D
3c66ab7246
removed unused imports 2020-08-07 13:20:22 +02:00
A_D
6772c84a5f
fixed names where possible 2020-08-07 13:20:22 +02:00
A_D
c0026cea61
replaced list comps with generators 2020-08-07 13:20:21 +02:00
A_D
c012ebc54e
Replaced modulo-formatting with fstrings
Specifically did not replace `somefile.write('%s\n' % some_data)` as
print may change the line endings on some OSes which may not be wanted
2020-08-07 13:20:21 +02:00
A_D
4105662fb5
Cleaned up logic and removed overlong lines
Generally for the logic cleanups it was replacing giant list
comprehensions with slightly smaller filter calls. filter() is just
plain cleaner when all you're doing in a list comp is
[x for x in y if somecondition].
2020-08-07 13:20:21 +02:00
A_D
4d0cf4e335
Added scope change newlines 2020-08-07 13:20:20 +02:00
A_D
b186e97747
autoformatted code 2020-08-07 13:20:19 +02:00
Athanasius
4d7b60507c
Merge pull request #664 from A-UNDERSCORE-D/linting/import-order
Add flake8-isort for import order
2020-08-07 11:42:49 +01:00
A_D
0be9bb7a6d
renamed pyproject.toml, added flake8-isort 2020-08-06 02:21:27 +02:00
Athanasius
cf25eacda9 Releasing.md: We're using Python 3.7.8 now 2020-08-05 12:33:52 +01:00
Athanasius
405edfacb6 Merge tag 'Release/4.0.4' into releases
Release 4.0.4
2020-08-02 20:20:04 +01:00
Athanasius
412dad86a7 Release 4.0.4: Correct translations and update appcast length
* Pulling in latest translations meant needing to change %H:%M:%S back
 to {HH}:{MM}:{SS}.
* Built and tested, so has appcast length updated too.
Release/4.0.4
2020-08-02 20:14:55 +01:00
Athanasius
c8635b84d2 Translations: Minor changes
* Back to {HH}:{MM}:{SS} for this.
* A few extra "Use alternate URL method" translations.
2020-08-02 20:04:37 +01:00
Athanasius
451dcbff21 Release 4.0.4: Post-build appcast length update 2020-08-02 20:02:45 +01:00
Athanasius
c51a1459d1 Release 4.0.4: Mention Python 3.7.8 in changelogs. 2020-08-02 19:56:14 +01:00
Athanasius
e5ca8a6f26 Release 4.0.4: Changelog, version, appcast
* Version 4.0.4
* ChangeLog.md
* edmarketconnector.xml (except length)
2020-08-02 19:41:14 +01:00
Athanasius
513e21a06e Inara timer fix.
I had to pull a diff out of the old branch, apply it, and reverse things
like the addition of logging.  This needs to be the minimum change for
the fix.

Tested with a quick login, then spamming market buy/sell orders.  They
were correctly queued and then sent after 30s since previous API calls.
2020-08-02 19:35:02 +01:00
Athanasius
ba09cfd8aa PLUGINS.md: except not catch 2020-08-02 19:35:02 +01:00
Athanasius
0d55e4f6c9 PLUGINS.md: Fix typo ' -> ` 2020-08-02 19:35:02 +01:00
Athanasius
ffd0079e16 PLUGINS.md: Logging is being added, how to prepare
* Currently you use `print(...)`
* `logging` support is coming, here's how to prepare.
2020-08-02 19:35:02 +01:00