def _calc_purge_before(self): """Calculates time after which manifests should be purged.""" if self.args.purge_before: return dt_util.parse_date_input(self.args.purge_before) assert (self.args.keep_days or -1) > 0 return dt_util.now() - datetime.timedelta(self.args.keep_days)
def _extrapolate_hours(self, hours): """Add hours to ``hours`` to extrapolate the total usage. Updates ``hours`` in place. """ if self.args.extrapolate_to == "now": to_dt = datetime.datetime.now() else: to_dt = dt_util.parse_date_input(self.args.extrapolate_to) while hours[-1].start < to_dt and not hours[-1].contains(to_dt): hours.append(hours[-1].next_hour()) return
def _extrapolate_hours(self, hours): """Add hours to ``hours`` to extrapolate the total usage. Updates ``hours`` in place. """ if self.args.extrapolate_to == "now": to_dt = datetime.datetime.now() else: to_dt = dt_util.parse_date_input( self.args.extrapolate_to) while hours[-1].start < to_dt and not hours[-1].contains(to_dt): hours.append(hours[-1].next_hour()) return
def __init__(self, args): self.args = args self.args.day = dt_util.to_utc(dt_util.parse_date_input( self.args.day))
def __init__(self, args): self.args = args self.args.day = dt_util.to_utc(dt_util.parse_date_input(self.args.day))