def resavejson(dictID, user, dictDB, configs): count = 0 stats = ops.getDictStats(dictDB) while stats["needResave"] and count <= 127: ops.refac(dictDB, dictID, configs) ops.refresh(dictDB, dictID, configs) ops.resave(dictDB, dictID, configs) stats = ops.getDictStats(dictDB) count += 1 return {"todo": stats["needResave"]}
def config(dictID, user, dictDB, configs): stats = ops.getDictStats(dictDB) return template( "config.tpl", **{ "siteconfig": siteconfig, "user": user, "dictID": dictID, "dictTitle": configs["ident"]["title"], "needResave": stats["needResave"], "hasXemaOverride": (("_xonomyDocSpec" in configs["xema"] and configs["xema"]["_xonomyDocSpec"] != "") or ("_dtd" in configs["xema"] and configs["xema"]["_dtd"] != "")), "hasXemplateOverride": (("_xsl" in configs["xemplate"] and configs["xemplate"]["_xsl"] != "") or ("_css" in configs["xemplate"] and configs["xemplate"]["_css"] != "")), "hasEditingOverride": ("_js" in configs["editing"] and configs["editing"]["_js"] != "") })
def resave(dictID, user, dictDB, configs): stats = ops.getDictStats(dictDB) return template( "resave.tpl", **{ "siteconfig": siteconfig, "user": user, "dictID": dictID, "dictTitle": configs["ident"]["title"], "awayUrl": "../../" + dictID + "/edit", "todo": stats["entryCount"] })
def config(dictID, user, dictDB, configs): stats = ops.getDictStats(dictDB) links = {"out": {}, "in": {}} for link in ops.links_get(dictID, "", "", "", "", ""): if not link["target_dict"] in links["out"]: links["out"][link["target_dict"]] = [] links["out"][link["target_dict"]].append(link) for link in ops.links_get("", "", "", dictID, "", ""): if not link["source_dict"] in links["in"]: links["in"][link["source_dict"]] = [] links["in"][link["source_dict"]].append(link) return template( "links.tpl", **{ "siteconfig": siteconfig, "user": user, "dictID": dictID, "dictTitle": configs["ident"]["title"], "links": links })