当前位置: 首页>>代码示例>>Python>>正文


Python Workflow.find_all方法代码示例

本文整理汇总了Python中spreads.workflow.Workflow.find_all方法的典型用法代码示例。如果您正苦于以下问题:Python Workflow.find_all方法的具体用法?Python Workflow.find_all怎么用?Python Workflow.find_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在spreads.workflow.Workflow的用法示例。


在下文中一共展示了Workflow.find_all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: list_workflows

# 需要导入模块: from spreads.workflow import Workflow [as 别名]
# 或者: from spreads.workflow.Workflow import find_all [as 别名]
def list_workflows():
    """ Return a list of all workflows.

    :resheader Content-Type:    :mimetype:`application/json`
    """
    workflows = Workflow.find_all(app.config['base_path'])
    return make_response(json.dumps(workflows.values()),
                         200, {'Content-Type': 'application/json'})
开发者ID:LabExperimental-SIUA,项目名称:spreads,代码行数:10,代码来源:endpoints.py

示例2: prepare_capture

# 需要导入模块: from spreads.workflow import Workflow [as 别名]
# 或者: from spreads.workflow.Workflow import find_all [as 别名]
def prepare_capture(workflow):
    """ Prepare capture for the requested workflow. """
    # Check if any other workflow is active and finish, if neccessary
    logger.debug("Finishing previous workflows")
    wfitems = Workflow.find_all(app.config['base_path'], key='id').iteritems()
    for wfid, wf in wfitems:
        if wf.status['step'] == 'capture' and wf.status['prepared']:
            if wf is workflow and not request.args.get('reset'):
                return 'OK'
            wf.finish_capture()
    try:
        workflow.prepare_capture()
    except DeviceException as e:
        logger.error(e)
        raise ApiException("Could not prepare capture: {0}".format(e.message),
                           500, error_type='device')
    return 'OK'
开发者ID:LabExperimental-SIUA,项目名称:spreads,代码行数:19,代码来源:endpoints.py

示例3: prepare_capture

# 需要导入模块: from spreads.workflow import Workflow [as 别名]
# 或者: from spreads.workflow.Workflow import find_all [as 别名]
def prepare_capture(workflow):
    """ Prepare capture for the requested workflow.

    """
    if app.config['mode'] not in ('scanner', 'full'):
        raise ApiException("Only possible when running in 'scanner' or 'full'"
                           " mode.", 503)

    # Check if any other workflow is active and finish, if neccessary
    logger.debug("Finishing previous workflows")
    wfitems = Workflow.find_all(app.config['base_path'], key='id').iteritems()
    for wfid, wf in wfitems:
        if wf.status['step'] == 'capture' and wf.status['prepared']:
            if wf is workflow and not request.args.get('reset'):
                return 'OK'
            wf.finish_capture()
    workflow.prepare_capture()
    return 'OK'
开发者ID:5up3rD4n1,项目名称:spreads,代码行数:20,代码来源:web.py


注:本文中的spreads.workflow.Workflow.find_all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。