mirror of
https://github.com/home-assistant/operating-system.git
synced 2026-02-24 03:35:15 +00:00
* Update buildroot 2020.02.01 Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix LN * Fix wpa Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix lint Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * fix-network Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix script Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
24 lines
581 B
Python
24 lines
581 B
Python
from io import BytesIO
|
|
from avro.schema import Parse
|
|
from avro.io import DatumReader, BinaryDecoder
|
|
|
|
schema = Parse("""{
|
|
"namespace": "org.buildroot.package.python_avro",
|
|
"type": "record",
|
|
"name": "Developer",
|
|
"fields": [
|
|
{"name": "email", "type": "string"},
|
|
{"name": "maintainer_of", "type": "string"}
|
|
]
|
|
}""")
|
|
|
|
example = b'<titouan.christophe@railnova.eu\x16python_avro'
|
|
|
|
reader = DatumReader(schema)
|
|
deserialized = reader.read(BinaryDecoder(BytesIO(example)))
|
|
|
|
assert deserialized == {
|
|
'email': 'titouan.christophe@railnova.eu',
|
|
'maintainer_of': 'python_avro',
|
|
}
|