Fixed mysteryTime crash
This commit is contained in:
parent
288d5c2cf1
commit
400eef5371
2 changed files with 9 additions and 2 deletions
9
memos.py
9
memos.py
|
@ -69,7 +69,7 @@ def txt2delta(txt):
|
||||||
return sign*timed
|
return sign*timed
|
||||||
|
|
||||||
def pcfGrammar(td):
|
def pcfGrammar(td):
|
||||||
if type(td) is mysteryTime:
|
if td == timedelta(weeks=1): # Replacement for mysteryTime </3
|
||||||
when = "???"
|
when = "???"
|
||||||
temporal = "???"
|
temporal = "???"
|
||||||
pcf = "?"
|
pcf = "?"
|
||||||
|
@ -99,6 +99,10 @@ class TimeGrammar(object):
|
||||||
|
|
||||||
class TimeTracker(list):
|
class TimeTracker(list):
|
||||||
def __init__(self, time=None):
|
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.timerecord = {"P": [], "F": []}
|
||||||
self.open = {}
|
self.open = {}
|
||||||
if time is not None:
|
if time is not None:
|
||||||
|
@ -109,6 +113,9 @@ class TimeTracker(list):
|
||||||
else:
|
else:
|
||||||
self.current=-1
|
self.current=-1
|
||||||
def addTime(self, timed):
|
def addTime(self, timed):
|
||||||
|
# mysteryTime </3
|
||||||
|
if type(timed)==mysteryTime:
|
||||||
|
timed = timedelta(weeks=1)
|
||||||
try:
|
try:
|
||||||
i = self.index(timed)
|
i = self.index(timed)
|
||||||
self.current = i
|
self.current = i
|
||||||
|
|
|
@ -917,7 +917,7 @@ def timeProtocol(cmd):
|
||||||
return timed
|
return timed
|
||||||
|
|
||||||
def timeDifference(td):
|
def timeDifference(td):
|
||||||
if type(td) is mysteryTime:
|
if td == timedelta(weeks=1): # mysteryTime replacement :(
|
||||||
return "??:?? FROM ????"
|
return "??:?? FROM ????"
|
||||||
if td < timedelta(0):
|
if td < timedelta(0):
|
||||||
when = "AGO"
|
when = "AGO"
|
||||||
|
|
Loading…
Reference in a new issue