Skip to content
Merged
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: 5 additions & 4 deletions src/techui_builder/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def _allocate_widget(
self, screen_mapping: Mapping, component: Entity
) -> EmbeddedDisplay | ActionButton | None | list[EmbeddedDisplay | ActionButton]:
component_name, updated_macros = self._update_macros(component)
component.macros.update(updated_macros)

# Get relative path to screen
file = screen_mapping["file"]
Expand Down Expand Up @@ -211,7 +212,7 @@ def _allocate_widget(
if screen_mapping["suffixes"] is not None:
suffix_dict: dict[str, str] = screen_mapping["suffixes"]
for suffix_key, suffix in suffix_dict.items():
updated_macros[suffix_key] = suffix
component.macros[suffix_key] = suffix

# If no child label was specified...
if self.label_flag is False:
Expand All @@ -221,7 +222,7 @@ def _allocate_widget(
.removeprefix(":")
.removesuffix(":")
)
updated_macros["label"] = component_name
component.macros["label"] = component_name
except KeyError:
pass

Expand All @@ -236,7 +237,7 @@ def _allocate_widget(
height,
)
# Add macros to the widgets
for macro, macro_val in updated_macros.items():
for macro, macro_val in component.macros.items():
new_widget.macro(macro, macro_val)

# TODO: Change this to pvi_button
Expand All @@ -260,7 +261,7 @@ def _allocate_widget(
# Add action to action button: to open related display

new_widget.action_open_display(
file=str(support_screen_path), target="tab", macros=updated_macros
file=str(support_screen_path), target="tab", macros=component.macros
)

# For some reason the version of action buttons is 3.0.0?
Expand Down
Loading