1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 23:37:14 +03:00

4945 Commits

Author SHA1 Message Date
Athanasius
5edde547fa
shipyard.py: flake8/mypy & conver to use csv module 2022-12-03 15:43:33 +00:00
Athanasius
0d2505ea48
protocol.py: mypy pass
* 'type: ignore' some ctypes operations on variables.
* Use `c_long(<value>)` on some returns.  The ctypes types do work that way
  as constructors.
* Fix the BAseHTTPHandler.log_request() types to match superclass.
2022-12-03 15:13:59 +00:00
Athanasius
bb2bf53647
protocol.py: flake8 pass
This is flake8 objecting to the "initialised later" `protocolhandler`.
2022-12-03 14:51:54 +00:00
Athanasius
a0c73a5c71
plug.py: flake8 & mypy pass 2022-12-03 14:48:50 +00:00
Athanasius
1f21c7fae4
plug.py: Only type annotation coverage to go in flake8 2022-12-03 14:10:09 +00:00
Athanasius
3247fb805c
plug.py: Further docstring fixes 2022-12-03 14:05:59 +00:00
Athanasius
413b2f06f8
plug.py: Some docstrings, change to plugin loading
* Plugin loading: Avoid using .format()
2022-12-03 14:03:47 +00:00
Athanasius
8628efa0a1
github/pr-/push-checks: Attempt non-diff flake8 checks
* flake8 6.0.0 dropped support for, the broken, --diff.
* We want to only run against python files.  We will have 'git diff's for
  other types of files.
* Uses 'git diff -z', 'grep -z -Z' and 'xargs -0' so as to pass NUL-terminated
  strings around to avoid "special characters in path/filenames" issues.
2022-12-03 13:52:29 +00:00
Athanasius
514f3fac8a
myNotebook.py: Now passes flake8 & mypy
* Typed `master` to each `__init__()`.
* Having to `# type: ignore` the base class for the classes which are
  "tk on darwin, else ttk" as this 'dynamic' type confuses mypy.

  See the comment on `class Frame` for a suggested proper fix, which will
  be more work.
2022-12-03 12:16:44 +00:00
Athanasius
84860607d7
myNotebook.py: Add file and class docstrings 2022-12-03 12:09:45 +00:00
Athanasius
485a1e3bb4
loadout.py: flake8 & mypy pass
* Catch if an empty string (or other not-None Falsey value) is passed in.
* Use pathlib for constructed filename.
2022-12-03 12:01:26 +00:00
Athanasius
37ca1c3c19
journal_lock: Remove un-needed noqa 2022-12-03 11:32:02 +00:00
Athanasius
116986837e
develop: post-release appversion = 5.6.2-alpha0 2022-12-02 12:54:02 +00:00
Athanasius
dd4a178a67
Release 5.6.1: appversion & changelog Release/5.6.1 2022-12-02 12:12:32 +00:00
Athanasius
abe13176e7
EDSM: Timed latch for notifying about Legacy galaxy data
This avoids the spam from EDSM itself objecting to the passed gameversion.
We don't even send anything but Live data now.
2022-12-01 18:00:47 +00:00
Athanasius
db4f59dd16
Inara: Remove the "update 14 date passed?" check
- We're now past there and no-one should expect that messing with their clock
  will bypass this check.
2022-12-01 17:43:31 +00:00
Athanasius
7a64351d2f
Merge pull request #1736 from EDCD/fix/1733/capi-legacy-vs-live
Improve CAPI code for Legacy/Live split
2022-12-01 17:37:24 +00:00
Athanasius
b4c4e44cb7
eddn/CAPI: Use a common function for game_version strings
* This did, however, remind me that the `data` passed into `cmdr_data()`
  is an amalgam of `/profile`, `/market` and `/shipyard` queries.

  This means that the data.source_endpoint is **not correct for all of
  the data and its use**.  As such I had to pass 'hard coded' values into
  the function from the various CAPI export functions.  They know what it
  is they're exporting.

* As this reminded me that "CAPI `data` is actually a `CAPIDATA`", I've
  documented that in PLUGINS.md, but with a dire warning against relying on
  any of the extra properties.
2022-12-01 16:42:06 +00:00
Athanasius
b40d3b889f
CAPI: Use CAPI-Live-<endpoint> game_version for market & shipyard 2022-12-01 16:42:05 +00:00
Athanasius
4b31b67042
CAPI: Only perform queries for Live galaxy.
* This is *temporary* pending properly implementing utilising the Legacy
  CAPI host.
* Check in the EDMarketConnector.EDApp.capi_request_data() function *and*
  also in some companion.session functions.  But not absolutely all possible
  entry points because we'll be undoing it when we implement Legacy support.

This *is* sufficient for the current core code entry points.  If any plugin
is invoking its own CAPI requests, well it shouldn't be.
2022-12-01 16:42:04 +00:00
Athanasius
4a8b5ed4b6
Merge pull request #1735 from EDCD/fix/1732/inara-do-not-send-empty-required
Inara: Drop various combat messages if empty opponentName
2022-12-01 16:41:32 +00:00
Athanasius
0ecc3309e4
Merge pull request #1731 from EDCD/fix/1730/inara-legacy-warn-only-if-sending
Only warn about Inara/Live data only if configured to send on Legacy.
2022-12-01 16:40:39 +00:00
Athanasius
26413177a6
Inara: Also check opponentName on EscapeInterdiction
And sprinkly comments around giving a reason for the checks.
2022-12-01 13:45:10 +00:00
Athanasius
aac660fb05
Inara: Also catch empty opponentName for Interdict*ion* 2022-12-01 13:37:56 +00:00
Athanasius
2bbda30097
Inara: Drop addCommanderCombatInterdicted if empty opponentName
Addresses #1732 specifically.

At some point #1433 needs fully addressing (review all Inara API code for
compliance with docs).
2022-12-01 13:33:26 +00:00
Athanasius
b06e579754
PLUGINS.md: Emphasise limited use of from config import config 2022-12-01 12:14:49 +00:00
Athanasius
41d7af54b4
tests/config: Update copy of 'OUT' constants to match 'live' values
It's actually just the NAMES that got changed as part of the EDDN rework, so
this would have made no difference to the tests.  But now a grep won't find
any instance of the old names.
2022-12-01 11:46:29 +00:00
Athanasius
e86110a3da
inara: Only warn for 'Legacy' if data would have been sent
* Specifically, only warn if the user option to send to Inara is active.
2022-11-30 12:07:48 +00:00
Athanasius
ed7cd9adc0
FDevIDs: Changed to its master and pulled to latest 2022-11-30 09:54:12 +00:00
Athanasius
311e533d3b
Merge pull request #1711 from EDCD/dependabot/pip/develop/setuptools-65.6.3
build(deps-dev): bump setuptools from 65.6.0 to 65.6.3
2022-11-28 17:31:20 +00:00
Athanasius
1f99268bae
Merge pull request #1722 from EDCD/dependabot/pip/develop/safety-2.3.3
build(deps-dev): bump safety from 2.3.2 to 2.3.3
2022-11-28 17:31:06 +00:00
dependabot[bot]
cd971e1ed4
build(deps-dev): bump safety from 2.3.2 to 2.3.3
Bumps [safety](https://github.com/pyupio/safety) from 2.3.2 to 2.3.3.
- [Release notes](https://github.com/pyupio/safety/releases)
- [Changelog](https://github.com/pyupio/safety/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyupio/safety/compare/2.3.2...2.3.3)

---
updated-dependencies:
- dependency-name: safety
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 17:00:58 +00:00
Athanasius
e6eca7f915
Merge pull request #1713 from EDCD/dependabot/pip/develop/flake8-noqa-1.3.0
build(deps-dev): bump flake8-noqa from 1.2.9 to 1.3.0
2022-11-28 16:50:02 +00:00
Athanasius
f8802745ce
Merge pull request #1708 from EDCD/dependabot/pip/develop/safety-2.3.2
build(deps-dev): bump safety from 2.3.1 to 2.3.2
2022-11-28 16:49:22 +00:00
Athanasius
0122552448
develop: post-release appversion bump 2022-11-28 16:45:58 +00:00
Athanasius
a9ccb7d565
translations: Updated from onesky
* The inara.py "Inara only accepts Live galaxy data" added.
Release/5.6.0
2022-11-28 15:45:06 +00:00
Athanasius
1e5d09eff4
Release 5.6.0: appversion and changelog 2022-11-28 15:39:03 +00:00
Athanasius
3f0aefd671
eddn: Fix spelling mistake in a log message 2022-11-28 15:38:34 +00:00
Athanasius
ab9e5f7278
Merge branch 'enhancement/1719/edsm-api-gameversion-gamebuild' into release-5.6.0-beta1 2022-11-28 12:20:36 +00:00
Athanasius
a581d889fe
edsm: Add a paranoia check for changed gameversion
* In theory we would always see `Fileheader` and clear `pending[]`, but let's
  be extra paranoid and also clear it if there's a gameversion/build difference
  between the prior event and the current one.
2022-11-28 12:18:10 +00:00
Athanasius
1ec1253b48
appversion: Change to 5.6.0-alpha2 to be distinct
* This is alpha, not beta.
* We have an -alpha0 and a -beta1 already, so use -alpha2 so even that digit
  is distinct.
2022-11-28 11:08:48 +00:00
Athanasius
5743fd3803
edsm: Push gameversion/build into the queue to ensure correctness
1. Due to the _TIMEOUT on the actual `post()` of a message it would be
  possible for new entries to get queued in the meantime.  These queued
  entries could be 'in session' and end up going through pending and thus
  sent before one of the 'new session' events is detected so as to clear
  pending.  The `this.gameversion/build` could have changed in the meantime,
  so are no longer correct if game client changed.
2. So, pass in the current gameversion/build when a message is pushed into
  the queue, and parse those back out when they're pulled out of the queue.
3. Use those versions in the message, not `this.` versions.
2022-11-28 11:04:51 +00:00
Athanasius
ad95041605
edsm: Send gameversion/build in all messages
* Record the 'state' version of these in `this`.
* Use those when constructing the message.
* NB: Need to check if messages can be retained in the queue across client
  changes.  Coming up ....
2022-11-28 10:51:25 +00:00
Athanasius
2ac8026e3e
eddn: Allow for '' in standard_header()
`''` is Falsey, but a valid value, so we need an explicit `is not None`
test for these.
2022-11-27 17:01:28 +00:00
Athanasius
a944eaf445
translations: Add new inara.py string about Live data only 2022-11-27 16:49:45 +00:00
Athanasius
81111d72bf
Changelog: Correct 'Developers' header, and clarify EDDN delays
* I'd missed 'Plugin ' off 'Plugin Developers'.
* Clarification added that EDDN messages will still go through quickly if
  not delayed by user settings or an EDDN Gateway issue.
2022-11-27 16:37:37 +00:00
Athanasius
4858ec7200
Pre-Release 5.6.0-beta1: appversion & changelog Release/5.6.0-beta1 2022-11-27 16:09:06 +00:00
Athanasius
d902093f0b
Merge pull request #1682 from EDCD/fix/1431/eddn-replay-enhancements
Change EDDN 'replay' to using an sqlite3 DB & otherwise improve
2022-11-27 15:24:28 +00:00
Athanasius
642d1912d8
Merge pull request #1716 from EDCD/enhancement/1715/inara-live-galaxy-only
inara: Send only Live galaxy data after Update 14
2022-11-27 13:55:35 +00:00
Athanasius
b3eff6ab32
monitor: Catch any failure to coerce gameversion
Also, log either the error or the success.  That will aid us in diagnosing
any future issues.
2022-11-27 13:02:54 +00:00