From 812916f179398771ae080d11deb7eb63127e1f30 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 4 Nov 2016 20:03:02 +0100 Subject: [PATCH] Use list-comprehension for reconnect to make this action more obvious and understandable --- tsstats/log.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tsstats/log.py b/tsstats/log.py index 2a6f0c2..f7bf6fe 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -160,9 +160,9 @@ def _parse_details(log_path, ident_map=None, clients=None, online_dc=True): else: invoker.kick(client) if online_dc: - for client in clients: - if client.connected: - client.disconnect(datetime.utcnow()) - client.connected += 1 + def _reconnect(client): + client.disconnect(datetime.utcnow()) + client.connected += 1 + [_reconnect(client) for client in clients if client.connected] logger.debug('Finished parsing of %s', log_file.name) return clients