From 6217451bad69b0d040ca105439ab9bcc6aaa14bf Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Sat, 24 May 2025 12:26:40 -0700 Subject: [PATCH] feat: Add gallery system restart script --- restart_gallery.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 restart_gallery.py diff --git a/restart_gallery.py b/restart_gallery.py new file mode 100644 index 0000000..6733f6a --- /dev/null +++ b/restart_gallery.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +""" +Restart gallery system script. +Use this after fixing code to reload the image monitoring system. +""" + +import sys +import os + +# Add current directory to Python path +current_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, current_dir) + +try: + # Import and initialize the gallery system + from database.operations import PromptDatabase + from utils.prompt_tracker import PromptTracker + from utils.image_monitor import ImageMonitor + + print("šŸ”„ Restarting PromptManager Gallery System...") + + # Initialize components + db = PromptDatabase() + tracker = PromptTracker(db) + monitor = ImageMonitor(db, tracker) + + print("āœ… Components initialized successfully") + + # Test image monitoring directories + status = monitor.get_status() + print(f"šŸ“ Monitoring status: {status}") + + # Start monitoring + monitor.start_monitoring() + print("āœ… Image monitoring restarted") + + print("\nšŸŽ‰ Gallery system restart completed!") + print("Generate some images now to test the automatic linking.") + +except ImportError as e: + print(f"āŒ Import error: {e}") + print("Make sure you're running this from the PromptManager directory") + +except Exception as e: + print(f"āŒ Error: {e}") + import traceback + traceback.print_exc() \ No newline at end of file