Commit Graph
2662 Commits
Author SHA1 Message Date
Athanasius 8aac704fa1 plugins/edsm: start/stop detailed logging. 2021-04-01 14:45:44 +01:00
Athanasius 983e4d7acb plugins/eddn: Detailed stop logging. 2021-04-01 14:45:44 +01:00
Athanasius 8b3785cdf7 monitor.py: Detailed logging EDLogs.worker() 2021-04-01 14:45:44 +01:00
Athanasius abfde73362 dashboard, hotkey, protocol: Use EDMCLogging.get_main_logger()
It does the EDMC/EDMarketConnector check.
2021-04-01 14:45:44 +01:00
Athanasius 9be7f14573 monitor.py: Detailed logging EDLogs.start() 2021-04-01 14:45:44 +01:00
Athanasius 4a84d9c341 monitor: Detailed logging EDLogs.stop()
# Conflicts:
#	monitor.py
2021-04-01 14:45:44 +01:00
Athanasius 7ebf2a553a monitor: Detailed logging EDLogs.close() 2021-04-01 14:45:44 +01:00
Athanasius c47688227b dashboard: Detailed logging Dashboard.start()
# Conflicts:
#	dashboard.py
2021-04-01 14:45:44 +01:00
Athanasius 137c66048a dashboard: Remove print_exc use (logger.exception instead)
# Conflicts:
#	dashboard.py
2021-04-01 14:45:44 +01:00
Athanasius fd19ac337a dashboard: Detailed logging Dashboard .stop() & .close()
# Conflicts:
#	dashboard.py
2021-04-01 14:45:44 +01:00
Athanasius 99e2dfb62a hotkey: Detailed logging in HotKeyMgr.worker()
# Conflicts:
#	hotkey.py
2021-04-01 14:45:44 +01:00
Athanasius 9cff84327d hotkey: Detailed logging in HotKeyMgr.register() 2021-04-01 14:45:44 +01:00
Athanasius a47b9cfa8d hotkey: Detailed logging in HotKeyMgr.unregister() 2021-04-01 14:45:44 +01:00
Athanasius c5a57e8a43 protocol.py: Log *end* of protocolhandler.close() 2021-04-01 14:45:44 +01:00
Athanasius d5b2f32d18 protocol.py: Add logging to protocol shutdown sequence
# Conflicts:
#	protocol.py
2021-04-01 14:45:44 +01:00
Athanasius d0ee0b1148 EDMarketConnector: Add detailed logging to shutdown sequence 2021-04-01 14:45:44 +01:00
Athanasius 45ab19b6b1 Log when we detect browser running us again to pass Auth response. 2021-04-01 14:45:44 +01:00
Athanasius 4c9cf9ed65 Logging: Add osthreadid, and add process, thread and osthreadid to format
* It looks like in Python 3.8 the %(thread)d is the native OS thread ID
  anyway, but let's keep osthreadid anyway.
2021-04-01 14:45:44 +01:00
Athanasius 7efd1a5aaa EDMarketConnector: Log when we exit because 'already running' 2021-04-01 14:45:44 +01:00
A_D ddb53a6ca1 Added type checker magic to make TRACE work
Relatively simple. Because all of our loggers are created out of
EDMCLogging, we can create a fake type in EDMCLogging that inherits
from logging.Logger but also defines a trace method.

Once that is done, we just have to annotate our methods to get loggers
with the new type, cast all of the returns, and suddenly we no longer
have any complaints about logger.trace. This doesn't _actually_ change
any behaviour at runtime, and logging.Logger.trace and logging.TRACE
will continue to be broken, but those are used far less than
logger.trace is used throughout the codebase, and therefore I think we
can live with `# type: ignore` comments everywhere
2021-04-01 14:45:44 +01:00
dependabot[bot] 18c0ea82a0 Bump isort from 5.6.3 to 5.6.4
Bumps [isort](https://github.com/pycqa/isort) from 5.6.3 to 5.6.4.
- [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.3...5.6.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:44 +01:00
A_D fe26359170 passed only what was needed to StatsDialog
passing the entire AppWindow just made a mess of typing
2021-04-01 14:45:44 +01:00
A_D 2819c92006 Removed tabs 2021-04-01 14:45:44 +01:00
A_D 7f5bfa36f0 added logging of exception 2021-04-01 14:45:44 +01:00
A_D ecd13b094b Removed mutable default 2021-04-01 14:45:44 +01:00
A_D ad8fdd763a made ships() return a List of NamedTuples
This way, we can access items without remembing indexes, if needed
2021-04-01 14:45:44 +01:00
A_D 3b4d56b842 Added docstrings, type annotations
This looks quite large, but it makes no code changes other than
docstrings and type annotations. Along with a small code style fix.
2021-04-01 14:45:44 +01:00
A_D d1e2e2b1f3 Removed uneeded list comprehensions 2021-04-01 14:45:44 +01:00
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