コード例 #1
0
ファイル: operations.py プロジェクト: bogdanpop/flowy
def first(result, *results):
    """Return the first result finish from a list of results.

    If no one is finished yet - all of the results are placeholders - return
    the first placeholder from the list.
    """
    rs = []
    for r in i_or_args(result, results):
        if is_result_proxy(r):
            rs.append(r)
        else:
            return r
    return min(rs, key=_order_key)
コード例 #2
0
ファイル: operations.py プロジェクト: xethorn/flowy
def first(result, *results):
    """Return the first result finish from a list of results.

    If no one is finished yet - all of the results are placeholders - return
    the first placeholder from the list.
    """
    rs = []
    for r in i_or_args(result, results):
        if is_result_proxy(r):
            rs.append(r)
        else:
            return r
    return min(rs, key=_order_key)
コード例 #3
0
ファイル: operations.py プロジェクト: bogdanpop/flowy
def finish_order(result, *results):
    """Return the results in their finish order.

    The results that aren't finished yet will be at the end with their relative
    order preserved.
    """
    rs = []
    for r in i_or_args(result, results):
        if is_result_proxy(r):
            rs.append(r)
        else:
            yield r
    for r in sorted(rs, key=_order_key):
        yield r
コード例 #4
0
ファイル: operations.py プロジェクト: xethorn/flowy
def finish_order(result, *results):
    """Return the results in their finish order.

    The results that aren't finished yet will be at the end with their relative
    order preserved.
    """
    rs = []
    for r in i_or_args(result, results):
        if is_result_proxy(r):
            rs.append(r)
        else:
            yield r
    for r in sorted(rs, key=_order_key):
        yield r