fixes, hour format
This commit is contained in:
parent
a99d645774
commit
3a2420d9b6
2 changed files with 50 additions and 22 deletions
|
|
@ -51,21 +51,6 @@ class Usage(object):
|
|||
os.remove(self.file)
|
||||
self.final_warning_sent = False
|
||||
|
||||
def isOffLimit(self):
|
||||
'''Is the timer usage off its limits'''
|
||||
time_limit = self.timer.timeLimit
|
||||
if (time_limit < 0):
|
||||
return False
|
||||
if self.current > time_limit:
|
||||
return True
|
||||
|
||||
def isOffInterval(self):
|
||||
'''Is the timer usage expired'''
|
||||
usage_expiry = self.intervalResetTimestamp()
|
||||
if usage_expiry is None:
|
||||
return False
|
||||
return time.time() >= usage_expiry
|
||||
|
||||
def usageStartTimestamp(self):
|
||||
'''Start timestamp (ctime) for the current interval'''
|
||||
if not os.path.exists(self.file):
|
||||
|
|
@ -90,6 +75,21 @@ class Usage(object):
|
|||
return None
|
||||
return max(0, usage_expiry - time.time())
|
||||
|
||||
def isOffLimit(self):
|
||||
'''Is the timer usage off its limits'''
|
||||
time_limit = self.timer.timeLimit
|
||||
if (time_limit < 0):
|
||||
return False
|
||||
if self.current > time_limit:
|
||||
return True
|
||||
|
||||
def isOffInterval(self):
|
||||
'''Is the timer usage expired'''
|
||||
usage_expiry = self.intervalResetTimestamp()
|
||||
if usage_expiry is None:
|
||||
return False
|
||||
return time.time() >= usage_expiry
|
||||
|
||||
|
||||
class Timer(object):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue