From 9d5197d813ba17478b399b39e52f7b48952ccc73 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Sun, 12 Jun 2016 17:19:29 +0200 Subject: [PATCH] use py2-compatible way to convert datetime.datetime to timestamp * bump version to 0.6.8 --- docs/source/conf.py | 2 +- setup.py | 2 +- tsstats/log.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 6fd64e0..6871da8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,7 +56,7 @@ author = 'Thor77' # The short X.Y version. version = '0.6' # The full version, including alpha/beta/rc tags. -release = '0.6.7' +release = '0.6.8' # 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 1480914..5eb3060 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='tsstats', - version='0.6.7', + version='0.6.8', author='Thor77', author_email='thor77@thor77.org', description='A simple Teamspeak stats-generator', diff --git a/tsstats/log.py b/tsstats/log.py index cb5ae37..c4af8f5 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -95,7 +95,10 @@ def parse_log(log_path, ident_map=None, clients=None, online_dc=True): if online_dc: for client in clients: if client.connected: - client.disconnect(int(datetime.utcnow().timestamp())) + client.disconnect( + int((datetime.utcnow() - datetime(1970, 1, 1)) + .total_seconds()) + ) client.connected += 1 logger.debug('Finished parsing of %s', log_file.name) return clients