Esempio n. 1
0
def hooks():
    hook_path = Path(app.config["USER_DIR"]) / "hooks.py"
    if not hook_path.exists():
        with hook_path.open("w") as f:
            f.write(
                "from archivy.config import BaseHooks\n"
                "class Hooks(BaseHooks):\n"
                "   # see available hooks at https://archivy.github.io/reference/hooks/\n"
                "   def on_dataobj_create(self, dataobj): # for example\n"
                "       pass")
    open_file(hook_path)
Esempio n. 2
0
def config():
    open_file(str(Path(app.config["INTERNAL_DIR"]) / "config.yml"))
Esempio n. 3
0
def local_edit(dataobj_id):
    dataobj = data.get_item(dataobj_id)
    if dataobj:
        data.open_file(dataobj["fullpath"])
        return Response(status=200)
    return Response(status=404)