Files
Jackify/jackify/backend/models/configuration.py
Omni cd591c14e3 Initial public release v0.1.0 - Linux Wabbajack Modlist Application
Jackify provides native Linux support for Wabbajack modlist installation
   and management with automated Steam integration and Proton configuration.

   Key Features:
   - Almost Native Linux implementation (texconv.exe run via proton)
   - Automated Steam shortcut creation and Proton prefix management
   - Both CLI and GUI interfaces, with Steam Deck optimization

   Supported Games:
   - Skyrim Special Edition
   - Fallout 4
   - Fallout New Vegas
   - Oblivion, Starfield, Enderal, and diverse other games

   Technical Architecture:
   - Clean separation between frontend and backend services
   - Powered by jackify-engine 0.3.x for Wabbajack-matching modlist installation
2025-09-05 20:46:24 +01:00

79 lines
2.9 KiB
Python

"""
Configuration Data Models
Data structures for configuration context between frontend and backend.
"""
from pathlib import Path
from typing import Optional, Dict, Any
from dataclasses import dataclass
@dataclass
class ConfigurationContext:
"""Context object for modlist configuration operations."""
modlist_name: str
install_dir: Path
mo2_exe_path: Optional[Path] = None
resolution: Optional[str] = None
download_dir: Optional[Path] = None
nexus_api_key: Optional[str] = None
modlist_value: Optional[str] = None
modlist_source: Optional[str] = None
skip_confirmation: bool = False
def __post_init__(self):
"""Convert string paths to Path objects."""
if isinstance(self.install_dir, str):
self.install_dir = Path(self.install_dir)
if isinstance(self.download_dir, str):
self.download_dir = Path(self.download_dir)
if isinstance(self.mo2_exe_path, str):
self.mo2_exe_path = Path(self.mo2_exe_path)
def to_dict(self) -> Dict[str, Any]:
"""Convert to dictionary for legacy compatibility."""
return {
'name': self.modlist_name,
'path': str(self.install_dir),
'mo2_exe_path': str(self.mo2_exe_path) if self.mo2_exe_path else None,
'resolution': self.resolution,
'download_dir': str(self.download_dir) if self.download_dir else None,
'nexus_api_key': self.nexus_api_key,
'modlist_value': self.modlist_value,
'modlist_source': self.modlist_source,
'skip_confirmation': self.skip_confirmation,
}
@classmethod
def from_dict(cls, data: Dict[str, Any]) -> 'ConfigurationContext':
"""Create from dictionary for legacy compatibility."""
return cls(
modlist_name=data.get('name', data.get('modlist_name', '')),
install_dir=Path(data.get('path', data.get('install_dir', ''))),
mo2_exe_path=Path(data['mo2_exe_path']) if data.get('mo2_exe_path') else None,
resolution=data.get('resolution'),
download_dir=Path(data['download_dir']) if data.get('download_dir') else None,
nexus_api_key=data.get('nexus_api_key'),
modlist_value=data.get('modlist_value'),
modlist_source=data.get('modlist_source'),
skip_confirmation=data.get('skip_confirmation', False),
)
@dataclass
class SystemInfo:
"""System information context."""
is_steamdeck: bool
steam_root: Optional[Path] = None
steam_user_id: Optional[str] = None
proton_version: Optional[str] = None
def to_dict(self) -> Dict[str, Any]:
"""Convert to dictionary."""
return {
'is_steamdeck': self.is_steamdeck,
'steam_root': str(self.steam_root) if self.steam_root else None,
'steam_user_id': self.steam_user_id,
'proton_version': self.proton_version,
}