23 lines
822 B
Python
23 lines
822 B
Python
|
|
# test_integration.py
|
||
|
|
import time
|
||
|
|
from database.db_manager import DBManager
|
||
|
|
from watcher.fs_watcher import FolderWatcher
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
# Инициализируем менеджер БД (создаст comfygallery.db в корне)
|
||
|
|
db = DBManager("comfygallery.db")
|
||
|
|
|
||
|
|
# Создаем вотчер
|
||
|
|
watcher = FolderWatcher(db)
|
||
|
|
|
||
|
|
# Запускаем отслеживание тестовой папки
|
||
|
|
watch_dir = "./test_output"
|
||
|
|
watcher.start_monitoring(watch_dir)
|
||
|
|
|
||
|
|
print(f"Слежение запущено за '{watch_dir}'. Поместите туда PNG/JPG из ComfyUI...")
|
||
|
|
try:
|
||
|
|
while True:
|
||
|
|
time.sleep(1)
|
||
|
|
except KeyboardInterrupt:
|
||
|
|
print("Остановка мониторинга...")
|
||
|
|
watcher.stop_monitoring()
|