def saveImagePathAsHome(patient): file = os.path.abspath(patient.photo) cf.set("home_file", file) if not cf.isIn("home_dir") or not os.path.isdir(cf.get("home_dir")): directory = os.path.abspath(os.path.dirname(file)) + os.sep cf.set("home_dir", directory)
def load(language=DEFAULT_LANG): global messages language = cf.get("language") if cf.isIn("language") else DEFAULT_LANG with open("files/lang/%s.json" % language) as f: messages = json.load(f)