1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-22 03:40:46 +03:00

5021 Commits

Author SHA1 Message Date
Athanasius
d48501c37b
Merge pull request #1754 from EDCD/fix/1720/EDMC_-n
EDMC.py quietening and fixes
2022-12-14 11:32:13 +00:00
Athanasius
e245a75e61
EDMC: Get -n working again
* eddn: Don't schedule `queue_check_and_send()` if EDMC_NO_UI.
* `export_(commodites|outfitting|shipyard)` lost the `is_odyssey` argument
 in 556ace5306bebbcf34c1a56a9023a822218a73f1 .
* EDDNSender: Helper `set_ui_status()` in which the check for EDMC_NO_UI
  is performed.  Used in `send_message()`.  In the EDMC_NO_UI case it will
  INFO log the text instead.
2022-12-14 11:15:20 +00:00
Athanasius
79bbc8917f
Move 'this is the GameVersion we found' logging to DEBUG
This quietens it for normal EDMC.py usage.
2022-12-14 10:51:37 +00:00
Athanasius
2ff04dd659
Merge pull request #1753 from EDCD/dependabot/pip/develop/isort-5.11.1
build(deps-dev): bump isort from 5.10.1 to 5.11.1
2022-12-14 10:42:28 +00:00
Athanasius
320236f7a7
Merge pull request #1752 from EDCD/dependabot/pip/develop/safety-2.3.5
build(deps-dev): bump safety from 2.3.4 to 2.3.5
2022-12-14 10:42:21 +00:00
Athanasius
605ad07aac
Merge pull request #1747 from EDCD/enhancement/1728/capi-for-legacy
CAPI: Enable use of Legacy host when applicable.
2022-12-14 10:42:05 +00:00
dependabot[bot]
d49e865260
build(deps-dev): bump isort from 5.10.1 to 5.11.1
Bumps [isort](https://github.com/pycqa/isort) from 5.10.1 to 5.11.1.
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pycqa/isort/compare/5.10.1...5.11.1)

---
updated-dependencies:
- dependency-name: isort
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-13 17:01:07 +00:00
dependabot[bot]
eb2f211188
build(deps-dev): bump safety from 2.3.4 to 2.3.5
Bumps [safety](https://github.com/pyupio/safety) from 2.3.4 to 2.3.5.
- [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.4...2.3.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-09 17:01:02 +00:00
Athanasius
9781e87c53
Merge pull request #1749 from EDCD/dependabot/pip/develop/certifi-2022.12.7
build(deps): bump certifi from 2022.9.24 to 2022.12.7
2022-12-09 09:52:06 +00:00
Athanasius
3260ff7ae2
Merge pull request #1748 from EDCD/dependabot/pip/develop/safety-2.3.4
build(deps-dev): bump safety from 2.3.3 to 2.3.4
2022-12-09 09:51:10 +00:00
dependabot[bot]
862aa611b1
build(deps): bump certifi from 2022.9.24 to 2022.12.7
Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2022.09.24...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 17:01:13 +00:00
dependabot[bot]
1af1ea86f8
build(deps-dev): bump safety from 2.3.3 to 2.3.4
Bumps [safety](https://github.com/pyupio/safety) from 2.3.3 to 2.3.4.
- [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.3...2.3.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 17:01:08 +00:00
Athanasius
7e1d756db7
Merge pull request #1746 from EDCD/enhancement/1739/navroute-read-on-catchup
monitor/NavRoute: Load NavRoute after catching_up ends.
2022-12-08 14:01:58 +00:00
Athanasius
84615db839
PLUGINS.md: Allow use of CAPIData.source_host
* Additional Allowed Imports `from companion ...`.

* Plugin authors will still need to chain `cmdr_data_legacy()` to calling
  `cmdr_data()`, but with sanctioned access to `data.source_host` they can
  then determine the galaxy data source.

* Re-worked the documentation for CAPI data a little to make all of this as
  clear as possible.
2022-12-08 13:17:13 +00:00
Athanasius
af5d998464
PLUGINS.md: Correct the statement about python stdlib 2022-12-08 12:59:36 +00:00
Athanasius
a3a52055d3
CAPI/PLUGINS.md: Document cmdr_data_legacy()
For now warn against trying to use extra CAPIData properties to determine
the galaxy.
2022-12-08 12:53:31 +00:00
Athanasius
0915bad95d
CAPI/EDDN: Enable sending of Legacy data
As we already took some care in the EDDN code we can just make
`cmdr_data_legacy()` call through to `cmdr_data()`.
2022-12-08 12:10:15 +00:00
Athanasius
ccdc187efa
CAPI: Remove 'safeties' preventing Legacy CAPI queries 2022-12-08 11:58:34 +00:00
Athanasius
088da2e5f0
td.py: Update Price-Data format URL to github 2022-12-08 11:44:30 +00:00
Athanasius
78e9db710f
td.py: Fix 'oops' with file header wrt platform
Lost the `sys.platform == ` part of:

    `sys.platform == 'darwin' and ...`
2022-12-08 11:42:57 +00:00
Athanasius
75ee57939a
EDMarketConnector: Force type of ship_state
It can be `tk.NORMAL` or `tk.DISABLED`.  Why `True` was ever used I don't
know, possibly relying on undefined behaviour.

However, those 'types' end up as `Literal['normal']` and `Literal['disabled']`
and the only way to declare a Union of those is to be explicit with the
actual strings.  tk.(NORMAL|DISABLED) are not a types.
2022-12-08 11:32:41 +00:00
Athanasius
6a580576ec
mpyp: Always use --check-untyped-defs
`mypy EDMarketConnector.py` was throwing a warning:

    By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]

for some things.  Bizarrely including e.g.

    play_bad: bool = False
2022-12-08 11:29:49 +00:00
Athanasius
b6fe115ea7
CAPI: Add support for plugin cmdr_data_legacy()
* Renames `plug.notify_newdata()` to the more precise `notify_capidata()`.
* If CAPI data was from SERVER_LEGACY, then use plugin `cmdr_data_legacy()`
  instead of `cmdr_data()`.
2022-12-08 11:17:52 +00:00
Athanasius
b754ef8700
companion: mypy fixups & misc
* Some `Optiona[str]` required.
* Remove old pre-CAPIData comment about adding it
2022-12-08 11:06:43 +00:00
Athanasius
9fdf768ce3
CAPI: Enable selection of SERVER_LEGACY in capi_host_for_galaxy()
Also adds DEBUG logging for the selection.
2022-12-08 11:02:39 +00:00
Athanasius
0523e2289a
EDMarketConnector: Improve 'develop only for devs' check
* Move it later, after CLI args processing.  This would allow for a magic
  'override' this, providing a key or similar.
* Correct text 'XAthan' to 'Athan' in 'win32' check.
* If `git_branch != 'develop'` check if `-alpha0` is in the app version.
  Such version strings are never in any pre-release or release.
2022-12-08 10:51:31 +00:00
Athanasius
0d65adb77e
EDMarketConnector: Tweak 'only developers in develop' message 2022-12-07 20:10:41 +00:00
Athanasius
a69b271928
EDMarketConnector: Only developers should be running develop 2022-12-07 19:45:55 +00:00
Athanasius
410b52979b
python: Bump to version 3.10.9
* And point out in ChangeLog.md that we're (still) 32-bit.
2022-12-07 17:45:56 +00:00
Athanasius
a0887f1410
Merge pull request #1742 from EDCD/enhancement/theme/use-constants-not-magic-numbers
themes: Use defined constants for which theme throughout
2022-12-06 15:46:50 +00:00
Athanasius
3e15aa0fe6
PLUGINS.md: More fully document state['NavRoute'
This includes the "catching up" load of the data.
2022-12-06 15:42:59 +00:00
Athanasius
25ed649b7a
monitor/NavRoute: Load NavRoute after catching_up ends.
This is to allow restart of EDMarketConnector whilst the game is running
to have `state['NavRoute']` hold data when the synthetic `StartUp` event
is passed to plugins.

NB: Probably need to note this in PLUGINS.md
2022-12-06 15:34:12 +00:00
Athanasius
36f54ba120
Merge branch 'develop' of https://github.com/EDCD/EDMarketConnector into develop 2022-12-06 14:51:21 +00:00
Athanasius
115b5be3bf
ttkHyperlinkLabel: Just use webbrowser.open(url) unconditionally
See the expanded docstring on the `openurl()` function.
2022-12-06 14:50:05 +00:00
Athanasius
5687780d65
Merge pull request #1745 from EDCD/dependabot/pip/develop/watchdog-2.2.0
build(deps): bump watchdog from 2.1.9 to 2.2.0
2022-12-05 17:03:48 +00:00
dependabot[bot]
2345822d07
build(deps): bump watchdog from 2.1.9 to 2.2.0
Bumps [watchdog](https://github.com/gorakhargosh/watchdog) from 2.1.9 to 2.2.0.
- [Release notes](https://github.com/gorakhargosh/watchdog/releases)
- [Changelog](https://github.com/gorakhargosh/watchdog/blob/master/changelog.rst)
- [Commits](https://github.com/gorakhargosh/watchdog/compare/v2.1.9...v2.2.0)

---
updated-dependencies:
- dependency-name: watchdog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 17:01:31 +00:00
Athanasius
38c2f19474
eddn: Suppress "converted file" for legacy if no file
This was a total brainfart, `finally:` is never what was wanted here.
So, just `return` if `FileNotFoundError`.
2022-12-05 16:40:44 +00:00
Athanasius
c524dc5769
requirements-dev: Bump flake8 to 6.0.0
Now we have a bare `flake8` coming out clean we can upgrade to 6.0.0, which
lacks the `--diff` support we had been relying on.
2022-12-05 16:10:09 +00:00
Athanasius
21c1f07db4
Merge branch 'fix/1723/flake8-everything' into develop 2022-12-05 16:09:33 +00:00
Athanasius
5885e6698c
tests/config: flake8 6.0.0 doesn't like var-name l
But it's fine with `s`.
2022-12-05 16:08:00 +00:00
Athanasius
baadf10158
config/__init__: l is too ambiguous
flake8 6.0.0 complained about `l` here, but strangely not the other
single-letter variable names.  I figured I might as well rename those as
well.
2022-12-05 16:05:23 +00:00
Athanasius
45043d9359
theme.py: Some more tk.BitmapImage guarding, but using isinstance()
`type(...)` is probably incorrect, and `isinstance(...)` gets mypy to take
account of subclasses properly.
2022-12-05 15:57:17 +00:00
Athanasius
09d632bb34
theme.py: Fix up some typing issues
We're passing around *either* tk.Widget *or* tk.BitmapImage in places, but
tk.BitmapImage really isn't the same.  It doesn't have some functions, can't
be treated as a Dict etc.
2022-12-05 15:57:16 +00:00
Athanasius
62e285b52e
themes: Use defined constants for which theme throughout
This has been relying on knowledge of the magic numbers for far too long.

As part of this, remove all the obfuscating "oh, default is 0, and we want
that or any other theme, so treat this like a boolean" nonsense.

Also, stop assuming that "> 1" is a synonym for "transparent theme".  Just
Do The Equality Check.
2022-12-05 15:57:15 +00:00
Athanasius
0f5f625cfd
Merge pull request #1744 from EDCD/fix/1743/capi-eddn-blank-uploaderid
eddn: Ensure CAPI-sourced messages have uploaderID set
2022-12-05 15:56:10 +00:00
Athanasius
6bd48a163c
eddn: Ensure CAPI-sourced messages have uploaderID set
If no 'live' Journal events yet, plugins/eddn won't have had an event to set
this from.
2022-12-05 15:53:27 +00:00
Athanasius
3ed568e544
Merge pull request #1740 from EDCD/fix/1723/flake8-everything
Get everything passing flake8 checks
2022-12-05 11:05:41 +00:00
Athanasius
ab979ed043
ttkHyperlinkLabel: Use Any where it's appropriate in function signatures 2022-12-05 10:58:16 +00:00
Athanasius
c61f235734
loadout.py: Collapse the construction of output filename
All the intermediate variables were more a "work in progress" thing.

Tested as still working.
2022-12-05 10:55:53 +00:00
Athanasius
e4055530b4
theme: The very start of actually using defined constants for themes 2022-12-05 10:49:05 +00:00