", mode: " + self.mode + "]"
def colAlignedString(self):
- return "%16s %8s %4s" % ( \
- self.date.strftime("%Y-%m-%d %H:%M"), self.epoch, self.mode)
+ age = datetime.datetime.now() - self.date
+ total_hours = age.total_seconds()/3600
+ if total_hours <= 48:
+ agestr = "(%s h)" % int(total_hours)
+ else:
+ agestr = "(%s d)" % age.days
+ return "%16s %7s %8s %4s" % ( \
+ self.date.strftime("%Y-%m-%d %H:%M"), agestr, self.epoch, self.mode)
@staticmethod
def getDirName(date, epoch, mode):