From 5ac3afdc20da7e1e030d04c4729b27f2688277c4 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Mon, 21 Nov 2022 11:02:32 +0000 Subject: [PATCH] Remove unused handler --- src/textual/app.py | 24 ------------------------ src/textual/widgets/_list_view.py | 7 ------- 2 files changed, 31 deletions(-) diff --git a/src/textual/app.py b/src/textual/app.py index 69cad52b1..a005cfc22 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -305,8 +305,6 @@ class App(Generic[ReturnType], DOMNode): self.stylesheet = Stylesheet(variables=self.get_css_variables()) self._require_stylesheet_update: set[DOMNode] = set() - self._dom_lock = asyncio.Lock() - css_path = css_path or self.CSS_PATH if css_path is not None: # When value(s) are supplied for CSS_PATH, we normalise them to a list of Paths. @@ -1920,28 +1918,6 @@ class App(Generic[ReturnType], DOMNode): # prune event. return pruned_remove - async def _on_prune(self, event: events.Prune) -> None: - """Handle a prune event. - - Args: - event (events.Prune): The prune event. - """ - - async def prune(event: events.Prune): - async with self._dom_lock: - try: - # Prune all the widgets. - for widget in event.widgets: - await self._prune_node(widget) - finally: - # Finally, flag that we're done. - event.finished_flag.set() - - # Flag that the layout needs refreshing. - self.refresh(layout=True) - - asyncio.create_task(prune(event)) - def _walk_children(self, root: Widget) -> Iterable[list[Widget]]: """Walk children depth first, generating widgets and a list of their siblings. diff --git a/src/textual/widgets/_list_view.py b/src/textual/widgets/_list_view.py index 38082aa28..bcf326ccb 100644 --- a/src/textual/widgets/_list_view.py +++ b/src/textual/widgets/_list_view.py @@ -85,14 +85,7 @@ class ListView(Vertical, can_focus=True, can_focus_children=False): async def clear(self) -> None: """Clear all items from the ListView.""" - self.index = None - # await_removes = [] - await self.query("ListItem").remove() - # for child in self.children: - # await child.remove() - # await_removes.append(child.remove()) - # await asyncio.gather(*await_removes) await self.emit(self.ChildrenUpdated(self, self.children)) def action_select(self) -> None: