diff --git a/.gitignore b/.gitignore index 9df428e..24a0eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,11 @@ cache trace node_modules result -vision_assistant.egg-info \ No newline at end of file +vision_assistant.egg-info +__pycache__ +tutor-next/out +tutor-next/export +*.debhelper +*.substvars +.pybuild +dev_config \ No newline at end of file diff --git a/debian/build-packages-list.txt b/debian/build-packages-list.txt new file mode 100644 index 0000000..bb8d9f4 --- /dev/null +++ b/debian/build-packages-list.txt @@ -0,0 +1 @@ +build-essential debhelper devscripts dh-python python3-all python3-setuptools python3-hatchling python3-pyqt5 python3-yaml python3-pillow python3-platformdirs nodejs npm qttools5-dev-tools python3-hatch pybuild-plugin-pyproject \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d9b5301..2532314 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "schulstick" -version = "0.1.0" +version = "0.1.3" description = "Interactive educational portal app for IT competency development with OER learning materials" requires-python = ">=3.8" dependencies = [ diff --git a/src/core/assets.py b/src/core/assets.py index cce18f3..1de8ac5 100644 --- a/src/core/assets.py +++ b/src/core/assets.py @@ -1,4 +1,5 @@ import os +from typing import Optional import pkg_resources from pathlib import Path from PyQt5.QtGui import QMovie, QPixmap @@ -11,30 +12,32 @@ class Assets: """Helper class for managing static assets""" @staticmethod - def get_asset_path(filename: str) -> Path: + def get_asset_path(filename: str, module: Optional[str] = None) -> Path: """Get the full path to an asset file""" + if module is None: + module = 'static' try: # First try to get from installed package - return Path(pkg_resources.resource_filename('vision_assistant', f'assets/{filename}')) + return Path(pkg_resources.resource_filename(module, f'assets/{filename}')) except (ImportError, pkg_resources.DistributionNotFound): # Fallback to local development path - local_path = Path(__file__).parent.parent / 'vision_assistant' / 'assets' / filename + local_path = Path(__file__).parent.parent / module / 'assets' / filename if local_path.exists(): return local_path raise AssetNotFoundError(f"Asset not found: {filename}") @staticmethod - def load_movie(filename: str) -> QMovie: + def load_movie(filename: str, module: Optional[str] = None) -> QMovie: """Load an animated asset file as QMovie""" - movie = QMovie(str(Assets.get_asset_path(filename))) + movie = QMovie(str(Assets.get_asset_path(filename, module))) if not movie.isValid(): raise AssetNotFoundError(f"Invalid movie asset: {filename}") return movie @staticmethod - def load_pixmap(filename: str) -> QPixmap: + def load_pixmap(filename: str, module: Optional[str] = None) -> QPixmap: """Load an image asset file as QPixmap""" - pixmap = QPixmap(str(Assets.get_asset_path(filename))) + pixmap = QPixmap(str(Assets.get_asset_path(filename, module))) if pixmap.isNull(): raise AssetNotFoundError(f"Invalid image asset: {filename}") return pixmap diff --git a/src/vision_assistant/main.py b/src/vision_assistant/main.py index bd28889..749752c 100644 --- a/src/vision_assistant/main.py +++ b/src/vision_assistant/main.py @@ -10,17 +10,21 @@ from PyQt5.QtCore import QBuffer, QByteArray from core.assets import Assets from core.preferences import Preferences +from portal.window import PortalWindow from vision_assistant.vision import HighlightOverlay from vision_assistant.tutor import TutorView from PyQt5.QtCore import Qt, QPropertyAnimation, QEasingCurve, QRect from PyQt5.QtGui import (QPainter, QPainterPath, QColor, QIcon, QMovie, QPixmap) os.environ['QT_LOGGING_RULES'] = '*.debug=false;qt.qpa.*=false;qt.*=false;*.warning=false' +#maximize logging +#os.environ['QT_LOGGING_RULES'] = '*.debug=true;qt.qpa.*=true;qt.*=true;*.warning=true' class CircularWindow(QWidget): def __init__(self): super().__init__() self.tutor_view = None + self.porttal = None self.preferences = Preferences.load() # Setup logging @@ -99,18 +103,21 @@ def hide_to_tray(self): def initUI(self): self.setGeometry(self.circular_geometry) + # Add background animation for circular view try: - self.movie = Assets.load_movie('cloud.webp') + self.movie = Assets.load_movie('cloud.webp', "vision_assistant") except Exception as e: + self.logger.error(f"Failed to load movie: {e}") self.movie = QMovie() self.movie.setFileName('') # Empty movie acts as black background + self.movie.frameChanged.connect(self.repaint) self.movie.start() # Load static background for expanded view try: - self.night_bg = Assets.load_pixmap('night.jpg') + self.night_bg = Assets.load_pixmap('night.jpg', "vision_assistant") except Exception: self.night_bg = QPixmap() @@ -318,7 +325,9 @@ def show_tutor(self): def launch_portal(self): """Launch the portal application""" - QApplication.instance().startDetached("portal") + if not self.porttal: + self.porttal = PortalWindow() + self.porttal.show() def cleanup_session(self): """Clean up API session on close"""