mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Use the new duplicate validator for templates
This commit is contained in:
parent
22edcf0c67
commit
d319cb11c1
2 changed files with 4 additions and 10 deletions
|
@ -37,6 +37,10 @@ class Template(Object):
|
|||
def not_abstract(self):
|
||||
pass # does not apply to templates
|
||||
|
||||
@validate("name")
|
||||
def unique_in_parent(self):
|
||||
self.validate_unique_in_parent(f"Only one template may be defined per file, but this file contains {len(self.parent.children[Template])}",)
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
xml.start_tag(
|
||||
"template",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue