1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-05-21 09:31:21 +03:00

Merge branch 'stable' into releases

This commit is contained in:
Athanasius 2022-03-22 07:40:51 +00:00
commit f72adecbc7
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D
9 changed files with 40 additions and 24 deletions

View File

@ -22,7 +22,7 @@ jobs:
- uses: actions/setup-python@v3 - uses: actions/setup-python@v3
with: with:
python-version: "3.10.2" python-version: "3.10.3"
architecture: "x86" architecture: "x86"
- name: Install python tools - name: Install python tools

View File

@ -1 +1 @@
3.10.2 3.10.3

View File

@ -9,7 +9,7 @@ produce the Windows executables and installer.
--- ---
* We now test against, and package with, Python 3.10.2. * We now test against, and package with, Python 3.10.3.
**As a consequence of this we no longer support Windows 7. **As a consequence of this we no longer support Windows 7.
This is due to This is due to
@ -27,6 +27,19 @@ produce the Windows executables and installer.
--- ---
* We now test against, and package with, Python 3.10.3.
Release 5.3.4
===
Whilst EDMarketConnector.exe was fixed for the Odyssey Update 11 difference in
Journal file names, EDMC.exe was not.
* Use the new common function for finding latest journal file in EDMC.py.
* Quietens some NavRoute related logging for the benefit of EDMC.py. This is
now at DEBUG level, rather than INFO.
Release 5.3.3 Release 5.3.3
=== ===

10
EDMC.py
View File

@ -7,9 +7,8 @@ import json
import locale import locale
import os import os
import queue import queue
import re
import sys import sys
from os.path import getmtime, join from os.path import getmtime
from time import sleep, time from time import sleep, time
from typing import TYPE_CHECKING, Any, List, Optional from typing import TYPE_CHECKING, Any, List, Optional
@ -65,8 +64,6 @@ l10n.Translations.install_dummy()
SERVER_RETRY = 5 # retry pause for Companion servers [s] SERVER_RETRY = 5 # retry pause for Companion servers [s]
EXIT_SUCCESS, EXIT_SERVER, EXIT_CREDENTIALS, EXIT_VERIFICATION, EXIT_LAGGING, EXIT_SYS_ERR, EXIT_ARGS = range(7) EXIT_SUCCESS, EXIT_SERVER, EXIT_CREDENTIALS, EXIT_VERIFICATION, EXIT_LAGGING, EXIT_SYS_ERR, EXIT_ARGS = range(7)
JOURNAL_RE = re.compile(r'^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$')
def versioncmp(versionstring) -> List: def versioncmp(versionstring) -> List:
"""Quick and dirty version comparison assuming "strict" numeric only version numbers.""" """Quick and dirty version comparison assuming "strict" numeric only version numbers."""
@ -225,10 +222,7 @@ sys.path: {sys.path}'''
monitor.currentdir = config.default_journal_dir monitor.currentdir = config.default_journal_dir
logger.debug(f'logdir = "{monitor.currentdir}"') logger.debug(f'logdir = "{monitor.currentdir}"')
logfiles = sorted((x for x in os.listdir(monitor.currentdir) if JOURNAL_RE.search(x)), logfile = monitor.journal_newest_filename(monitor.currentdir)
key=lambda x: x.split('.')[1:])
logfile = join(monitor.currentdir, logfiles[-1])
logger.debug(f'Using logfile "{logfile}"') logger.debug(f'Using logfile "{logfile}"')
with open(logfile, 'r', encoding='utf-8') as loghandle: with open(logfile, 'r', encoding='utf-8') as loghandle:

View File

@ -1672,15 +1672,19 @@ class AppWindow(object):
def exit_tray(self, systray: 'SysTrayIcon') -> None: def exit_tray(self, systray: 'SysTrayIcon') -> None:
"""Tray icon is shutting down.""" """Tray icon is shutting down."""
exit_thread = threading.Thread(target=self.onexit) exit_thread = threading.Thread(
exit_thread.setDaemon(True) target=self.onexit,
daemon=True,
)
exit_thread.start() exit_thread.start()
def onexit(self, event=None) -> None: def onexit(self, event=None) -> None:
"""Application shutdown procedure.""" """Application shutdown procedure."""
if sys.platform == 'win32': if sys.platform == 'win32':
shutdown_thread = threading.Thread(target=self.systray.shutdown) shutdown_thread = threading.Thread(
shutdown_thread.setDaemon(True) target=self.systray.shutdown,
daemon=True,
)
shutdown_thread.start() shutdown_thread.start()
config.set_shutdown() # Signal we're in shutdown now. config.set_shutdown() # Signal we're in shutdown now.

View File

@ -52,7 +52,7 @@ appcmdname = 'EDMC'
# <https://semver.org/#semantic-versioning-specification-semver> # <https://semver.org/#semantic-versioning-specification-semver>
# Major.Minor.Patch(-prerelease)(+buildmetadata) # Major.Minor.Patch(-prerelease)(+buildmetadata)
# NB: Do *not* import this, use the functions appversion() and appversion_nobuild() # NB: Do *not* import this, use the functions appversion() and appversion_nobuild()
_static_appversion = '5.3.3' _static_appversion = '5.3.4'
_cached_version: Optional[semantic_version.Version] = None _cached_version: Optional[semantic_version.Version] = None
copyright = '© 2015-2019 Jonathan Harris, 2020-2022 EDCD' copyright = '© 2015-2019 Jonathan Harris, 2020-2022 EDCD'

View File

@ -40,8 +40,8 @@ You will need several pieces of software installed, or the files from their
auto-select some others). NB: If you have need to uninstall this it's auto-select some others). NB: If you have need to uninstall this it's
"Windows Software Development Kit - Windows 10.0.19041.1" in "Windows Software Development Kit - Windows 10.0.19041.1" in
"Apps & Features", *not* "Windows SDK AddOn". "Apps & Features", *not* "Windows SDK AddOn".
1. [Python](https://python.org): 32-bit version of Python 3.9 for Windows. 1. [Python](https://python.org): 32-bit version of Python 3.10 for Windows.
[v3.9.5](https://www.python.org/downloads/release/python-395/) is the most [v3.10.3](https://www.python.org/downloads/release/python-3103/) is the most
recently tested version. You need the `Windows x86 executable installer` recently tested version. You need the `Windows x86 executable installer`
file, for the 32-bit version. Double-check the version against the file, for the 32-bit version. Double-check the version against the
`.python.version` file, as it should always contain the intended version. `.python.version` file, as it should always contain the intended version.

View File

@ -268,6 +268,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
:param journals_dir: The directory to check :param journals_dir: The directory to check
:return: The `str` form of the full path to the newest Journal file :return: The `str` form of the full path to the newest Journal file
""" """
# os.listdir(None) returns CWD's contents
if journals_dir is None:
return None
journal_files = (x for x in listdir(journals_dir) if self._RE_LOGFILE.search(x)) journal_files = (x for x in listdir(journals_dir) if self._RE_LOGFILE.search(x))
if journal_files: if journal_files:
# Odyssey Update 11 has, e.g. Journal.2022-03-15T152503.01.log # Odyssey Update 11 has, e.g. Journal.2022-03-15T152503.01.log
@ -430,7 +434,8 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
# Check whether new log file started, e.g. client (re)started. # Check whether new log file started, e.g. client (re)started.
if emitter and emitter.is_alive(): if emitter and emitter.is_alive():
new_journal_file = self.logfile # updated by on_created watchdog callback new_journal_file: Optional[str] = self.logfile # updated by on_created watchdog callback
else: else:
# Poll # Poll
try: try:
@ -2231,7 +2236,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
if self._navroute_retries_remaining == 0: if self._navroute_retries_remaining == 0:
return False return False
logger.info(f'Navroute read retry [{self._navroute_retries_remaining}]') logger.debug(f'Navroute read retry [{self._navroute_retries_remaining}]')
self._navroute_retries_remaining -= 1 self._navroute_retries_remaining -= 1
if self._last_navroute_journal_timestamp is None: if self._last_navroute_journal_timestamp is None:

View File

@ -5,7 +5,7 @@ wheel
# We can't rely on just picking this up from either the base (not venv), # We can't rely on just picking this up from either the base (not venv),
# or venv-init-time version. Specify here so that dependabot will prod us # or venv-init-time version. Specify here so that dependabot will prod us
# about new versions. # about new versions.
setuptools==60.9.3 setuptools==60.10.0
# Static analysis tools # Static analysis tools
flake8==4.0.1 flake8==4.0.1
@ -20,10 +20,10 @@ flake8-noqa==1.2.1
flake8-polyfill==1.0.2 flake8-polyfill==1.0.2
flake8-use-fstring==1.3 flake8-use-fstring==1.3
mypy==0.931 mypy==0.941
pep8-naming==0.12.1 pep8-naming==0.12.1
safety==1.10.3 safety==1.10.3
types-requests==2.27.11 types-requests==2.27.13
# Code formatting tools # Code formatting tools
autopep8==1.6.0 autopep8==1.6.0
@ -40,7 +40,7 @@ lxml==4.8.0
py2exe==0.11.1.0; sys_platform == 'win32' py2exe==0.11.1.0; sys_platform == 'win32'
# Testing # Testing
pytest==7.0.1 pytest==7.1.0
pytest-cov==3.0.0 # Pytest code coverage support pytest-cov==3.0.0 # Pytest code coverage support
coverage[toml]==6.3.2 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs coverage[toml]==6.3.2 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs
# For manipulating folder permissions and the like. # For manipulating folder permissions and the like.