Skip to content

Commit a453d38

Browse files
committed
bug de fou
1 parent 8ecc103 commit a453d38

File tree

6 files changed

+34
-9
lines changed

6 files changed

+34
-9
lines changed

API/utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ def restart_soffice() -> None:
3434
"""
3535

3636
clean_temp_files()
37-
subprocess.call(
38-
f'xvfb-run -s="-ac" libreoffice --accept="socket,host={cnx.host},port={cnx.port};urp;StarOffice.ServiceManager" &',
39-
shell=True
40-
)
4137
sleep(2)
4238
try:
4339
cnx.restart()

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ services:
1111
environment:
1212
- SECRET_KEY=$SECRET_KEY
1313
#command: "gunicorn -w 4 -b 0.0.0.0:8000 app:app"
14-
#command: "supervisord -c /etc/supervisord.conf"
15-
#command: "sleep 100000"
16-
command: bash -c "gunicorn -D -w 4 -b 0.0.0.0:8000 app:app;/app/docker/office.sh"
14+
#command: "supervisord -c /etc/supevisord/supervisord.conf"
15+
command: "sleep 100000"
16+
#command: bash -c "gunicorn -D -w 4 -b 0.0.0.0:8000 app:app;/app/docker/office.sh"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[program:lotemplate]
2+
command=/app/bin/gunicorn -w 4 -b 0.0.0.0:8000 app:app
3+
user = python
4+
autostart=true
5+
autorestart=false
6+
startsecs=200
7+
redirect_stderr=true
8+
stdout_logfile=/dev/stdout
9+
stdout_logfile_maxbytes=0
10+
11+

docker/conf/supervisor/office.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[program:office]
2+
command=/usr/bin/xvfb-run -a -s "-ac" libreoffice --display :99 --invisible --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"
3+
user = python
4+
autostart=true
5+
autorestart=false
6+
startsecs=20
7+
redirect_stderr=true
8+
stdout_logfile=/dev/stdout
9+
stdout_logfile_maxbytes=0
10+
11+

docker/office.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/bin/bash
2-
/usr/bin/xvfb-run -a -s "-ac" libreoffice --display :99 --nologo --norestore --invisible --accept='socket,host=localhost,port=2002;urp;StarOffice.ServiceManager'
2+
echo " libreoffice --display :99 --nologo --norestore --invisible --accept='socket,host=localhost,port=2002;urp;StarOffice.ServiceManager'" > /tmp/aa
3+
env >> /tmp/aa
4+
5+
libreoffice --display :99 --nologo --norestore --invisible --accept=\'socket,host=localhost,port=2002\;urp\;StarOffice.ServiceManager\'

lotemplate/classes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,11 @@ def text_fill(doc, variable: str, value: str) -> None:
347347
]
348348

349349
cursor = doc.CurrentController.ViewCursor
350-
350+
print(os.environ)
351+
oClip = self.cnx.ctx.getServiceManager().createInstanceWithContext("com.sun.star.datatransfer.clipboard.SystemClipboard", self.cnx.ctx)
352+
print("################")
353+
print(oClip.getContents())
354+
print(oClip.getContents())
351355
for var_occurrence in var_occurrences:
352356
cursor.gotoRange(var_occurrence, False)
353357
self.cnx.dispatcher.executeDispatch(

0 commit comments

Comments
 (0)