arewefastyet/slave/engineInfo.py

28 строки
623 B
Python

import json
def getInfo(path):
if not path.endswith("/"):
path += "/"
fp = open(path + "info.json", 'r')
info = json.load(fp)
fp.close();
# which platform to execute:
if info["binary"].endswith(".apk"):
info["platform"] = "android"
elif info["binary"].endswith(".dmg"):
info["platform"] = "osx"
elif info["binary"].endswith(".exe"):
info["platform"] = "win"
else:
info["platform"] = "linux"
# default args and env
if "args" not in info:
info["args"] = []
if "env" not in info:
info["env"] = {}
return info