44import subprocess
55import time
66from threading import Event , Thread
7- from typing import Any
7+ from typing import Any , cast
88
99import psutil
1010from fastapi import FastAPI
@@ -30,19 +30,23 @@ def start_office_server(port_num: str) -> dict[str, Any]:
3030 uno_port = str (int (port_num ) + 1000 ) # e.g. XML-RPC 9900, UNO 10900
3131 user_installation = f"{ settings .TMP_FILE_DIR } /lo_profile_{ port_num } "
3232
33+ lo_python = cast (str , settings .LIBRE_OFFICE_PYTHON_PATH )
34+ lo_exec = cast (str , settings .LIBRE_OFFICE_EXEC_PATH )
35+
3336 loffice_process : dict [str , Any ] = {
3437 "process" : subprocess .Popen (
3538 args = [
36- settings . LIBRE_OFFICE_PYTHON_PATH ,
39+ lo_python ,
3740 "-m" ,
3841 "unoserver.server" ,
3942 "--interface" , settings .LIBRE_OFFICE_NETWORK_INTERFACE ,
4043 "--uno-interface" , settings .LIBRE_OFFICE_NETWORK_INTERFACE ,
41- "--executable" , settings . LIBRE_OFFICE_EXEC_PATH ,
44+ "--executable" , lo_exec ,
4245 "--port" , port_num ,
4346 "--uno-port" , uno_port ,
44- "--user-installation" , user_installation
45- ],
47+ "--user-installation" , user_installation ,
48+ # "--logfile", f"loffice_{port_num}.log"
49+ ], # type: ignore
4650 cwd = settings .TMP_FILE_DIR ,
4751 close_fds = True ,
4852 shell = False
0 commit comments