Commit Graph
1987 Commits
Author SHA1 Message Date
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 a00d5df92b Update version in BOTH places on that URL line 2020-08-27 11:32:08 +01:00
Athanasius 935c852605 appcast: Update size for 4.0.5 2020-08-27 11:31:52 +01:00
Athanasius af12816efb Release 4.0.5: version, changelog, appcast 2020-08-27 11:31:45 +01:00
Athanasius cea26ad0cd Releasing.md: Now using Python 3.7.9 2020-08-27 11:30:25 +01:00
Athanasius c7cdb6ad66 translations: pt-PT: "Use alternate URL method" now translated 2020-08-27 11:30:18 +01:00
Athanasius c126251246 "Not Python 3.x" popup message sub-substitutions fixed.
string.format() doesn't assign to string, so actually need to do that.
2020-08-27 11:30:13 +01:00
Athanasius 98b6d4db38 Plugins "Not Python 3.x": Hacky escaping fix so translations work 2020-08-27 11:30:05 +01:00
Athanasius bd7a3eca04 plugins/inara: return '' if can't otherwise make system_url 2020-08-27 11:28:41 +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 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
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 22932a33cc Merge pull request #651 from A-UNDERSCORE-D/fix/request-hangs-threads
Fix request hangs threads on exit
2020-07-31 15:08:21 +01:00
A_D faac29fe84 Made sure to return super().send() 2020-07-31 15:53:20 +02:00
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
Athanasius 5c7744c595 Merge pull request #650 from EDCD/enhancement/logging-found-plugins
Ensure all plugins have correct logging from core code
2020-07-31 14:50:55 +01:00
Athanasius 5eb11d3612 Merge pull request #648 from A-UNDERSCORE-D/cleanup/inara
Cleanup inara.py
2020-07-31 14:50:11 +01: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