build.py 文件源码

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

项目:AerisCloud 作者: AerisCloud 项目源码 文件源码
def _search_variables(search_path, variable):
    files = set()

    cmd = "grep -rI '%s = ' %s" % (variable, quote(search_path))
    try:
        grep = subprocess32.check_output(cmd, shell=True)
    except subprocess32.CalledProcessError:
        return []

    for line in grep.split('\n'):
        if not line.strip():
            continue
        filename = line[:line.find(':')].strip()
        if filename.startswith('.'):
            continue
        files.add(filename)

    return files
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号