fix tsstats.log.parse_logs not returning clients
This commit is contained in:
parent
53ffad3d81
commit
42d8c74f72
|
@ -56,7 +56,7 @@ author = 'Thor77'
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '0.4'
|
version = '0.4'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# 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
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='tsstats',
|
name='tsstats',
|
||||||
version='0.4.0',
|
version='0.4.1',
|
||||||
author='Thor77',
|
author='Thor77',
|
||||||
author_email='thor77@thor77.org',
|
author_email='thor77@thor77.org',
|
||||||
description='A simple Teamspeak stats-generator',
|
description='A simple Teamspeak stats-generator',
|
||||||
|
|
|
@ -15,12 +15,15 @@ logger = logging.getLogger('tsstats')
|
||||||
|
|
||||||
|
|
||||||
def parse_logs(log_glob, ident_map=None):
|
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)
|
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)
|
log_file = open(log_path)
|
||||||
# process lines
|
# process lines
|
||||||
logger.debug('Started parsing of %s', log_file.name)
|
logger.debug('Started parsing of %s', log_file.name)
|
||||||
|
|
Loading…
Reference in New Issue