@unionschool/easy-agents 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ """Run the packaged member-sync implementation using only Python's standard library."""
2
+ import json
3
+ from pathlib import Path
4
+ import signal
5
+ import sys
6
+ from threading import Event
7
+
8
+ sys.path.insert(0, str(Path(__file__).resolve().parent))
9
+ from easyagents_core import member_sync
10
+
11
+ cancel = Event()
12
+ signal.signal(signal.SIGTERM, lambda *_: cancel.set())
13
+ request = json.load(sys.stdin)
14
+ result = member_sync.run(Path.cwd(), request, cancel)
15
+ print(json.dumps({key: getattr(result, key) for key in (
16
+ 'status', 'reply_text', 'workspace_sync', 'failure_code', 'failure_detail'
17
+ ) if getattr(result, key) is not None}))