mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Convert time arguments to tuples
Methods mktime and strftime expect tuples or struct_time arguments.
This commit is contained in:
parent
c9baf9585a
commit
1dc5367d62
1 changed files with 4 additions and 4 deletions
|
@ -282,7 +282,7 @@ class ProgressionFormatter:
|
||||||
def norm_time(self, t):
|
def norm_time(self, t):
|
||||||
if len(t) == 3:
|
if len(t) == 3:
|
||||||
t = list(t)+[0, 0, 0, -1, -1, -1]
|
t = list(t)+[0, 0, 0, -1, -1, -1]
|
||||||
return list(time.localtime(time.mktime((t))))
|
return list(time.localtime(time.mktime(tuple(t))))
|
||||||
|
|
||||||
def getResults(self, interval, all_games=True):
|
def getResults(self, interval, all_games=True):
|
||||||
if all_games:
|
if all_games:
|
||||||
|
@ -326,7 +326,7 @@ class ProgressionFormatter:
|
||||||
lt = min(lt, tt) # min 1 month
|
lt = min(lt, tt) # min 1 month
|
||||||
else:
|
else:
|
||||||
lt = tt
|
lt = tt
|
||||||
dt = time.time()-time.mktime(lt)
|
dt = time.time()-time.mktime(tuple(lt))
|
||||||
if dt > 63072000: # 2 years
|
if dt > 63072000: # 2 years
|
||||||
d = 6
|
d = 6
|
||||||
elif dt > 31536000: # 1 year
|
elif dt > 31536000: # 1 year
|
||||||
|
@ -353,9 +353,9 @@ class ProgressionFormatter:
|
||||||
for i in range(delta):
|
for i in range(delta):
|
||||||
if marks:
|
if marks:
|
||||||
if ct[:3] in marks:
|
if ct[:3] in marks:
|
||||||
text = time.strftime(format, ct)
|
text = time.strftime(format, tuple(ct))
|
||||||
else:
|
else:
|
||||||
text = time.strftime(format, ct)
|
text = time.strftime(format, tuple(ct))
|
||||||
t = tuple(ct[:3])
|
t = tuple(ct[:3])
|
||||||
if t in results:
|
if t in results:
|
||||||
played += results[t][0]
|
played += results[t][0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue