This commit introduces several new files to enhance project organization and developer onboarding. The `.cursorignore` and `.cursorrules` files provide guidelines for Cursor AI, while `CONTRIBUTING.md` outlines contribution procedures. Additionally, `IMPORT_FIX_SUMMARY.md`, `RESTRUCTURE_SUMMARY.md`, and `STATUS.md` summarize recent changes and project status. The `README.md` has been updated to reflect the new project focus and structure, ensuring clarity for contributors and users. These additions aim to improve maintainability and facilitate collaboration within the PunimTag project.
58 lines
1.8 KiB
Python
Executable File
58 lines
1.8 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Launcher script for PunimTag Dashboard
|
|
Adds project root to Python path and launches the dashboard
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add project root to Python path
|
|
project_root = Path(__file__).parent
|
|
sys.path.insert(0, str(project_root))
|
|
|
|
# Now import required modules
|
|
from src.gui.dashboard_gui import DashboardGUI
|
|
from src.gui.gui_core import GUICore
|
|
from src.core.database import DatabaseManager
|
|
from src.core.face_processing import FaceProcessor
|
|
from src.core.photo_management import PhotoManager
|
|
from src.core.tag_management import TagManager
|
|
from src.core.search_stats import SearchStats
|
|
from src.core.config import DEFAULT_DB_PATH
|
|
|
|
if __name__ == "__main__":
|
|
# Initialize all required components
|
|
gui_core = GUICore()
|
|
db_manager = DatabaseManager(DEFAULT_DB_PATH, verbose=0)
|
|
face_processor = FaceProcessor(db_manager, verbose=0)
|
|
photo_manager = PhotoManager(db_manager, verbose=0)
|
|
tag_manager = TagManager(db_manager, verbose=0)
|
|
search_stats = SearchStats(db_manager)
|
|
|
|
# Define callback functions for scan and process operations
|
|
def on_scan(folder, recursive):
|
|
"""Callback for scanning photos"""
|
|
return photo_manager.scan_folder(folder, recursive)
|
|
|
|
def on_process(limit=None, stop_event=None, progress_callback=None):
|
|
"""Callback for processing faces"""
|
|
return face_processor.process_faces(
|
|
limit=limit or 50,
|
|
stop_event=stop_event,
|
|
progress_callback=progress_callback
|
|
)
|
|
|
|
# Create and run dashboard
|
|
app = DashboardGUI(
|
|
gui_core=gui_core,
|
|
db_manager=db_manager,
|
|
face_processor=face_processor,
|
|
on_scan=on_scan,
|
|
on_process=on_process,
|
|
search_stats=search_stats,
|
|
tag_manager=tag_manager
|
|
)
|
|
app.open()
|
|
|