fix tsstats.log.parse_logs not returning clients

This commit is contained in:
Thor77 2016-05-24 21:48:11 +02:00
parent 53ffad3d81
commit 42d8c74f72
3 changed files with 10 additions and 7 deletions

View File

@ -56,7 +56,7 @@ author = 'Thor77'
# The short X.Y version.
version = '0.4'
# The full version, including alpha/beta/rc tags.
release = '0.4.0'
release = '0.4.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='tsstats',
version='0.4.0',
version='0.4.1',
author='Thor77',
author_email='thor77@thor77.org',
description='A simple Teamspeak stats-generator',

View File

@ -15,12 +15,15 @@ logger = logging.getLogger('tsstats')
def parse_logs(log_glob, ident_map=None):
for log_file in sorted(log_file for log_file in glob(log_glob)):
parse_log(log_file, ident_map)
def parse_log(log_path, ident_map=None):
clients = Clients(ident_map)
for log_file in sorted(log_file for log_file in glob(log_glob)):
clients = parse_log(log_file, ident_map, clients)
return clients
def parse_log(log_path, ident_map=None, clients=None):
if not clients:
clients = Clients(ident_map)
log_file = open(log_path)
# process lines
logger.debug('Started parsing of %s', log_file.name)