play.py 文件源码

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

项目:witchcraft 作者: llllllllll 项目源码 文件源码
def play(conn, query):
    """Launch mpv with the results of the query.

    Parameters
    ----------
    conn : sa.engine.Connection
        The connection to the metadata database.
    query : string
        The witchcraft ql query to run against the database.

    Notes
    -----
    This function never returns.
    """
    select, extra_args = ql.compile(query)
    paths = [p[0] for p in conn.execute(select).fetchall()]

    if not paths:
        # nothing to play, mpv doesn't want an empty path list
        return

    os.execvp('mpv', ['mpv', '--no-video'] + extra_args + paths)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号