Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AbstractTimeQueryTest(AbstractTest):
- def __init__(self):
- AbstractTest.__init__(self)
- print("I am getting here")
- self.stepHours = 1
- self.stepDays = 1
- self.__path = self.path
- # %tsb - Unix Time Stamp Before (now - stepHours, default to 1 hour)
- # %tsa - Unix Time Stamp After (now + stepHours)
- # %db - Date Before in YYYYMMDD (now - stepDays, default to 1 day)
- # %da - Date After in YYYYMMDD (now + stepDays)
- def __set_path(self,path):
- if path != '': #Python seriously calls this before __init__?!?!
- now = int(time.time())
- t = path.replace('%tsb', ((now - 86,400) * self.stepHours) )
- t = t.replace('%tsa','' ((now + 86,400) * self.stepHours) )
- t = t.replace('%db', (date.today() - timedelta(self.stepDays)).strftime('%yyyy%m%d'))
- t = t.replace('%da', (date.today() + timedelta(self.stepDays)).strftime('%yyyy%m%d'))
- self.__path = t
- path = property(lambda self : self.__path,__set_path)
Add Comment
Please, Sign In to add comment