Remove unused handler

This commit is contained in:
Darren Burns
2022-11-21 11:02:32 +00:00
parent cc0a5e30a0
commit 5ac3afdc20
2 changed files with 0 additions and 31 deletions

View File

@@ -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.

View File

@@ -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: