lib.App: Ignore missing argcomplete
Accept if argcomplete is missing. The package would be nice to have, i.e. a good candidate for a "recommends" section, but until there's support for that, better be able to do without.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f1456f1d46
commit
920e950eed
1 changed files with 2 additions and 2 deletions
|
|
@ -176,14 +176,14 @@ class App: # export
|
||||||
try:
|
try:
|
||||||
# Import argcomplete only here to not require it to be compatible
|
# Import argcomplete only here to not require it to be compatible
|
||||||
# with minimal environments
|
# with minimal environments
|
||||||
from argcomplete.completers import BaseCompleter
|
from argcomplete.completers import BaseCompleter # type: ignore[import-not-found]
|
||||||
|
|
||||||
class NoopCompleter(BaseCompleter):
|
class NoopCompleter(BaseCompleter):
|
||||||
|
|
||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
import argcomplete
|
import argcomplete # type: ignore[import-not-found]
|
||||||
|
|
||||||
argcomplete.autocomplete(self.__parser, default_completer = NoopCompleter())
|
argcomplete.autocomplete(self.__parser, default_completer = NoopCompleter())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue