From dabb8374816b925c0c42f7b2a756f4bb12bcf534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ianar=C3=A9=20S=C3=A9vi?= Date: Mon, 3 Jul 2023 16:57:30 +0200 Subject: [PATCH] :bug: fix for parsing OCR response in CLI --- mindee/cli.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mindee/cli.py b/mindee/cli.py index db092a75..46c383b9 100644 --- a/mindee/cli.py +++ b/mindee/cli.py @@ -136,7 +136,11 @@ def process_parse(args: Namespace, client: Client, doc_class) -> None: parsed_data = input_doc.parse( doc_class, include_words=args.include_words, page_options=page_options ) - display_doc(args.output_type, args.include_words, parsed_data) + try: + include_words = args.include_words + except AttributeError: + include_words = False + display_doc(args.output_type, include_words, parsed_data) def process_parse_queued(args: Namespace, client: Client, doc_class) -> None: @@ -154,7 +158,11 @@ def process_parse_queued(args: Namespace, client: Client, doc_class) -> None: document_class=doc_class, queue_id=args.queue_id ) if parsed_data.job.status == "completed" and parsed_data.document is not None: - display_doc(args.output_type, args.include_words, parsed_data.document) + try: + include_words = args.include_words + except AttributeError: + include_words = False + display_doc(args.output_type, include_words, parsed_data.document) else: print(parsed_data.job)