Skip to content

Commit

Permalink
bug de fou
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilus committed Apr 6, 2023
1 parent 8ecc103 commit a453d38
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
4 changes: 0 additions & 4 deletions API/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ def restart_soffice() -> None:
"""

clean_temp_files()
subprocess.call(
f'xvfb-run -s="-ac" libreoffice --accept="socket,host={cnx.host},port={cnx.port};urp;StarOffice.ServiceManager" &',
shell=True
)
sleep(2)
try:
cnx.restart()
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ services:
environment:
- SECRET_KEY=$SECRET_KEY
#command: "gunicorn -w 4 -b 0.0.0.0:8000 app:app"
#command: "supervisord -c /etc/supervisord.conf"
#command: "sleep 100000"
command: bash -c "gunicorn -D -w 4 -b 0.0.0.0:8000 app:app;/app/docker/office.sh"
#command: "supervisord -c /etc/supevisord/supervisord.conf"
command: "sleep 100000"
#command: bash -c "gunicorn -D -w 4 -b 0.0.0.0:8000 app:app;/app/docker/office.sh"
11 changes: 11 additions & 0 deletions docker/conf/supervisor/lotemplate.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[program:lotemplate]
command=/app/bin/gunicorn -w 4 -b 0.0.0.0:8000 app:app
user = python
autostart=true
autorestart=false
startsecs=200
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0


11 changes: 11 additions & 0 deletions docker/conf/supervisor/office.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[program:office]
command=/usr/bin/xvfb-run -a -s "-ac" libreoffice --display :99 --invisible --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"
user = python
autostart=true
autorestart=false
startsecs=20
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0


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

libreoffice --display :99 --nologo --norestore --invisible --accept=\'socket,host=localhost,port=2002\;urp\;StarOffice.ServiceManager\'
6 changes: 5 additions & 1 deletion lotemplate/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ def text_fill(doc, variable: str, value: str) -> None:
]

cursor = doc.CurrentController.ViewCursor

print(os.environ)
oClip = self.cnx.ctx.getServiceManager().createInstanceWithContext("com.sun.star.datatransfer.clipboard.SystemClipboard", self.cnx.ctx)
print("################")
print(oClip.getContents())
print(oClip.getContents())
for var_occurrence in var_occurrences:
cursor.gotoRange(var_occurrence, False)
self.cnx.dispatcher.executeDispatch(
Expand Down

0 comments on commit a453d38

Please sign in to comment.