def schedule2time(schedule):
times = []
start = now = datetime.utcnow()
delta_prev = timedelta(0)
for s in schedule:
name = '{delta}/{period}'.format(**s)
delta = parse_period(s['delta'])
period = parse_period(s['period'])
# note2: we are counting backward
end = start
start = now - period
times.append({"name": name, "start": start, "end": end, "period": period, "delta": delta})
delta_prev = delta
return times
# find the names of existing machines
评论列表
文章目录