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

2679 Commits

Author SHA1 Message Date
dependabot[bot]
8bc119c834 Bump flake8-json from 19.8.0 to 20.12.1
Bumps [flake8-json](https://gitlab.com/pycqa/flake8-json) from 19.8.0 to 20.12.1.
- [Release notes](https://gitlab.com/pycqa/flake8-json/tags)
- [Commits](https://gitlab.com/pycqa/flake8-json/compare/19.8.0...20.12.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:45 +01:00
dependabot[bot]
80ac14756d Bump py2exe from 0.10.0.2 to 0.10.1.0
Bumps [py2exe](https://github.com/py2exe/py2exe) from 0.10.0.2 to 0.10.1.0.
- [Release notes](https://github.com/py2exe/py2exe/releases)
- [Changelog](https://github.com/py2exe/py2exe/blob/master/ChangeLog)
- [Commits](https://github.com/py2exe/py2exe/compare/v0.10.0.2...v0.10.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:45 +01:00
dependabot[bot]
3e96184ba5 Bump certifi from 2020.6.20 to 2020.11.8
Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.6.20 to 2020.11.8.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2020.06.20...2020.11.08)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:45 +01:00
Athanasius
cb678522d7 Releasing: py2exe via pip / requirements-dev.txt now. 2021-04-01 14:45:45 +01:00
Athanasius
0f3ba584e9 requirements: py2exe now available from pypi, so no need for VCS 2021-04-01 14:45:45 +01:00
dependabot[bot]
bdb3387df3 Bump flake8-comprehensions from 3.2.3 to 3.3.0
Bumps [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) from 3.2.3 to 3.3.0.
- [Release notes](https://github.com/adamchainz/flake8-comprehensions/releases)
- [Changelog](https://github.com/adamchainz/flake8-comprehensions/blob/master/HISTORY.rst)
- [Commits](https://github.com/adamchainz/flake8-comprehensions/compare/3.2.3...3.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-01 14:45:45 +01:00
Athanasius
df238c3e95 Bump py2exe to 0.10.0.2
NB: Possibly due to the git tag form I had to

'pip install --user --upgrade -r requirements-dev.txt`

to get it to upgrade.
2021-04-01 14:45:45 +01:00
Athanasius
6ec24157f2 CAPIData: Only call self.check_modules_ships() if lastStarport present
* The companion Session.query is called for *all* CAPI endpoints and
  only the /profile one will return lastStartport data, which is where
  ships/modules are if present, so only do these checks if we see
  lastStarport.
2021-04-01 14:45:45 +01:00
Athanasius
bd670b7ff1 Updated plugins to expect that CAPI data is safe
# Conflicts:
#	plugins/eddn.py
2021-04-01 14:45:45 +01:00
A_D
fbd924d5aa Added CAPIData class
Currently it is simply a dict subclass that does some of the cleanup
required to make everything happy. In future it will be changed to be a
NamedTuple or similar that can be typed
2021-04-01 14:45:44 +01:00
Athanasius
9f45960fe3 dashboard: Reinstate "from calendar import timegm"
This was inadvertently removed in 102fe809783141394ee31a30158c5ed81ea4d996
2021-04-01 14:45:44 +01:00
Athanasius
bc3269f2f8 EDMarketConnector: popup for "already running"
* This also refactors code around so that isort and flake8 are happy
  about the module level imports.
2021-04-01 14:45:44 +01:00
Athanasius
c6083a2643 EDMarketConnector: Minor comments changes
# Conflicts:
#	EDMarketConnector.py
2021-04-01 14:45:44 +01:00
Athanasius
248493c16a EDMarketConnector: Change 'no other .exe runnig?' checks
* This is now done even before the stdout/err redirect.
* The function is now called no_other_instance_running() to make the
  conditional use of it read more naturally.
* For now this *append* logs to the plain log file.  **BUT** any
  subsequent write by the already-running process will be over the top
  of this, so a future commit will use a popup instead.

# Conflicts:
#	EDMarketConnector.py
2021-04-01 14:45:44 +01:00
Athanasius
3a57128e28 EDMarketConnector: Care about "are we already running?" check
1) Don't log in this check, we're a different process.
2) But we've stomped the plain log file already!
3) Python 3.8.6 seems to not like sys.exit(0) from that ctypes code, so
 `return False` instead and check the return from EnumWindows().
2021-04-01 14:45:44 +01:00
Athanasius
404f1fa641 dashboard: No need for except var if unused. 2021-04-01 14:45:44 +01:00
Athanasius
9b09d8bd07 plugins/inara: Close down logging & Remove unused this.queue.
* The new_worker/NewThis doesn't currently have a mechanism to ask the
 new_worker to exit.  It's relying on being a daemon thread and dying
 once all non-daemon (i.e. main) threads have exited.
2021-04-01 14:45:44 +01:00
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