mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-29 14:49:29 +03:00
EDMC.py: Use monitor.journal_newest_filename()
This commit is contained in:
parent
a8e534c5ae
commit
43bae13418
10
EDMC.py
10
EDMC.py
@ -7,9 +7,8 @@ import json
|
||||
import locale
|
||||
import os
|
||||
import queue
|
||||
import re
|
||||
import sys
|
||||
from os.path import getmtime, join
|
||||
from os.path import getmtime
|
||||
from time import sleep, time
|
||||
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]
|
||||
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:
|
||||
"""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
|
||||
|
||||
logger.debug(f'logdir = "{monitor.currentdir}"')
|
||||
logfiles = sorted((x for x in os.listdir(monitor.currentdir) if JOURNAL_RE.search(x)),
|
||||
key=lambda x: x.split('.')[1:])
|
||||
|
||||
logfile = join(monitor.currentdir, logfiles[-1])
|
||||
logfile = monitor.journal_newest_filename(monitor.currentdir)
|
||||
|
||||
logger.debug(f'Using logfile "{logfile}"')
|
||||
with open(logfile, 'r', encoding='utf-8') as loghandle:
|
||||
|
Loading…
x
Reference in New Issue
Block a user