compile.py 文件源码

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

项目:sublime_libsass 作者: blitzrk 项目源码 文件源码
def _compile(files, config, outfile_for):
    flags = to_flags(config['compile'])

    compiled = []
    for f in files:
        in_file  = os.path.join(config['root'], f)
        out_file = outfile_for(f)

        # Make sure output folder exists
        mkdir_p(os.path.dirname(out_file))

        command = [sass.path] + flags + [in_file, out_file]
        p = Popen(command, stdout=PIPE, stderr=PIPE, **_platform_opts)
        out, err = p.communicate()

        if err:
            print(u"Error: {0}".format(err))
            print(u"Command: {0}".format(" ".join(command)))
            sublime.error_message(u"Failed to compile {0}\n\nView error with Ctrl+`".format(f))
            return

        compiled.append(f)

    return compiled
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号