Skip to content

Commit 186f82a

Browse files
authored
🐛 fix for parsing OCR response in CLI (#152)
1 parent 1c43880 commit 186f82a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

mindee/cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ def process_parse(args: Namespace, client: Client, doc_class) -> None:
136136
parsed_data = input_doc.parse(
137137
doc_class, include_words=args.include_words, page_options=page_options
138138
)
139-
display_doc(args.output_type, args.include_words, parsed_data)
139+
try:
140+
include_words = args.include_words
141+
except AttributeError:
142+
include_words = False
143+
display_doc(args.output_type, include_words, parsed_data)
140144

141145

142146
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:
154158
document_class=doc_class, queue_id=args.queue_id
155159
)
156160
if parsed_data.job.status == "completed" and parsed_data.document is not None:
157-
display_doc(args.output_type, args.include_words, parsed_data.document)
161+
try:
162+
include_words = args.include_words
163+
except AttributeError:
164+
include_words = False
165+
display_doc(args.output_type, include_words, parsed_data.document)
158166
else:
159167
print(parsed_data.job)
160168

0 commit comments

Comments
 (0)