🚀 NEUE FEATURES: Push-to-Gitea, Inotify-Watcher, Changelog mit git log
docker-build-and-push / build (push) Successful in 1m54s

This commit is contained in:
KI-Sparringpartner
2026-08-03 17:23:50 +02:00
parent b390d90061
commit 9161abae63
6 changed files with 187 additions and 66 deletions
+19 -20
View File
@@ -1,25 +1,24 @@
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import subprocess
from pathlib import Path
class FileChangeHandler(FileSystemEventHandler):
def __init__(self, callback=None):
self.callback = callback
def start_inotify_watcher(path: str, callback=None):
"""
Startet einen Inotify-Watcher mit dem Befehl 'inotifywait'.
Callback wird aufgerufen bei Dateiänderungen.
"""
# Useinotifywait from inotify-tools package
command = [
"inotifywait",
"-m", "-r", "--format '%w%f %e'",
str(path)
]
def on_modified(self, event):
if not event.is_directory:
if self.callback:
self.callback(event.src_path)
print(f"[Watcher] Datei geändert: {event.src_path}")
process = subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True
)
def start_watcher(path: Path, callback=None):
"""Startet den File-Watcher in einem Hintergrundthread."""
event_handler = FileChangeHandler(callback=callback)
observer = Observer()
observer.schedule(event_handler, str(path), recursive=True)
observer.start()
return observer
return process