status_config.py 文件源码

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

项目:Desert-Fireball-Maintainence-GUI 作者: CPedersen3245 项目源码 文件源码
def GET(self):
        """
        Serves the dfnstation.cfg file to the user to read.

        Returns:
            result (str): A Base64 encoded string containing the contents of dfnstation.cfg.

        Raises:
            web.notfound
        """
        if LoginChecker.loggedIn():
            path = constants.dfnconfigPath

            if os.path.exists(path):
                getFile = file(path, 'rb')
                web.header('Content-type', 'application/octet-stream')
                web.header('Content-transfer-encoding', 'base64')

                return base64.standard_b64encode(getFile.read())
            else:
                raise web.notfound()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号