mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-15 23:02:16 +03:00
Handle new Journal filename in Beta
This commit is contained in:
parent
a2ce9da44e
commit
9869cd58e8
@ -164,7 +164,8 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
# Latest pre-existing logfile - e.g. if E:D is already running. Assumes logs sort alphabetically.
|
# 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
|
# Do this before setting up the observer in case the journal directory has gone away
|
||||||
try:
|
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 x.startswith('Journal') and x.endswith('.log')],
|
||||||
|
key=lambda x: x.split('.')[1:])
|
||||||
self.logfile = logfiles and join(self.currentdir, logfiles[-1]) or None
|
self.logfile = logfiles and join(self.currentdir, logfiles[-1]) or None
|
||||||
except:
|
except:
|
||||||
self.logfile = None
|
self.logfile = None
|
||||||
@ -224,7 +225,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
|
|
||||||
def on_created(self, event):
|
def on_created(self, event):
|
||||||
# watchdog callback, e.g. client (re)started.
|
# 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 basename(event.src_path).startswith('Journal') and basename(event.src_path).endswith('.log'):
|
||||||
self.logfile = event.src_path
|
self.logfile = event.src_path
|
||||||
|
|
||||||
def worker(self):
|
def worker(self):
|
||||||
@ -263,7 +264,8 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
else:
|
else:
|
||||||
# Poll
|
# Poll
|
||||||
try:
|
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 x.startswith('Journal') and x.endswith('.log')],
|
||||||
|
key=lambda x: x.split('.')[1:])
|
||||||
newlogfile = logfiles and join(self.currentdir, logfiles[-1]) or None
|
newlogfile = logfiles and join(self.currentdir, logfiles[-1]) or None
|
||||||
except:
|
except:
|
||||||
if __debug__: print_exc()
|
if __debug__: print_exc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user