From ad7ff96b1b4143cb2bdc54c6417dff803013cd4d Mon Sep 17 00:00:00 2001 From: Thor77 Date: Sun, 19 Jun 2016 22:10:35 +0200 Subject: [PATCH] add filename-checking to split logs by sid * if filename doesn't match, fallback to plain sorting * using re_log_filename to match --- tsstats/log.py | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/tsstats/log.py b/tsstats/log.py index 32c59a1..b357583 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -2,11 +2,15 @@ import logging import re +from collections import namedtuple from datetime import datetime from glob import glob +from os.path import basename from tsstats.client import Client, Clients +re_log_filename = re.compile(r'ts3server_(?P\d{4}-\d\d-\d\d)' + '__(?P