on-modify.py 文件源码

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

项目:pomodoro-warriors 作者: cf020031308 项目源码 文件源码
def main():
    inputs = utils.format_inputs()
    task = inputs['task']
    ret = [json.dumps(task)]
    if 'end' in task and 'end' not in inputs['prior']:
        timew = json.loads(commands.getoutput('timew get dom.tracked.1.json'))
        cmd = 'timew duration "%(uuid)s" from %(entry)s - %(end)s' % task
        if 'end' not in timew and task['uuid'] in timew['tags']:
            cmd = 'timew stop :quiet && ' + cmd
        if 'estimate' in task:
            ret.append(
                'Estimate Duration: %s' %
                utils.parse_duration(task['estimate']))
        ret.append('Total Duration: %s' % commands.getoutput(cmd))
    if len(ret) == 1:
        ret.append('')
    print('\n'.join(ret))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号