Remove PropertyBinding rule, just use Binding

This commit is contained in:
James Westman 2023-05-22 21:26:07 -05:00
parent abc4e5de65
commit 0a4b5d07a1
16 changed files with 100 additions and 179 deletions

View file

@ -116,27 +116,21 @@ class XmlOutput(OutputFormat):
if simple := value.simple_binding:
props["bind-source"] = self._object_id(value, simple.source)
props["bind-property"] = simple.property_name
props["bind-flags"] = "sync-create"
flags = []
if not simple.no_sync_create:
flags.append("sync-create")
if simple.inverted:
flags.append("invert-boolean")
if simple.bidirectional:
flags.append("bidirectional")
props["bind-flags"] = "|".join(flags) or None
xml.put_self_closing("property", **props)
else:
xml.start_tag("binding", **props)
self._emit_expression(value.expression, xml)
xml.end_tag()
elif isinstance(value, PropertyBinding):
bind_flags = []
if not value.no_sync_create:
bind_flags.append("sync-create")
if value.inverted:
bind_flags.append("invert-boolean")
if value.bidirectional:
bind_flags.append("bidirectional")
props["bind-source"] = self._object_id(value, value.source)
props["bind-property"] = value.property_name
props["bind-flags"] = "|".join(bind_flags) or None
xml.put_self_closing("property", **props)
elif isinstance(value, ObjectValue):
xml.start_tag("property", **props)
self._emit_object(value.object, xml)