浏览代码

python3 support

pull/259/head
Juan Pablo Giménez 5 年前
父节点
当前提交
33626e221e
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. +2
    -2
      modules/addon/endpoints.py
  2. +1
    -1
      modules/system/endpoints.py

+ 2
- 2
modules/addon/endpoints.py 查看文件

@@ -133,8 +133,8 @@ def plugins():
Read the central plugin yaml to get a list of all official plugins Read the central plugin yaml to get a list of all official plugins
:return: :return:
""" """
response = requests.get("https://raw.githubusercontent.com/Manuel83/craftbeerpi-plugins/master/plugins.yaml")
cbpi.cache["plugins"] = merge(yaml.load(response.text), cbpi.cache["plugins"])
response = requests.get("https://raw.githubusercontent.com/jpgimenez/craftbeerpi-plugins/master/plugins.yaml")
cbpi.cache["plugins"] = merge(yaml.safe_load(response.text), cbpi.cache["plugins"])
for key, value in cbpi.cache["plugins"].items(): for key, value in cbpi.cache["plugins"].items():
value["installed"] = os.path.isdir("./modules/plugins/%s/" % (key)) value["installed"] = os.path.isdir("./modules/plugins/%s/" % (key))




+ 1
- 1
modules/system/endpoints.py 查看文件

@@ -130,8 +130,8 @@ class SystemView(FlaskView):
endpoints[rule.rule][m] = dict(summary="", description="", consumes=["application/json"],produces=["application/json"]) endpoints[rule.rule][m] = dict(summary="", description="", consumes=["application/json"],produces=["application/json"])


with open("config/version.yaml", 'r') as stream: with open("config/version.yaml", 'r') as stream:
y = yaml.safe_load(stream)


y = yaml.load(stream)
pprint.pprint(y) pprint.pprint(y)
pprint.pprint(re) pprint.pprint(re)
return Response(yaml.dump(re), mimetype='text/yaml') return Response(yaml.dump(re), mimetype='text/yaml')


正在加载...
取消
保存