Make Property a subclass of bytearray

It is annoying to have to add .value when we want the value of a Property.
Make Property a subclass of bytearray so that it can be used directly when
the value is required.

Fix the Property class comment while we are here.

Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Simon Glass 2018-05-17 23:09:14 -06:00 committed by David Gibson
parent 24b1f3f064
commit f0be81bd8d
2 changed files with 5 additions and 4 deletions

View file

@ -190,7 +190,7 @@ class PyLibfdtTests(unittest.TestCase):
poffset = self.fdt.first_property_offset(root)
prop = self.fdt.get_property_by_offset(poffset)
self.assertEquals(prop.name, 'compatible')
self.assertEquals(prop.value, 'test_tree1\0')
self.assertEquals(prop, 'test_tree1\0')
with self.assertRaises(FdtException) as e:
self.fdt.get_property_by_offset(-2)