bug fixes

This commit is contained in:
ingvar1995 2017-01-13 21:08:54 +03:00
parent 5bdbb28e31
commit 9b4965d591
2 changed files with 11 additions and 2 deletions

View file

@ -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()

View file

@ -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 += '/'