SkyOSFullCore / modules /sync /config.py
sky-meilin's picture
Create config.py
f65f7be verified
Raw History Blame
2.02 kB
"""
config.py
SkyOS Sync Configuration
Zentrale Konfiguration für den Sync Manager.
Autor: Sky Meilin
Projekt: SkyOS
"""
from __future__ import annotations
from dataclasses import dataclass
# ---------------------------------------------------------
# Sync Einstellungen
# ---------------------------------------------------------
@dataclass(frozen=True)
class SyncConfig:
"""
Globale Einstellungen für die Synchronisation.
"""
enabled: bool = True
auto_sync: bool = False
sync_interval: int = 300 # Sekunden
retry_attempts: int = 3
retry_delay: int = 10 # Sekunden
log_sync: bool = True
# ---------------------------------------------------------
# Quellen
# ---------------------------------------------------------
@dataclass(frozen=True)
class SourceConfig:
"""
Aktivierte Synchronisationsquellen.
"""
project_cockpit: bool = True
huggingface: bool = True
google_sheets: bool = True
google_drive: bool = True
google_docs: bool = True
wordpress: bool = False
crm: bool = False
# ---------------------------------------------------------
# Konfliktbehandlung
# ---------------------------------------------------------
@dataclass(frozen=True)
class ConflictConfig:
"""
Regeln für Konflikte.
"""
strategy: str = "newest"
# Optionen:
# newest
# source
# target
# manual
create_backup: bool = True
backup_folder: str = "backups"
# ---------------------------------------------------------
# Instanzen
# ---------------------------------------------------------
SYNC = SyncConfig()
SOURCES = SourceConfig()
CONFLICT = ConflictConfig()
# ---------------------------------------------------------
# Helper
# ---------------------------------------------------------
def get_config() -> dict:
"""
Gibt die komplette Sync-Konfiguration zurück.
"""
return {
"sync": SYNC,
"sources": SOURCES,
"conflict": CONFLICT,
}