fatally erro if pyfzf not installed
This commit is contained in:
parent
90f7dd2ac8
commit
8971a3915e
1 changed files with 6 additions and 1 deletions
|
@ -102,6 +102,7 @@ or `my.location.all` from other modules and get the filtered results, without
|
||||||
having to mix data filtering logic with parsing/loading/caching (the stuff HPI does)
|
having to mix data filtering logic with parsing/loading/caching (the stuff HPI does)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
import json
|
import json
|
||||||
import functools
|
import functools
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
@ -236,7 +237,11 @@ class DenyList:
|
||||||
yield key
|
yield key
|
||||||
|
|
||||||
def deny_cli(self, itr: Iterator[T]) -> None:
|
def deny_cli(self, itr: Iterator[T]) -> None:
|
||||||
|
try:
|
||||||
from pyfzf import FzfPrompt
|
from pyfzf import FzfPrompt
|
||||||
|
except ImportError:
|
||||||
|
click.echo("pyfzf is required to use the denylist cli, run 'python3 -m pip install pyfzf_iter'", err=True)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# wrap in seekable so we can use it multiple times
|
# wrap in seekable so we can use it multiple times
|
||||||
# progressively caches the items as we iterate over them
|
# progressively caches the items as we iterate over them
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue