mirror of
https://github.com/romanz/amodem.git
synced 2026-04-20 21:26:39 +08:00
CLI: handle missing argcomplete package
This commit is contained in:
@@ -10,7 +10,10 @@ else:
|
|||||||
_stdout = sys.stdout.buffer
|
_stdout = sys.stdout.buffer
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import argcomplete
|
try:
|
||||||
|
import argcomplete
|
||||||
|
except ImportError:
|
||||||
|
argcomplete = None
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@@ -109,7 +112,8 @@ def main():
|
|||||||
output_type=FileType('wb')
|
output_type=FileType('wb')
|
||||||
)
|
)
|
||||||
|
|
||||||
argcomplete.autocomplete(p)
|
if argcomplete:
|
||||||
|
argcomplete.autocomplete(p)
|
||||||
args = p.parse_args()
|
args = p.parse_args()
|
||||||
if args.verbose == 0:
|
if args.verbose == 0:
|
||||||
level, format = 'INFO', '%(message)s'
|
level, format = 'INFO', '%(message)s'
|
||||||
|
|||||||
Reference in New Issue
Block a user