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) ]
def get_start_time(self): return time.mktime( cluster_timezone.normalize( self.start_time).timetuple()) if self.start_time else ""
def get_end_time_py(self): return time.mktime( cluster_timezone.normalize( self.end_time_py).timetuple()) if self.end_time_py else ""
def get_created(self): return time.mktime(cluster_timezone.normalize(self.date).timetuple())