mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Remove the artificial slowdown
This commit is contained in:
@@ -251,19 +251,11 @@ class DirectoryTree(Tree[DirEntry]):
|
|||||||
Returns:
|
Returns:
|
||||||
An iterator of `Path` objects.
|
An iterator of `Path` objects.
|
||||||
"""
|
"""
|
||||||
# TODO: Not like this. Oh so very not like this. This is here to
|
|
||||||
# slow things down on purpose, to emulate loading directory
|
|
||||||
# information from a slow source.
|
|
||||||
#
|
|
||||||
# REMOVE BEFORE FLIGHT!
|
|
||||||
import time
|
|
||||||
|
|
||||||
worker = get_current_worker()
|
worker = get_current_worker()
|
||||||
for entry in directory.iterdir():
|
for entry in directory.iterdir():
|
||||||
if worker.is_cancelled:
|
if worker.is_cancelled:
|
||||||
return
|
return
|
||||||
yield entry
|
yield entry
|
||||||
time.sleep(0.05)
|
|
||||||
|
|
||||||
def _populate_node(
|
def _populate_node(
|
||||||
self, node: TreeNode[DirEntry], directory: Iterable[Path]
|
self, node: TreeNode[DirEntry], directory: Iterable[Path]
|
||||||
|
|||||||
Reference in New Issue
Block a user