import pathlib,json,os
from remote import execute
here=pathlib.Path(__file__).parent
r=execute((here/'collect_remote.py').read_text())
assert r.returncode==0
data=json.loads(r.stdout)
fd=os.open(here/'result.json',os.O_WRONLY|os.O_CREAT|os.O_EXCL,0o600)
with os.fdopen(fd,'w') as f:json.dump(data,f,ensure_ascii=False,indent=2)
