feat: orchestrer le pipeline M11
Co-authored-by: Codex/gpt-5.6-terra <codex-gpt-5-6-terra@agents.invalid>
This commit is contained in:
37
pronote_sync/pipeline/steps/caldav_sync.py
Normal file
37
pronote_sync/pipeline/steps/caldav_sync.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""Étape d'appel à la synchronisation CalDAV."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Protocol
|
||||
|
||||
from pronote_sync.config.settings import Settings
|
||||
from pronote_sync.models.pronote import PronoteData
|
||||
from pronote_sync.models.sync import CalDAVSyncResult
|
||||
|
||||
|
||||
class CalDAVSynchronizer(Protocol):
|
||||
"""Protocole injectable de synchronisation CalDAV."""
|
||||
|
||||
def __call__(self, data: PronoteData, settings: Settings) -> CalDAVSyncResult:
|
||||
"""Synchronise les données Pronote vers CalDAV.
|
||||
|
||||
:param data: Données Pronote normalisées.
|
||||
:param settings: Configuration effective de l'exécution.
|
||||
:return: Résultat de la synchronisation.
|
||||
:rtype: CalDAVSyncResult
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
def caldav_sync_step(
|
||||
synchronizer: CalDAVSynchronizer, data: PronoteData, settings: Settings
|
||||
) -> CalDAVSyncResult:
|
||||
"""Exécute la synchronisation CalDAV injectée.
|
||||
|
||||
:param synchronizer: Service de synchronisation injecté.
|
||||
:param data: Données Pronote normalisées.
|
||||
:param settings: Configuration effective de l'exécution.
|
||||
:return: Résultat CalDAV.
|
||||
:rtype: CalDAVSyncResult
|
||||
"""
|
||||
return synchronizer(data, settings)
|
||||
Reference in New Issue
Block a user