From 69b18971a1a3d17743624f8c9a3ee658c76dce92 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 16 Dec 2021 21:18:32 +0000 Subject: [PATCH] Add a progress spinner to the find command --- pytoil/cli/find.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pytoil/cli/find.py b/pytoil/cli/find.py index 8423d725..519fe793 100644 --- a/pytoil/cli/find.py +++ b/pytoil/cli/find.py @@ -61,14 +61,16 @@ def find( api = API(username=config.username, token=config.token) - local_projects = utils.get_local_projects(path=config.projects_dir) - remote_projects = api.get_repo_names() + with msg.loading("Searching your projects..."): - all_projects = local_projects.union(remote_projects) + local_projects = utils.get_local_projects(path=config.projects_dir) + remote_projects = api.get_repo_names() - matches: List[Tuple[str, int]] = process.extractBests( - project, all_projects, limit=results, score_cutoff=FUZZY_SCORE_CUTOFF - ) + all_projects = local_projects.union(remote_projects) + + matches: List[Tuple[str, int]] = process.extractBests( + project, all_projects, limit=results, score_cutoff=FUZZY_SCORE_CUTOFF + ) table = Table(box=box.SIMPLE) table.add_column("Project", style="cyan", justify="center")