1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Merge branch 'develop' of https://github.com/EDCD/EDMarketConnector into develop

This commit is contained in:
Athanasius 2020-07-02 18:07:19 +01:00
commit 46812e83e9
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ try:
# Get state from latest Journal file
try:
logdir = config.get('journaldir') or config.default_journal_dir
logfiles = sorted([x for x in os.listdir(logdir) if x.startswith('Journal') and x.endswith('.log')],
logfiles = sorted([x for x in os.listdir(logdir) if re.search('^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$', x)],
key=lambda x: x.split('.')[1:])
logfile = join(logdir, logfiles[-1])
with open(logfile, 'r') as loghandle:

View File

@ -129,7 +129,7 @@ class EDLogs(FileSystemEventHandler):
# Latest pre-existing logfile - e.g. if E:D is already running. Assumes logs sort alphabetically.
# Do this before setting up the observer in case the journal directory has gone away
try:
logfiles = sorted([x for x in listdir(self.currentdir) if x.startswith('Journal') and x.endswith('.log')],
logfiles = sorted([x for x in listdir(self.currentdir) if re.search('^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$', x)],
key=lambda x: x.split('.')[1:])
self.logfile = logfiles and join(self.currentdir, logfiles[-1]) or None
except:
@ -188,7 +188,7 @@ class EDLogs(FileSystemEventHandler):
def on_created(self, event):
# watchdog callback, e.g. client (re)started.
if not event.is_directory and basename(event.src_path).startswith('Journal') and basename(event.src_path).endswith('.log'):
if not event.is_directory and re.search('^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$', basename(event.src_path)):
self.logfile = event.src_path
def worker(self):
@ -248,7 +248,7 @@ class EDLogs(FileSystemEventHandler):
else:
# Poll
try:
logfiles = sorted([x for x in listdir(self.currentdir) if x.startswith('Journal') and x.endswith('.log')],
logfiles = sorted([x for x in listdir(self.currentdir) if re.search('^Journal(Beta)?\.[0-9]{12}\.[0-9]{2}\.log$', x)],
key=lambda x: x.split('.')[1:])
newlogfile = logfiles and join(self.currentdir, logfiles[-1]) or None
except: