Commit Graph
2634 Commits
Author SHA1 Message Date
A_D 53c6f85124 Fixed (im)possible UnboundLocalExceptions 2021-04-01 14:45:44 +01:00
A_D 84a093a7e3 replaced string formatting with interpolation 2021-04-01 14:45:44 +01:00
A_D c7e0850ea1 removed star import 2021-04-01 14:45:44 +01:00
A_D a25ea9dfa9 autoformatted code 2021-04-01 14:45:44 +01:00
A_D c13caa22ef sorted imports, manually formatted some super long lines 2021-04-01 14:45:44 +01:00
Athanasius 2f35275024 config.py: Revert conditional orders for Windows Registry gets
I failed to realise the values I'd moved earlier in the conditional were
being passed by reference to the ctypes call.  Thus they had initial
values only upon test, rather than the 'returned' values as they should.

This caused no values to be loaded from the Registry!
2021-04-01 14:45:44 +01:00
Athanasius 61a714513e config.py: Final function type annotations 2021-04-01 14:45:44 +01:00
Athanasius 1e24c297e0 config.py: Don't need to sub-class object 2021-04-01 14:45:44 +01:00
Athanasius cb795b2230 config.py: Remove u-prefix from strings. More specific Exceptions
* u-prefix is un-necessary, remove it.
* We should get ValueError in some cases, so catch it first.
* Change debug log for if linux config file not yet present.
2021-04-01 14:45:44 +01:00
Athanasius 0274c98e50 config.py: Convert darwin test to isinstance(val, list) as well 2021-04-01 14:45:44 +01:00
Athanasius f356d9c1d1 config.py: No need for typing.Iterable 2021-04-01 14:45:44 +01:00
Athanasius 93dc1a988a config.py: linux Config class & overall typing
* This changes the test in set() from hasattr(val, '__iter__') to
  isinstance(val, list) as the passed values *should* be lists for that
  case.
2021-04-01 14:45:43 +01:00
Athanasius b7f41796c9 config.py: win32 Config class cleanup 2021-04-01 14:45:43 +01:00
Athanasius 854c79c070 config.py: Log exception type from darwin getint()
* Also sets up `logger`.
2021-04-01 14:45:43 +01:00
Athanasius fcb7685d71 config.py: darwin Config class code cleanup
# Conflicts:
#	config.py
2021-04-01 14:45:43 +01:00
Athanasius 07fd4dc634 config.py: ctypes import order 2021-04-01 14:45:43 +01:00
Athanasius c3150dae76 config.py: More import clean & misc. 2021-04-01 14:45:43 +01:00
Athanasius b2629286b4 config.py: top-level docstring, import order, minor edits 2021-04-01 14:45:43 +01:00
Athanasius 6ae6efaee9 EDMarketConnector: Annotate save_raw() complexity noqa 2021-04-01 14:45:43 +01:00
Athanasius 4ac9e9010e EDMarketConnector: Two minor cleanups. journal_event & dashboard_event
* journal_event() annotate the noqa complexity comment.
* dashboard_event() convert to 'bail early' to save indentiation.
2021-04-01 14:45:43 +01:00
Athanasius 07c7639345 EDMarketConnector: Switch to Optional[int] rather than Union... 2021-04-01 14:45:43 +01:00
Athanasius e5e0eb0373 EDMarketConnector: Revert to tearoff=tk.FALSE
And added `# type: ignore` comments.

This is a mess.  On the tkinter side it *is* an int, default 0.  But
enough python stuff has assumed it's a bool for typeshed to define that
tearoff should be.  It doesn't match, mypy complains.
2021-04-01 14:45:43 +01:00
Athanasius c1fdd27020 EDMarketConnector: More typing, and removal of retry_for_shipyard()
* retry_for_shipyard() was only called by itself (for further retry),
  and tried to call self.eddn.export_shipyard() which doesn't even
  exist.
  I suspect this has been unused code since the EDDN code was extracted
  out into an internal plugin.
* self.drag_offset given proper typing.
* All functions have at least some typing now.  Left the 'event' Tk
  arguments bare as mypy seems to infer without complaint.
2021-04-01 14:45:43 +01:00
Athanasius 5b7876a22b pre-commit: Try local flake8 2021-04-01 14:45:43 +01:00
Athanasius 5d8e2a80af EDMarketConnector: noqa CCR001
Some of our code is just cognitively complex.
2021-04-01 14:45:43 +01:00
Athanasius 58787bc65e EDMarketConnector: Final type annotation fixups.
* Ignore Tkinter 'name' complaints.  I've opened
  <https://github.com/python/typeshed/issues/4658> to get this
  fixed in typeshed.
* If checking `import update` so it's available.
* Don't annotate journal_event 'event' arg, as it's passed through Tk
  events mechanism, so let mypy infer it.
2021-04-01 14:45:43 +01:00
Athanasius aafc419124 EDMarketConnector: Initialise self.updater with type, but None value
This allows the type to be known, but leaves the proper setting of the
value until later (after UI creation).
2021-04-01 14:45:43 +01:00
Athanasius a038b30855 EDMarketConnector: Remove call to deprecated config.getpassword() 2021-04-01 14:45:43 +01:00
Athanasius 55f1e11f0b EDMarketConnector: Correct __init__ master type & misc 2021-04-01 14:45:43 +01:00
Athanasius 97f3af2568 EDMarketConnector: Refactor of getandsend() and journal_event() 2021-04-01 14:45:43 +01:00
Athanasius a4422c2065 pre-commit: Update config as per cleanup/config.py 2021-04-01 14:45:43 +01:00
Athanasius da9e406e81 EDMarketConnector: Convert debug data dump to f-string & misc
* docstring indent on Class A.
* Minor white space adjustments.
2021-04-01 14:45:43 +01:00
Athanasius 8a3fa50c97 EDMarketConnector: Pass on docstrings & Misc.
* Removed a couple of E501 ignores tagged as now un-necessary.
2021-04-01 14:45:43 +01:00
dependabot[bot] 3e6998cfbe Bump mypy from 0.782 to 0.790
Bumps [mypy](https://github.com/python/mypy) from 0.782 to 0.790.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](https://github.com/python/mypy/compare/v0.782...v0.790)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:43 +01:00
dependabot[bot] 68406f82cf Bump isort from 5.6.1 to 5.6.3
Bumps [isort](https://github.com/pycqa/isort) from 5.6.1 to 5.6.3.
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/pycqa/isort/compare/5.6.1...5.6.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:43 +01:00
Athanasius 6c9045ba13 setup.py: Convert to rf'' strings, no need to escape backslashes. 2021-04-01 14:45:43 +01:00
Athanasius 550ee394e3 setup.py: Convert one f-string to rf-string. 2021-04-01 14:45:43 +01:00
dependabot[bot] 5201777d9d Bump isort from 5.5.5 to 5.6.1
Bumps [isort](https://github.com/pycqa/isort) from 5.5.5 to 5.6.1.
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/pycqa/isort/compare/5.5.5...5.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:43 +01:00
Athanasius 1297ba9c0d setup.py: typing cleanups
* I didn't go looking for darwin 'py2app' docs to find the possible
  return types of py2app.recipes['member']['check'], so 'Any' will have
  to do.

* re.search may return None, which then doesn't have .group(), so mypy
  complains.  Just tell it to ignore that code.
2021-04-01 14:45:43 +01:00
Athanasius db40197f80 requirements-dev.txt: Add mypy and safety 2021-04-01 14:45:43 +01:00
Athanasius 7d4bef686c Releasing.md: Update to Windows SDK 19041 2021-04-01 14:45:43 +01:00
Athanasius a8313e3661 setup.py: Reformat appcast style multi-line 2021-04-01 14:45:43 +01:00
Athanasius a6779d7292 requirements: py2exe only on win32 platform 2021-04-01 14:45:43 +01:00
Athanasius 9b828fe9b2 requirements: Reference py2exe via git URL@tag 2021-04-01 14:45:43 +01:00
Athanasius 753b5c59d3 Releasing.md: py2exe 0.10.0.1 now released so reference it. 2021-04-01 14:45:43 +01:00
Athanasius 77939ad48e Releasing.md: Update example full python path
* Python 3.8 now.
* And reference the centrally installed location, not the one under
  %LOCALAPPDATA%.
2021-04-01 14:45:43 +01:00
Athanasius 1563e50733 PLUGINS.md: Reference Releasing.md for currently supported Python version 2021-04-01 14:45:43 +01:00
Athanasius 1b4ee4f3dd PLUGINS.md: Update to mention using Python 3.8 post-4.1.x
* Also adjusted links to information/examples to not be the bad 'here'
  form.
2021-04-01 14:45:43 +01:00
Athanasius 3e54e1f015 Releasing.md: Update for Python 3.8.6 and py2exe 0.10.x.
* Also put `--user` on the example `pip install` line.
2021-04-01 14:45:43 +01:00
Athanasius 54f797ada8 setup.py: No need to manually include sqlite3.dll now 2021-04-01 14:45:43 +01:00