bug fixes
This commit is contained in:
parent
5bdbb28e31
commit
9b4965d591
2 changed files with 11 additions and 2 deletions
|
@ -488,7 +488,7 @@ def main():
|
||||||
print('Toxygen v' + program_version)
|
print('Toxygen v' + program_version)
|
||||||
return
|
return
|
||||||
elif arg == '--help':
|
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
|
return
|
||||||
elif arg == '--configure':
|
elif arg == '--configure':
|
||||||
configure()
|
configure()
|
||||||
|
|
|
@ -37,7 +37,7 @@ def remove(folder):
|
||||||
|
|
||||||
|
|
||||||
def convert_time(t):
|
def convert_time(t):
|
||||||
offset = time.timezone - time.daylight * 3600
|
offset = time.timezone + time_offset() * 3600
|
||||||
sec = int(t) - offset
|
sec = int(t) - offset
|
||||||
m, s = divmod(sec, 60)
|
m, s = divmod(sec, 60)
|
||||||
h, m = divmod(m, 60)
|
h, m = divmod(m, 60)
|
||||||
|
@ -45,6 +45,15 @@ def convert_time(t):
|
||||||
return '%02d:%02d' % (h, m)
|
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):
|
def append_slash(s):
|
||||||
if len(s) and s[-1] not in ('\\', '/'):
|
if len(s) and s[-1] not in ('\\', '/'):
|
||||||
s += '/'
|
s += '/'
|
||||||
|
|
Loading…
Reference in a new issue