cluster4npu/resources/__init__.py
Mason 92f9d956af Remove cluster4npu_ui package prefix and remove export/analysis buttons
- Update all imports to use relative imports instead of cluster4npu_ui.* prefix
- Remove export configuration functionality from dashboard menu
- Remove performance analysis action from pipeline menu
- Update dependencies in pyproject.toml to include NodeGraphQt and PyQt5
- Maintain clean import structure across all modules

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 12:17:59 +08:00

63 lines
1.5 KiB
Python

"""
Static resources and assets for the Cluster4NPU application.
This module manages static resources including icons, images, stylesheets,
and other assets used throughout the application.
Available Resources:
- icons/: Application icons and graphics
- styles/: Additional stylesheet files
- assets/: Other static resources
Usage:
from resources import get_icon_path, get_style_path
icon_path = get_icon_path('node_model.png')
style_path = get_style_path('dark_theme.qss')
"""
import os
from pathlib import Path
def get_resource_path(resource_name: str) -> str:
"""
Get the full path to a resource file.
Args:
resource_name: Name of the resource file
Returns:
Full path to the resource file
"""
resources_dir = Path(__file__).parent
return str(resources_dir / resource_name)
def get_icon_path(icon_name: str) -> str:
"""
Get the full path to an icon file.
Args:
icon_name: Name of the icon file
Returns:
Full path to the icon file
"""
return get_resource_path(f"icons/{icon_name}")
def get_style_path(style_name: str) -> str:
"""
Get the full path to a stylesheet file.
Args:
style_name: Name of the stylesheet file
Returns:
Full path to the stylesheet file
"""
return get_resource_path(f"styles/{style_name}")
__all__ = [
"get_resource_path",
"get_icon_path",
"get_style_path"
]