mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
cleanup: Format using black
This commit is contained in:
parent
4b42016837
commit
af03c2ac0f
36 changed files with 928 additions and 616 deletions
|
@ -23,17 +23,17 @@ from .common import *
|
|||
|
||||
|
||||
class BaseAttribute(AstNode):
|
||||
""" A helper class for attribute syntax of the form `name: literal_value;`"""
|
||||
"""A helper class for attribute syntax of the form `name: literal_value;`"""
|
||||
|
||||
tag_name: str = ""
|
||||
attr_name: str = "name"
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
value = self.children[Value][0]
|
||||
attrs = { self.attr_name: self.tokens["name"] }
|
||||
attrs = {self.attr_name: self.tokens["name"]}
|
||||
|
||||
if isinstance(value, TranslatedStringValue):
|
||||
attrs = { **attrs, **value.attrs }
|
||||
attrs = {**attrs, **value.attrs}
|
||||
|
||||
xml.start_tag(self.tag_name, **attrs)
|
||||
value.emit_xml(xml)
|
||||
|
@ -41,5 +41,5 @@ class BaseAttribute(AstNode):
|
|||
|
||||
|
||||
class BaseTypedAttribute(BaseAttribute):
|
||||
""" A BaseAttribute whose parent has a value_type property that can assist
|
||||
in validation. """
|
||||
"""A BaseAttribute whose parent has a value_type property that can assist
|
||||
in validation."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue