server.py 文件源码

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

项目:sailboat 作者: vgmoose 项目源码 文件源码
def make(self, *args, **kwargs):
        if not is_logged_in:
            raise cherrypy.HTTPError(401)

        # cd into the target directory
        sesh_id = os.path.basename(cherrypy.request.cookie["sesh_id"].value)

        rate_limited_long(sesh_id)

        errored = False

        try:
            output = subprocess.check_output (["make"], cwd=HOME+sesh_id, stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            output = e.output
            errored = True

        fl = open(HOME+sesh_id+"/build.log", "w")
        fl.write(output);
        fl.close()

        if errored:
            raise cherrypy.HTTPError(422)

        return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号