Commit Graph
4996 Commits
Author SHA1 Message Date
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 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
Athanasius 4cea8fa34f github/push-checks: Align flake8 with what's working in pr-checks 2022-12-04 16:55:45 +00:00
Athanasius 486fb6b7e6 github/pr-checks: We provide flake8 filenames, so lose the '.' 2022-12-04 16:50:21 +00:00
Athanasius 5c704e9932 github/pr-checks: Remove stray echo from prior testing 2022-12-04 16:49:02 +00:00
Athanasius ccdfd9a4fa scripts/killswitch_test: One flake8 issue fixed 2022-12-04 16:42:12 +00:00
Athanasius a6f9a31fd9 plugins/edsy: flake8 and mypy pass 2022-12-04 16:20:08 +00:00
Athanasius ba81d95c1e plugins/edsm: Align comments and docstrings with plugins/eddb 2022-12-04 16:12:58 +00:00
Athanasius 73c4bcfcc7 plugins/eddb: flake8 & mypy now clean
* Converted to `class This` paradigm.
2022-12-04 15:57:09 +00:00
Athanasius 62ed12eba3 plugins/eddb: flake8 pass 2022-12-04 15:36:00 +00:00
Athanasius 19114fdc3a config/linux: Remove unused TYPE_CHECKING import 2022-12-04 15:15:14 +00:00
Athanasius c5a2943966 util_ships.py: Add required blank line before function 2022-12-04 15:14:31 +00:00
Athanasius 04145146d7 update.py: Finaly mypy pass
* It's possible the `xml` code could be changed to make types work.  But
  the code works, ignore types on those calls.
2022-12-04 15:12:46 +00:00
Athanasius 74ebba20b4 update.py: Remove unused 'global root' & some more typing
`global root` was never removed after `self.root` became a thing.
2022-12-04 15:08:38 +00:00
Athanasius e419e6dca0 update.py: Technically Updater.root can be None, so check this
The only current users of the code that blindly uses `self.root` are for
the GUI application, but let's add the checks anyway.
2022-12-04 14:56:58 +00:00
Athanasius 3358babe00 EDMarketConnector: Move tk 'status' Label to its own section 2022-12-04 14:55:22 +00:00
Athanasius 2ac055e8f0 update.py: Yes, we have to use .nametowidget()
'status' is a child of 'edmarketconnector', not of `self.root`.  And if
we were to do `self.root.children['edmarketconnector'].children['status']`
then we might as well use `.nametowidget()`.
2022-12-04 14:49:51 +00:00
Athanasius eab2f35360 update.py: Minor whitespace correction 2022-12-04 14:43:00 +00:00
Athanasius 3cc9aed724 EDMarketConnector: Updated for update.py function renames 2022-12-04 14:35:49 +00:00
Athanasius eefb56c2c0 update.py: Check appcast version is correct platform 2022-12-04 14:30:37 +00:00
Athanasius b38044928a update.py: Now passes flake8
**BUG FOUND**
The code in `Updater.check_appcast()` assumes that
`semantic_version.SimpleSpec.select()` will say "5.6.1 is an upgrade for
this 5.6.0".  But it doesn't.  It's looking for *matches*.

So this needs to be a proper loop/compare *and* should only take into account
options *for the current platform*.
2022-12-04 14:23:53 +00:00
Athanasius b57a8f99ae ttkHyperlinkLabel: Now passing flake8 & mypy
* `openurl()` - Don't pass `None` as second parameter to `QueryValueEx()`.
  Passing `''` was tested as still working.
2022-12-03 21:04:50 +00:00
Athanasius e280d6c283 ttkHyperlinklabel.py: Initial flake8 pass (and some mypy)
This fixes an apparently harmless bug in the `openurl()` function defined
in this module (it's not part of the class).

1. On `win32` lookup the user setting for opening HTTPS URLs.
2. If that doesn't look like IE or Edge...
3. Set `cls` to the value for that.
4. Now look up the 'use this command' for *that* ...
5. And if it doesn't have `iexplore` in it...
6. Use `subprocess.Popen()` to invoke that browser with the given URL.

The problem is that step 6 still tries to use `buf.value`.  But `buf` is
no longer present as it was from before 5989acd0d3
changed over to `winreg`.  It should be just `value` from the winreg
calls.

That exception is then caught and ignored, and it ends up just running
`webbrowser.open(url)` anyway.

To be honest, this feels like we should just make this an unconditional
call to `webbrowser.open(url)` now, given apparently no-one's complained
about it always actually using that not working for them.  Given Edge is
Chrome-based now, and any supported OS should have Edge, Chrome or Firefox
(OK, maybe Safari and some others) as the HTTPS browser, I don't see this
being an issue.
2022-12-03 18:21:16 +00:00
Athanasius 0dbbb38821 theme.py: Just use 'dict' style configuration of widgets
It turns out that you don't need to call `.configure(keyword=...)` on tk
widgets.  You can just treat them as a dict with the available option as
a key.

This neatly gets rid of the type hint issues.
2022-12-03 17:50:47 +00:00
Athanasius 8728234625 theme.py: mypy pass
mypy/typeshed still doesn't like 'generic' tk arguments on things like
.configure(), so lots of `# type: ignore` used for those.
2022-12-03 17:36:10 +00:00
Athanasius cc8e0bfd27 theme.py: flake8 pass
Conversion from %-format to f-string means an `assert ..., string`` is now
a condition and a `raise AssertionError(string)`.  The problem being that
f-string gets evaluated before the assert, but in this case the things the
f-string relies on are only there if the assert triggers.
2022-12-03 16:59:39 +00:00
Athanasius c9555cce66 td.py: Further re-factoring to pass flake8 checks
The output of this was confirmed the 'same' as from before this work:

 1. Generate the output.
 2. `cut -c 1-68` to a copy.
 3. diff those files.

This is necessary so as to not have 'every' line be different due to the
timestamp on it.
2022-12-03 16:27:22 +00:00