cli.py 文件源码

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

项目:datapackage-pipelines 作者: frictionlessdata 项目源码 文件源码
def execute_if_needed(argument, spec, use_cache):
    ps = status.get(spec.pipeline_id)
    if (match_pipeline_id(argument, spec.pipeline_id) or
            (argument == 'all') or
            (argument == 'dirty' and ps.dirty())):
        if len(spec.validation_errors) != 0:
            return (spec.pipeline_id, False, {}, ['init'] + list(map(str, spec.validation_errors))), \
                   spec.pipeline_id == argument
        eid = gen_execution_id()
        if ps.queue_execution(eid, 'manual'):
            success, stats, errors = \
                execute_pipeline(spec, eid,
                                 use_cache=use_cache)
            return (spec.pipeline_id, success, stats, errors), spec.pipeline_id == argument
        else:
            return (spec.pipeline_id, False, None, ['Already Running']), spec.pipeline_id == argument
    return None, False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号