camelot-dev / excalibur

A web interface to extract tabular data from PDFs
https://excalibur-py.readthedocs.io
MIT License
1.55k stars 226 forks source link

Handle Excalibur Requirements like 'Ghostscript' Gracefully #111

Open arky opened 4 years ago

arky commented 4 years ago
At the moment, Excalibur fails with a console error if Ghostscript was not found on MS Windows OS (See complete log below). I would like propose a usability improvements. 1. User launches Excalibur 2. Excalibur checks the requirements (ie. ghostscript) 3. Prints a user friendly comment about missing requirements along with a download URL 4. Continues to start Excalibur 5. Display a Warning Dialog in Excalibur default UI about missing requirements and where to download them. I believe this improves the overall usability of the excalibur for both novice users and also those who will peek into logs and console errors. ```python PS E:\> .\excalibur-windows-latest-ia32.exe Creating new Excalibur configuration file in: C:\Users\a/excalibur/excalibur.cfg Traceback (most recent call last): File "arthur.py", line 5, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "c:\hostedtoolcache\windows\python\3.8.3\x86\lib\site-packages\PyInstaller\load 3, in exec_module File "excalibur\cli.py", line 10, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "c:\hostedtoolcache\windows\python\3.8.3\x86\lib\site-packages\PyInstaller\load 3, in exec_module File "excalibur\tasks.py", line 13, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "c:\hostedtoolcache\windows\python\3.8.3\x86\lib\site-packages\PyInstaller\load 3, in exec_module File "site-packages\camelot\ext\ghostscript\__init__.py", line 24, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "c:\hostedtoolcache\windows\python\3.8.3\x86\lib\site-packages\PyInstaller\load 3, in exec_module File "site-packages\camelot\ext\ghostscript\_gsprint.py", line 256, in RuntimeError: Please make sure that Ghostscript is installed [4376] Failed to execute script arthur```
vinayak-mehta commented 4 years ago

This is a great idea! I'll try to implement it when I get time. I also want work on https://github.com/camelot-dev/camelot/issues/13 and hope we don't need this enhancement on the excalibur UI for long.

arky commented 4 years ago

Thanks @vinayak-mehta Let's connect with this weekend so I can present the rationale behind the need for some of the changes and how we intended to use this tool with our partners across southeast asia.

I haven't looked at camelot-dev at all. Will try to familiarize myself with that codebase.

vinayak-mehta commented 4 years ago

I've sent you an email.