mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
lib.App: Stay functional without autocomplete
If Python's autocomplete is not installed, jw-pkg.py fails to run commands. Fix that in order stay compatible with minimal excecution environments. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
741a3b6db2
commit
53ba9e6fbe
1 changed files with 6 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import os, sys, argcomplete, argparse, re, asyncio, cProfile
|
import os, sys, argparse, re, asyncio, cProfile
|
||||||
|
|
||||||
from .log import *
|
from .log import *
|
||||||
from .Types import LoadTypes
|
from .Types import LoadTypes
|
||||||
|
|
@ -91,7 +91,11 @@ class App: # export
|
||||||
|
|
||||||
async def __run(self, argv=None) -> None:
|
async def __run(self, argv=None) -> None:
|
||||||
|
|
||||||
|
try:
|
||||||
|
import argcomplete # Don't require it to be compatible with minimal environments
|
||||||
argcomplete.autocomplete(self.__parser)
|
argcomplete.autocomplete(self.__parser)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
self.__args = self.__parser.parse_args(args=argv)
|
self.__args = self.__parser.parse_args(args=argv)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue