Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/techui_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class JsonMap:
duplicate: bool = False
children: list["JsonMap"] = field(default_factory=list)
macros: dict[str, str] = field(default_factory=dict)
symbol: str = ""
error: str = ""


Expand Down Expand Up @@ -304,6 +305,7 @@ def _generate_json_map(
for widget_elem in widgets:
# Obtain macros associated with file_elem
macro_dict: dict[str, str] = {}
symbol_path: str = ""
widget_type = widget_elem.get("type", default=None)

match widget_type:
Expand All @@ -317,6 +319,12 @@ def _generate_json_map(
name_elem = widget_elem.name.text
macro_dict = self._get_macros(open_display)

if widget_type == "symbol":
try:
symbol_path = str(widget_elem.symbols.symbol)
except AttributeError:
pass

case "embedded":
file_elem = self._extract_action_button_file_from_embedded(
widget_elem.file, dest_path
Expand Down Expand Up @@ -363,6 +371,7 @@ def _generate_json_map(
)

child_node.macros = macro_dict
child_node.symbol = symbol_path
# TODO: make this work for only list[JsonMap]
assert isinstance(current_node.children, list)
# TODO: fix typing
Expand Down