0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00
bird/yang/json-cbor-yang.py

14 lines
196 B
Python
Raw Normal View History

2023-11-15 11:31:42 +00:00
import cbor
import json
import sys
2023-11-15 12:56:37 +00:00
import JSON_CBOR
2023-11-15 11:31:42 +00:00
#print(sys.argv[1])
2023-11-15 12:56:37 +00:00
msg = JSON_CBOR.Message(sys.argv[1], "json")
2023-11-15 11:31:42 +00:00
with open(sys.argv[2], "wb") as of:
cbor.dump(msg.raw, of)
print("OK")