validation: Disallow instantiating abstract classes

This commit is contained in:
James Westman 2022-04-28 23:07:32 -05:00
parent f78478bea1
commit 99e428d93c
17 changed files with 35 additions and 13 deletions

View file

@ -236,6 +236,10 @@ class Class(GirNode, GirType):
self.own_properties = {child["name"]: Property(self, child) for child in xml.get_elements("property")}
self.own_signals = {child["name"]: Signal(self, child) for child in xml.get_elements("glib:signal")}
@property
def abstract(self):
return self.xml["abstract"] == "1"
@property
def signature(self):
result = f"class {self.container.name}.{self.name}"