WIP: Add gir.PartialClass

This commit is contained in:
James Westman 2022-07-19 20:25:46 -05:00
parent 632e9d7df6
commit 6fdb12fd5d
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
17 changed files with 231 additions and 147 deletions

View file

@ -42,7 +42,8 @@ class UI(AstNode, Scope):
self._gir_errors = []
try:
gir_ctx.add_namespace(self.children[GtkDirective][0].gir_namespace)
if ns := self.children[GtkDirective][0].gir_namespace:
gir_ctx.add_namespace(ns)
except CompileError as e:
self._gir_errors.append(e)
@ -70,7 +71,7 @@ class UI(AstNode, Scope):
xml.end_tag()
return {
id: ScopeVariable(id, obj.gir_class, lambda xml, id=id: emit_xml(xml, id), obj.glib_type_name)
id: ScopeVariable(id, obj.gir_class, lambda xml, id=id: emit_xml(xml, id))
for id, obj in self.objects_by_id.items()
}