From 55277a2c757359d4f7e1bf8dfaf8f015a1479dac Mon Sep 17 00:00:00 2001 From: Thor77 Date: Thu, 19 May 2016 15:39:36 +0200 Subject: [PATCH] use optional-nick-arg instead of explicit assignment --- tsstats/log.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tsstats/log.py b/tsstats/log.py index fa56516..8428b4b 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -34,12 +34,10 @@ def parse_logs(log_path, ident_map={}): if data.startswith('client'): nick, clid = re_dis_connect.findall(data)[0] if data.startswith('client connected'): - client = clients.setdefault(clid, Client(clid)) - client.nick = nick + client = clients.setdefault(clid, Client(clid, nick)) client.connect(logdatetime) elif data.startswith('client disconnected'): - client = clients.setdefault(clid, Client(clid)) - client.nick = nick + client = clients.setdefault(clid, Client(clid, nick)) client.disconnect(logdatetime) if 'invokeruid' in data: re_disconnect_data = re_disconnect_invoker.findall(