Pyolian: fixes for recent eolian changes

This commit is contained in:
Davide Andreoli 2018-11-28 21:39:51 +01:00
parent 433b561e27
commit ccb3e81046
2 changed files with 3 additions and 8 deletions

View File

@ -700,7 +700,7 @@ class Class(Object):
def do_class_recursive(cls):
if cls.parent:
L.append(cls.parent)
for other in cls.inherits:
for other in cls.extensions:
if other not in L:
L.append(other)
do_class_recursive(other)
@ -711,16 +711,12 @@ class Class(Object):
@cached_property
def hierarchy(self):
L = []
base = self.base_class
base = self.parent
while base:
L.append(base)
base = base.base_class
base = base.parent
return L
@cached_property
def base_class(self):
return self.parent
@cached_property
def ctor_enable(self):
return bool(lib.eolian_class_ctor_enable_get(self))

View File

@ -327,7 +327,6 @@ class TestEolianClass(unittest.TestCase):
self.assertIsNone(cls.eo_prefix) # TODO fin a class with a value
self.assertIsNone(cls.event_prefix) # TODO same as above
self.assertIsNone(cls.data_type) # TODO same as above
self.assertEqual(cls.base_class.name, 'Efl.Loop_Consumer')
self.assertEqual(cls.parent.name, 'Efl.Loop_Consumer')
self.assertEqual([c.name for c in cls.extensions], [])
self.assertEqual([c.name for c in cls.hierarchy], ['Efl.Loop_Consumer', 'Efl.Object'])