From f43f9cda2fae0efffc3cba6d669690a3b377ea45 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Fri, 15 Mar 2024 20:41:01 -0500 Subject: [PATCH] Catch RuntimeError when GS not installed --- read_datasheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read_datasheet.py b/read_datasheet.py index a0dbc37..8080f76 100755 --- a/read_datasheet.py +++ b/read_datasheet.py @@ -60,7 +60,7 @@ def parse(filename, output_dir, partnum, dstype): tables = camelot.read_pdf(filename, pages="1-end", flavor='lattice', backend="ghostscript", split_text=False, line_scale=100, process_background=True, resolution=600, interations=1, layout_kwargs={'detect_vertical': False, 'char_margin': 0.5}, shift_text=['r', 't']) elif dstype == "Alphawire": tables = camelot.read_pdf(filename, pages="1-end", flavor='lattice', backend="ghostscript", split_text=False, line_scale=50, process_background=True, resolution=600, interations=1, layout_kwargs={'detect_vertical': True, 'char_margin': 0.5}, shift_text=['l', 't']) - except OSError as e: + except (OSError, RuntimeError) as e: print(e) if win32: print("Ghostscript is not installed! Launching installer...")