mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
WIP: Add gir.PartialClass
This commit is contained in:
parent
632e9d7df6
commit
6fdb12fd5d
17 changed files with 231 additions and 147 deletions
|
@ -17,6 +17,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
from functools import cached_property
|
||||
|
||||
from .gobject_object import Object, ObjectContent
|
||||
from .common import *
|
||||
|
@ -34,11 +35,14 @@ class Template(Object):
|
|||
ObjectContent,
|
||||
]
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def gir_class(self):
|
||||
# Templates might not have a parent class defined
|
||||
parent = None
|
||||
if len(self.children[ClassName]):
|
||||
return self.children[ClassName][0].gir_type
|
||||
parent = self.children[ClassName][0].gir_type
|
||||
|
||||
return gir.PartialClass(self.tokens["id"], parent)
|
||||
|
||||
@validate("id")
|
||||
def unique_in_parent(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue