Use AppLocation to figure out what directory the server is in

This commit is contained in:
Raoul Snyman 2016-11-26 00:01:15 +02:00
parent ad06ef5285
commit 34520d6dbe
1 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ import os
import time
from subprocess import Popen
from openlp.core.common import is_macosx, Registry, delete_file
from openlp.core.common import AppLocation, Registry, delete_file, is_macosx
if is_macosx() and os.path.exists('/Applications/LibreOffice.app'):
macuno_available = True
@ -66,7 +66,8 @@ class MacLOController(PresentationController):
Start a LibreOfficeServer
"""
libreoffice_python = '/Applications/LibreOffice.app/Contents/Resources/python'
libreoffice_server = os.path.join(os.path.dirname(__file__), 'libreofficeserver.py')
libreoffice_server = os.path.join(AppLocation.get_directory(AppLocation.PluginsDir),
'lib', 'libreofficeserver.py')
if os.path.exists(libreoffice_python):
self.server_process = Popen([libreoffice_python, libreoffice_server])