From 9b4965d59165effafb7c3ae226cb008d55148ecf Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Fri, 13 Jan 2017 21:08:54 +0300 Subject: [PATCH] bug fixes --- toxygen/main.py | 2 +- toxygen/util.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/toxygen/main.py b/toxygen/main.py index 90ba8a6..8980d71 100644 --- a/toxygen/main.py +++ b/toxygen/main.py @@ -488,7 +488,7 @@ def main(): print('Toxygen v' + program_version) return elif arg == '--help': - print('Usage:\ntoxygen path_to_profile\ntoxygen tox_id\ntoxygen --version') + print('Usage:\ntoxygen path_to_profile\ntoxygen tox_id\ntoxygen --version\ntoxygen --reset') return elif arg == '--configure': configure() diff --git a/toxygen/util.py b/toxygen/util.py index d532f70..e78eca6 100644 --- a/toxygen/util.py +++ b/toxygen/util.py @@ -37,7 +37,7 @@ def remove(folder): def convert_time(t): - offset = time.timezone - time.daylight * 3600 + offset = time.timezone + time_offset() * 3600 sec = int(t) - offset m, s = divmod(sec, 60) h, m = divmod(m, 60) @@ -45,6 +45,15 @@ def convert_time(t): return '%02d:%02d' % (h, m) +def time_offset(): + hours = time.strftime('%H') + sec = int(time.time()) - time.timezone + m, s = divmod(sec, 60) + h, m = divmod(m, 60) + d, h = divmod(h, 24) + return int(hours) - h + + def append_slash(s): if len(s) and s[-1] not in ('\\', '/'): s += '/'