diff --git a/openlp/plugins/presentations/lib/libreofficeserver.py b/openlp/plugins/presentations/lib/libreofficeserver.py index bb5b5217f..cbda271c6 100644 --- a/openlp/plugins/presentations/lib/libreofficeserver.py +++ b/openlp/plugins/presentations/lib/libreofficeserver.py @@ -19,7 +19,7 @@ # along with this program. If not, see . # ########################################################################## """ -This module runs a Pyro4 server using LibreOffice's version of Python +This module runs a Pyro5 server using LibreOffice's version of Python Please Note: This intentionally uses os.path over pathlib because we don't know which version of Python is shipped with the version of LibreOffice on the user's computer. @@ -40,11 +40,11 @@ if sys.platform.startswith('darwin') and 'pytest' not in sys.argv[0]: # Add the current directory to sys.path so that we can load the serializers sys.path.append(os.path.join(os.path.dirname(__file__))) -# Add the vendor directory to sys.path so that we can load Pyro4 +# Add the vendor directory to sys.path so that we can load Pyro5 sys.path.append(os.path.join(os.path.dirname(__file__), 'vendor')) from serializers import register_classes -from Pyro4 import Daemon, expose +from Pyro5.api import Daemon, expose try: # Wrap these imports in a try so that we can run the tests on macOS @@ -81,7 +81,7 @@ class LibreOfficeException(Exception): @expose class LibreOfficeServer(object): """ - A Pyro4 server which controls LibreOffice + A Pyro5 server which controls LibreOffice """ def __init__(self): """ diff --git a/openlp/plugins/presentations/lib/maclocontroller.py b/openlp/plugins/presentations/lib/maclocontroller.py index 4bff9f208..ca0e754b7 100644 --- a/openlp/plugins/presentations/lib/maclocontroller.py +++ b/openlp/plugins/presentations/lib/maclocontroller.py @@ -36,7 +36,7 @@ LIBREOFFICE_PATH = Path('/Applications/LibreOffice.app') LIBREOFFICE_PYTHON = LIBREOFFICE_PATH / 'Contents' / 'Resources' / 'python' try: - from Pyro4 import Proxy + from Pyro5.client import Proxy if is_macosx() and LIBREOFFICE_PATH.exists(): macuno_available = True else: @@ -46,7 +46,7 @@ except ImportError: if macuno_available: - # If this controller is good to go, register the serializer classes with Pyro4 + # If this controller is good to go, register the serializer classes with Pyro5 from openlp.plugins.presentations.lib.serializers import register_classes register_classes() @@ -56,8 +56,8 @@ log = logging.getLogger(__name__) class MacLOController(PresentationController, LogMixin): """ - Class to control interactions with MacLO presentations on Mac OS X via Pyro4. It starts the Pyro4 nameserver, - starts the LibreOfficeServer, and then controls MacLO via Pyro4. + Class to control interactions with MacLO presentations on Mac OS X via Pyro5. It starts the Pyro5 nameserver, + starts the LibreOfficeServer, and then controls MacLO via Pyro5. """ log.info('MacLOController loaded') @@ -86,7 +86,7 @@ class MacLOController(PresentationController, LogMixin): @property def client(self): """ - Set up a Pyro4 client so that we can talk to the LibreOfficeServer + Set up a Pyro5 client so that we can talk to the LibreOfficeServer """ if not self._client: self._client = Proxy('PYRO:openlp.libreofficeserver@localhost:4310') diff --git a/openlp/plugins/presentations/lib/serializers.py b/openlp/plugins/presentations/lib/serializers.py index 4a5b0ac75..d262b2142 100644 --- a/openlp/plugins/presentations/lib/serializers.py +++ b/openlp/plugins/presentations/lib/serializers.py @@ -19,16 +19,16 @@ # along with this program. If not, see . # ########################################################################## """ -This module contains some helpers for serializing Path objects in Pyro4 +This module contains some helpers for serializing Path objects in Pyro5 """ from pathlib import Path -from Pyro4.util import SerializerBase +from Pyro5.api import SerializerBase def path_class_to_dict(obj): """ - Serialize a Path object for Pyro4 + Serialize a Path object for Pyro5 """ return { '__class__': 'Path', diff --git a/scripts/check_dependencies.py b/scripts/check_dependencies.py index f9f413b7e..fbcb59dc4 100755 --- a/scripts/check_dependencies.py +++ b/scripts/check_dependencies.py @@ -63,7 +63,7 @@ LINUX_MODULES = [ MACOSX_MODULES = [ 'objc', - 'Pyro4', + 'Pyro5', 'AppKit' ] diff --git a/setup.py b/setup.py index de38920e9..ec2fc6d62 100644 --- a/setup.py +++ b/setup.py @@ -113,7 +113,7 @@ using a computer and a display/projector.""", 'pyobjc-framework-Cocoa; platform_system=="Darwin"', 'PyQt5 >= 5.12', 'PyQtWebEngine', - 'Pyro4; platform_system=="Darwin"', + 'Pyro5; platform_system=="Darwin"', 'pywin32; platform_system=="Windows"', 'QtAwesome', "qrcode", diff --git a/tests/openlp_plugins/presentations/lib/test_serializers.py b/tests/openlp_plugins/presentations/lib/test_serializers.py index 28034b0b4..9bb11f47b 100644 --- a/tests/openlp_plugins/presentations/lib/test_serializers.py +++ b/tests/openlp_plugins/presentations/lib/test_serializers.py @@ -25,11 +25,11 @@ from pathlib import Path from unittest.mock import patch try: - import Pyro4 # noqa + import Pyro5 # noqa from openlp.plugins.presentations.lib.serializers import path_class_to_dict, path_dict_to_class, register_classes except ImportError: import pytest - pytestmark = pytest.mark.skip('Pyro4 not installed') + pytestmark = pytest.mark.skip('Pyro5 not installed') def test_path_class_to_dict(): diff --git a/tests/openlp_plugins/presentations/test_libreofficeserver.py b/tests/openlp_plugins/presentations/test_libreofficeserver.py index 50e7f7a89..0cb733fef 100644 --- a/tests/openlp_plugins/presentations/test_libreofficeserver.py +++ b/tests/openlp_plugins/presentations/test_libreofficeserver.py @@ -28,17 +28,17 @@ import pytest from openlp.core.common.platform import is_macosx try: - import Pyro4 # noqa: F401 - has_pyro4 = True + import Pyro5 # noqa: F401 + has_pyro5 = True except ImportError: - has_pyro4 = False + has_pyro5 = False -if has_pyro4: +if has_pyro5: from openlp.plugins.presentations.lib.libreofficeserver import LibreOfficeServer, TextType, main pytestmark = [ - pytest.mark.skipif(not has_pyro4, reason='Pyro4 is not installed, skipping testing the LibreOffice server'), + pytest.mark.skipif(not has_pyro5, reason='Pyro5 is not installed, skipping testing the LibreOffice server'), pytest.mark.skipif(not is_macosx(), reason='Not on macOS, skipping testing the LibreOffice server') ] diff --git a/tests/openlp_plugins/presentations/test_maclocontroller.py b/tests/openlp_plugins/presentations/test_maclocontroller.py index d509d52ab..e54f20893 100644 --- a/tests/openlp_plugins/presentations/test_maclocontroller.py +++ b/tests/openlp_plugins/presentations/test_maclocontroller.py @@ -38,13 +38,13 @@ from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH try: - import Pyro4 # noqa: F401 - has_pyro4 = True + import Pyro5 # noqa: F401 + has_pyro5 = True except ImportError: - has_pyro4 = False + has_pyro5 = False pytestmark = [ - pytest.mark.skipif(not has_pyro4, reason='Pyro4 is not installed, skipping testing the Mac LibreOffice controller'), + pytest.mark.skipif(not has_pyro5, reason='Pyro5 is not installed, skipping testing the Mac LibreOffice controller'), pytest.mark.skipif(not is_macosx(), reason='Not on macOS, skipping testing the Mac LibreOffice controller') ]