mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Improved validation
This commit is contained in:
parent
981c2e3b7d
commit
f1e1811e1f
13 changed files with 51 additions and 13 deletions
|
@ -108,10 +108,7 @@ def _get_docs(gir, name):
|
|||
class A11y(AstNode):
|
||||
@validate("accessibility")
|
||||
def container_is_widget(self):
|
||||
widget = self.root.gir.get_type("Widget", "Gtk")
|
||||
container_type = self.parent_by_type(ast.Object).gir_class
|
||||
if container_type and not container_type.assignable_to(widget):
|
||||
raise CompileError(f"{container_type.full_name} is not a {widget.full_name}, so it doesn't have accessibility properties")
|
||||
self.validate_parent_type("Gtk", "Widget", "accessibility properties")
|
||||
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue