2025-01-04 12:09:32 -08:00
|
|
|
#!/usr/bin/env python
|
2025-01-04 01:04:58 -08:00
|
|
|
# SPDX-FileCopyrightText: 2025 James R. Barlow
|
2022-07-28 01:06:46 -07:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-12-14 23:05:54 -08:00
|
|
|
|
2025-01-04 01:04:58 -08:00
|
|
|
"""Run the OCRmyPDF web service."""
|
2022-07-23 00:39:24 -07:00
|
|
|
|
2019-07-27 04:51:52 -07:00
|
|
|
import os
|
2025-01-01 17:26:22 -08:00
|
|
|
import sys
|
|
|
|
|
2025-01-04 01:04:58 -08:00
|
|
|
try:
|
|
|
|
import streamlit # noqa: F401
|
|
|
|
except ImportError:
|
|
|
|
raise ImportError(
|
|
|
|
'You need to install streamlit in the Python environment '
|
|
|
|
'to run the web service.\n'
|
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
os.execvp(
|
|
|
|
sys.executable,
|
|
|
|
[
|
|
|
|
sys.executable,
|
|
|
|
'-m',
|
|
|
|
'streamlit',
|
|
|
|
'run',
|
|
|
|
'misc/_webservice.py',
|
|
|
|
*sys.argv[1:],
|
|
|
|
],
|
2025-01-01 17:26:22 -08:00
|
|
|
)
|