exit action

This commit is contained in:
Will McGugan
2022-06-17 14:08:17 +01:00
parent b0079fce56
commit a5d46d6adc
2 changed files with 7 additions and 2 deletions

View File

@@ -176,4 +176,5 @@ if __name__ == "__main__":
print(Scalar.resolve_dimension.cache_info())
from rich.style import Style
print(Style.__add__.cache_info())
print(Style._add_cache)

View File

@@ -22,6 +22,7 @@ class TableApp(App):
def on_mount(self):
self.bind("d", "toggle_dark")
self.bind("z", "toggle_zebra")
self.bind("x", "exit")
def action_toggle_dark(self) -> None:
self.app.dark = not self.app.dark
@@ -29,7 +30,10 @@ class TableApp(App):
def action_toggle_zebra(self) -> None:
self.table.zebra_stripes = not self.table.zebra_stripes
def action_exit(self) -> None:
from rich.style import Style
self.exit(Style._add_cache.cache_info())
app = TableApp()
if __name__ == "__main__":
app.run()
print(app.run())