Update
This commit is contained in:
@@ -1,16 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Plugin-Adapter für den Trainingsplan- und Rezept-Editor.
|
||||
|
||||
Das Original ist eine Flask-Anwendung (app.py) und bleibt vollständig
|
||||
unverändert. Hier wird sie lediglich
|
||||
|
||||
* auf ihren eigenen Datenordner data/trainingsplan/ gezeigt und
|
||||
* als WSGI-App in die ASGI-Suite eingehängt.
|
||||
|
||||
Das Tool läuft dadurch weiterhin auch allein:
|
||||
cd plugins/trainingsplan && python app.py
|
||||
"""
|
||||
"""Plugin-Adapter fuer das Trainingsplan-Backend."""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
@@ -21,7 +10,7 @@ from core.loader import load_module
|
||||
|
||||
|
||||
def create_app(ctx):
|
||||
# app.py liest DATA_DIR beim Import und legt dort die Phasen an.
|
||||
# app.py liest DATA_DIR beim Import und legt dort den ersten Plan an.
|
||||
previous = os.environ.get("DATA_DIR")
|
||||
os.environ["DATA_DIR"] = str(ctx.data_dir)
|
||||
try:
|
||||
@@ -32,7 +21,6 @@ def create_app(ctx):
|
||||
else:
|
||||
os.environ["DATA_DIR"] = previous
|
||||
|
||||
# Flask erzeugt seine URLs anhand von SCRIPT_NAME; a2wsgi übernimmt dafür
|
||||
# den root_path des Mounts. Damit funktionieren alle Routen unter
|
||||
# /plugins/trainingsplan genauso wie vorher unter /.
|
||||
# Flask erzeugt seine URLs anhand von SCRIPT_NAME; a2wsgi uebernimmt dafuer
|
||||
# den root_path des Mounts.
|
||||
return WSGIMiddleware(module.app)
|
||||
|
||||
Reference in New Issue
Block a user