OCRmyPDF/misc/webservice.py

30 lines
612 B
Python
Raw Normal View History

#!/usr/bin/env python
# SPDX-FileCopyrightText: 2025 James R. Barlow
2022-07-28 01:06:46 -07:00
# SPDX-License-Identifier: AGPL-3.0-or-later
"""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
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
)