def get_dbobject_derived(typename, types): children = GObject.type_children(typename) for gtype in children: childname = GObject.type_name(gtype) get_dbobject_derived(childname, types) # FIXME, core should support some routines to check if type could have storage #if (GObject.type_is_a(gtype, GObject.type_from_name("MidgardBaseInterface")) if (gtype.is_abstract() or childname == "MidgardMetadata"): continue types.append(childname)
def getDBObjectDerived(self, typename, types): children = GObject.type_children(typename) for gtype in children: childname = GObject.type_name(gtype) self.getDBObjectDerived(childname, types) # FIXME, core should support some routines to check if type could have storage if (GObject.type_is_a( gtype, GObject.type_from_name("MidgardBaseInterface")) or gtype.is_abstract() or childname == "MidgardMetadata"): continue types.append(childname)
def test_type_children(self): self.assertEqual(GObject.type_children(CustomBase), [CustomChild.__gtype__]) self.assertEqual(len(GObject.type_children(CustomChild)), 0)