Spaces:
Sleeping
Sleeping
Create ci_sinc_monitor.py
Browse files- ci_sinc_monitor.py +19 -0
ci_sinc_monitor.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from datetime import datetime
|
| 2 |
+
from typing import Dict
|
| 3 |
+
|
| 4 |
+
class CiSyncMonitor:
|
| 5 |
+
def __init__(self):
|
| 6 |
+
self.log_file = "memory.log"
|
| 7 |
+
|
| 8 |
+
def log_event(self, event: Dict[str, str]):
|
| 9 |
+
with open(self.log_file, "a", encoding="utf-8") as f:
|
| 10 |
+
f.write(f"{datetime.now().isoformat()} | {event['назва']} | {event['вузлові_показники'] if 'вузлові_показники' in event else '-'}\n")
|
| 11 |
+
|
| 12 |
+
def check_alignment(self, event):
|
| 13 |
+
фаза = event.get("вузлові_показники", {}).get("фаза", "")
|
| 14 |
+
if фаза.startswith("інь"):
|
| 15 |
+
print("[ALIGN] → Спокійна фаза, можливе розширення ідей (Malja)")
|
| 16 |
+
elif фаза.startswith("ян"):
|
| 17 |
+
print("[ALIGN] → Активна фаза, ініціація подій (PoDija)")
|
| 18 |
+
|
| 19 |
+
sync_monitor = CiSyncMonitor()
|