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.
This commit is contained in:
ines 2017-03-19 01:43:19 +01:00
parent d17072cbd5
commit 8de5108af6

View File

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