From f7781383811fa1393d3be3d4f021eea0ab526f96 Mon Sep 17 00:00:00 2001 From: H5N3RG Date: Fri, 6 Mar 2026 14:01:18 +0000 Subject: [PATCH] gitea_connector.py aktualisiert --- gitea_connector.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gitea_connector.py b/gitea_connector.py index e68d03d..4e9251f 100644 --- a/gitea_connector.py +++ b/gitea_connector.py @@ -1,7 +1,7 @@ """ title: Gitea Connector author: H5N3RG -version: 0.1 +version: 0.2 license: MIT description: Allows Open WebUI LLMs to read and edit Gitea repositories. """ @@ -58,8 +58,14 @@ class Tools: def __init__(self): self.valves = self.Valves() + # FIX: GiteaAPI wird NICHT mehr hier instanziiert. + # Stattdessen wird self.api als Property definiert, + # damit die Valve-Werte immer aktuell sind wenn OWUI sie injiziert. - self.api = GiteaAPI(self.valves.GITEA_URL, self.valves.API_TOKEN) + @property + def api(self) -> GiteaAPI: + """Lazy property: baut GiteaAPI immer frisch mit den aktuellen Valve-Werten.""" + return GiteaAPI(self.valves.GITEA_URL, self.valves.API_TOKEN) # -------------------------------------------------- # LIST FILES @@ -192,4 +198,4 @@ class Tools: payload = {"title": title, "head": head, "base": base, "body": body} - return self.api.post(endpoint, payload) + return self.api.post(endpoint, payload) \ No newline at end of file