mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Format using black
This commit is contained in:
parent
6a36d92380
commit
8fee46ec68
40 changed files with 975 additions and 610 deletions
|
@ -33,6 +33,7 @@ class ObjectContent(AstNode):
|
|||
def gir_class(self):
|
||||
return self.parent.gir_class
|
||||
|
||||
|
||||
class Object(AstNode):
|
||||
grammar: T.Any = [
|
||||
ConcreteClassName,
|
||||
|
@ -75,13 +76,17 @@ def validate_parent_type(node, ns: str, name: str, err_msg: str):
|
|||
parent = node.root.gir.get_type(name, ns)
|
||||
container_type = node.parent_by_type(Object).gir_class
|
||||
if container_type and not container_type.assignable_to(parent):
|
||||
raise CompileError(f"{container_type.full_name} is not a {parent.full_name}, so it doesn't have {err_msg}")
|
||||
raise CompileError(
|
||||
f"{container_type.full_name} is not a {parent.full_name}, so it doesn't have {err_msg}"
|
||||
)
|
||||
|
||||
|
||||
@decompiler("object")
|
||||
def decompile_object(ctx, gir, klass, id=None):
|
||||
gir_class = ctx.type_by_cname(klass)
|
||||
klass_name = decompile.full_name(gir_class) if gir_class is not None else "." + klass
|
||||
klass_name = (
|
||||
decompile.full_name(gir_class) if gir_class is not None else "." + klass
|
||||
)
|
||||
if id is None:
|
||||
ctx.print(f"{klass_name} {{")
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue