Bug correction

pull/26/head
Louis Vézina 7 years ago
parent 09cb87feeb
commit 3c216ad8a1

@ -307,32 +307,36 @@ def system():
interval_clean = interval_clean[1][:-1] interval_clean = interval_clean[1][:-1]
interval_split = interval_clean.split(':') interval_split = interval_clean.split(':')
hour = interval_split[0]
minute = interval_split[1].lstrip("0")
second = interval_split[2].lstrip("0")
text = "every " text = "every "
if interval_split[0] != "0": if hour != "0":
text = text + interval_split[0] text = text + hour
if interval_split[0] == "1": if hour == "1":
text = text + " hour" text = text + " hour"
else: else:
text = text + " hours" text = text + " hours"
if interval_split[2] == "00": if minute != "" and second != "":
text = text + " and "
elif interval_split[1] != "00":
text = text + ", " text = text + ", "
if interval_split[1] != "00": elif minute == "" and second != "":
text = text + interval_split[1].lstrip("0") text = text + " and "
if interval_split[1].lstrip("0") == "1": elif minute != "" and second == "":
text = text + " and "
if minute != "":
text = text + minute
if minute == "1":
text = text + " minute" text = text + " minute"
else: else:
text = text + " minutes" text = text + " minutes"
if interval_split[2] != "00": if second != "":
text = text + " and " text = text + " and "
if interval_split[1] == "00": if second != "":
text = text + " and " text = text + second
if interval_split[2] != "00": if second == "1":
text = text + interval_split[2].lstrip("0")
if interval_split[2].lstrip("0") == "1":
text = text + " second" text = text + " second"
else: else:
text = text + " seconds" text = text + " seconds"

Loading…
Cancel
Save