From 8de5108af60a4b4fc45db3892ea4386ba51a28a4 Mon Sep 17 00:00:00 2001 From: ines Date: Sun, 19 Mar 2017 01:43:19 +0100 Subject: [PATCH] Exclude common cache directories from mode list in cli.info This means models called "cache" etc. won't show up in the list, but it seems worth it. --- spacy/cli/info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spacy/cli/info.py b/spacy/cli/info.py index 384df1265..878f3ed5f 100644 --- a/spacy/cli/info.py +++ b/spacy/cli/info.py @@ -45,5 +45,9 @@ def get_spacy_data(): def list_models(): + # exclude common cache directories – this means models called "cache" etc. + # won't show up in list, but it seems worth it + exclude = ['cache', 'pycache', '__pycache__'] data_path = util.get_data_path() - return [f.parts[-1] for f in data_path.iterdir() if f.is_dir()] + models = [f.parts[-1] for f in data_path.iterdir() if f.is_dir()] + return [m for m in models if m not in exclude]