mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
add variant support for menus
This commit is contained in:
parent
f894301571
commit
a75adc7d1b
4 changed files with 39 additions and 13 deletions
|
@ -85,13 +85,23 @@ class XmlOutput(OutputFormat):
|
|||
if isinstance(child, Menu):
|
||||
self._emit_menu(child, xml)
|
||||
elif isinstance(child, MenuAttribute):
|
||||
xml.start_tag(
|
||||
"attribute",
|
||||
name=child.name,
|
||||
**self._translated_string_attrs(child.value.child),
|
||||
)
|
||||
xml.put_text(child.value.string)
|
||||
xml.end_tag()
|
||||
if isinstance(child.value, StringValue):
|
||||
xml.start_tag(
|
||||
"attribute",
|
||||
name=child.name,
|
||||
**self._translated_string_attrs(child.value.child),
|
||||
)
|
||||
xml.put_text(child.value.string)
|
||||
xml.end_tag()
|
||||
elif isinstance(child.value, VariantValue):
|
||||
xml.start_tag(
|
||||
"attribute",
|
||||
name=child.name,
|
||||
type=child.value.var_type,
|
||||
)
|
||||
xml.put_text(child.value.var_value)
|
||||
xml.end_tag()
|
||||
|
||||
else:
|
||||
raise CompilerBugError()
|
||||
xml.end_tag()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue