Skip to content

Commit

Permalink
refactor: rename get_value to render
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Oct 5, 2024
1 parent d8efebd commit 03ca06b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dooit/ui/widgets/bars/status_bar/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def render(self) -> RenderableType:
table = Table.grid(expand=expand, padding=0)

for widget in self.bar_widgets:
value = widget.get_value()
value = widget.render()
if widget.width is None:
table.add_column(width=len(value))
elif width := widget.width:
table.add_column(width=width)
else:
table.add_column(ratio=1)

values = [widget.get_value() for widget in self.bar_widgets]
values = [widget.render() for widget in self.bar_widgets]
table.add_row(*values)

return table
2 changes: 1 addition & 1 deletion dooit/ui/widgets/bars/status_bar/bar_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ def calculate(self, api: "DooitAPI", event: DooitEvent) -> TextType:
self.value = self.func(api, event)
return self.value

def get_value(self):
def render(self) -> TextType:
return self.value

0 comments on commit 03ca06b

Please sign in to comment.