Bug#1082775: /usr/lib/libreoffice/program/officehelper.py:94: SyntaxWarning: invalid escape sequence '\P'
severity 1082775 minor
thanks
Hi,
Am 26.09.24 um 05:00 schrieb Josh Triplett:
Setting up python3-uno (4:24.8.1-2) ...
/usr/lib/libreoffice/program/officehelper.py:94: SyntaxWarning: invalid escape sequence '\P'
"""Bootstrap PyUNO Runtime.
This is minor for sure, only...
Caused by the comment in iii here:
def bootstrap(soffice=None, delays=(1, 3, 5, 7), report=lambda *args: None):
# 4 connection attempts; sleeping 1, 3, 5 and 7 seconds
# no report to console
"""Bootstrap PyUNO Runtime.
The soffice process is started opening a named pipe of random name,
then the local context is used to access the pipe. This function
directly returns the remote component context, from whereon you can
get the ServiceManager by calling getServiceManager() on the
returned object.
Examples:
i. Start LO as a service, get its remote component context
import officehelper
ctx = officehelper.bootstrap()
# your code goes here
ii. Wait longer for LO to start, request context multiples times
+ Report processing in console
import officehelper as oh
ctx = oh.bootstrap(delays=(5,10,15,20),report=print) # wait 5, 10, 15 and 20 sec.
# your code goes here
iii. Use a specific LibreOffice copy
from officehelper import bootstrap
ctx = bootstrap(soffice=r"USB:\PortableApps\libO-7.6\App\libreoffice\program\soffice.exe") <-----
# your code goes here
"""
Since upstream doesn't do py3compile (they don't even ship in a public place). I guess noone noticed...
I could patch it to have a Linux path, though :-)
Regards,
Ren
Reply to: