當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。