Fixed mysteryTime crash

This commit is contained in:
Dpeta 2021-03-24 16:46:58 +01:00
parent 288d5c2cf1
commit 400eef5371
2 changed files with 9 additions and 2 deletions

View file

@ -69,7 +69,7 @@ def txt2delta(txt):
return sign*timed
def pcfGrammar(td):
if type(td) is mysteryTime:
if td == timedelta(weeks=1): # Replacement for mysteryTime </3
when = "???"
temporal = "???"
pcf = "?"
@ -99,6 +99,10 @@ class TimeGrammar(object):
class TimeTracker(list):
def __init__(self, time=None):
# mysteryTime breaks stuff now, so, uh
# I'm replacing it with 1 day...
if type(time)==mysteryTime:
time = timedelta(weeks=1)
self.timerecord = {"P": [], "F": []}
self.open = {}
if time is not None:
@ -109,6 +113,9 @@ class TimeTracker(list):
else:
self.current=-1
def addTime(self, timed):
# mysteryTime </3
if type(timed)==mysteryTime:
timed = timedelta(weeks=1)
try:
i = self.index(timed)
self.current = i

View file

@ -917,7 +917,7 @@ def timeProtocol(cmd):
return timed
def timeDifference(td):
if type(td) is mysteryTime:
if td == timedelta(weeks=1): # mysteryTime replacement :(
return "??:?? FROM ????"
if td < timedelta(0):
when = "AGO"