Пример #1
0
 def close(self):
     _run_time = cluster_timezone.localize(
         datetime.datetime.now()) - cluster_timezone.normalize(self.date)
     _run_time = _run_time.microseconds / 1000 + 1000 * _run_time.seconds
     self.active = False
     self.run_time = _run_time
     self.save()
     # close current lock and return a list of (what, level) lines
     return [("closed {}".format(unicode(self)), logging_tools.LOG_LEVEL_OK)
             ]
Пример #2
0
 def get_start_time(self):
     return time.mktime(
         cluster_timezone.normalize(
             self.start_time).timetuple()) if self.start_time else ""
Пример #3
0
 def get_end_time_py(self):
     return time.mktime(
         cluster_timezone.normalize(
             self.end_time_py).timetuple()) if self.end_time_py else ""
Пример #4
0
 def get_created(self):
     return time.mktime(cluster_timezone.normalize(self.date).timetuple())