From 4bb7553f6483d06a9936de3fac581b472d785388 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Thu, 19 May 2016 21:53:05 +0200 Subject: [PATCH] remove duplicate code in tsstats.log.parse_logs * bump version to 0.2.4 --- docs/source/conf.py | 2 +- setup.py | 2 +- tsstats/log.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3f85bc1..03ea240 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,7 +56,7 @@ author = 'Thor77' # The short X.Y version. version = '0.2' # The full version, including alpha/beta/rc tags. -release = '0.2.3' +release = '0.2.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 270d24b..201407f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='tsstats', - version='0.2.3', + version='0.2.4', author='Thor77', author_email='thor77@thor77.org', description='A simple Teamspeak stats-generator', diff --git a/tsstats/log.py b/tsstats/log.py index a026833..b4621ff 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -33,11 +33,10 @@ def parse_logs(log_path, ident_map=None): data = '|'.join(parts[4:]).strip() if data.startswith('client'): nick, clid = re_dis_connect.findall(data)[0] + client = clients.setdefault(clid, Client(clid, nick)) if data.startswith('client connected'): - client = clients.setdefault(clid, Client(clid, nick)) client.connect(logdatetime) elif data.startswith('client disconnected'): - client = clients.setdefault(clid, Client(clid, nick)) client.disconnect(logdatetime) if 'invokeruid' in data: re_disconnect_data = re_disconnect_invoker.findall(