backups.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:smartbackup 作者: baszoetekouw 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号