moins de répétition + affichage plus cohérent
This commit is contained in:
parent
7cb1bcc22d
commit
c5823d8fa7
1 changed files with 6 additions and 11 deletions
|
@ -90,18 +90,13 @@ def ageLayout(tuple):
|
||||||
if tuple[i] > 1 and i != 1:
|
if tuple[i] > 1 and i != 1:
|
||||||
time[i] = time[i] + "s"
|
time[i] = time[i] + "s"
|
||||||
message = ""
|
message = ""
|
||||||
if tuple[5] > 0: # pour les secondes
|
if tuple[5] > 0:
|
||||||
affichage = [5] # on affiche que : seconde
|
affichage = [5]
|
||||||
if tuple[4] > 0:
|
if tuple[4] > 0:
|
||||||
affichage = [4, 5] # on affiche : minute + seconde
|
affichage = [4, 5]
|
||||||
if tuple[3] > 0:
|
for i in [3, 0]:
|
||||||
affichage = [3, 4, 5] # on affiche : heure + minute + seconde
|
if tuple[i] > 0:
|
||||||
if tuple[2] > 0:
|
affichage = [i, i + 1, i + 2]
|
||||||
affichage = [2, 3, 4] # on affiche : jour + heure + minute
|
|
||||||
if tuple[1] > 0:
|
|
||||||
affichage = [1, 2, 3] # on affiche : mois + jour + heure
|
|
||||||
if tuple[0] > 0:
|
|
||||||
affichage = [0, 1, 3] # on affiche : an + mois + heure
|
|
||||||
for i in affichage:
|
for i in affichage:
|
||||||
message = message + f", {tuple[i]} {time[i]}"
|
message = message + f", {tuple[i]} {time[i]}"
|
||||||
return message[2:]
|
return message[2:]
|
||||||
|
|
Reference in a new issue