diff --git a/openlp/core/api/__init__.py b/openlp/core/api/__init__.py index c33b6dc74..909a739d1 100644 --- a/openlp/core/api/__init__.py +++ b/openlp/core/api/__init__.py @@ -49,9 +49,9 @@ def register_endpoint(end_point): from .endpoint import Endpoint from .apitab import ApiTab -from .poll import OpenLPPoll -from .wsserver import OpenLPWSServer -from .httpserver import OpenLPHttpServer +from .poll import Poll +from .wsserver import WsServer +from .httpserver import HttpServer from .apicontroller import ApiController -__all__ = ['OpenLPPoll', 'RemoteController', 'OpenLPHttpServer', 'application'] +__all__ = ['Poll', 'RemoteController', 'HttpServer', 'application'] diff --git a/openlp/core/api/apicontroller.py b/openlp/core/api/apicontroller.py index 4fcac8858..df846ca67 100644 --- a/openlp/core/api/apicontroller.py +++ b/openlp/core/api/apicontroller.py @@ -21,7 +21,7 @@ ############################################################################### import logging -from openlp.core.api import OpenLPWSServer, OpenLPPoll, OpenLPHttpServer +from openlp.core.api import WsServer, Poll, HttpServer from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties # These are here to load the endpoints @@ -48,7 +48,7 @@ class ApiController(RegistryMixin, OpenLPMixin, RegistryProperties): """ Register the poll return service and start the servers. """ - self.poll = OpenLPPoll() + self.poll = Poll() Registry().register('OpenLPPoll', self.poll) - self.wsserver = OpenLPWSServer() - self.httpserver = OpenLPHttpServer() + self.wsserver = WsServer() + self.httpserver = HttpServer() diff --git a/openlp/core/api/httpserver.py b/openlp/core/api/httpserver.py index 53482ac6d..4dcc550d3 100644 --- a/openlp/core/api/httpserver.py +++ b/openlp/core/api/httpserver.py @@ -58,7 +58,7 @@ class HttpThread(QtCore.QObject): pass -class OpenLPHttpServer(RegistryProperties, OpenLPMixin): +class HttpServer(RegistryProperties, OpenLPMixin): """ Wrapper round a server instance """ @@ -66,7 +66,7 @@ class OpenLPHttpServer(RegistryProperties, OpenLPMixin): """ Initialise the http server, and start the http server """ - super(OpenLPHttpServer, self).__init__() + super(HttpServer, self).__init__() self.thread = QtCore.QThread() self.worker = HttpThread() self.worker.moveToThread(self.thread) diff --git a/openlp/core/api/poll.py b/openlp/core/api/poll.py index 580d68f21..7a5834948 100644 --- a/openlp/core/api/poll.py +++ b/openlp/core/api/poll.py @@ -25,7 +25,7 @@ import json from openlp.core.common import RegistryProperties, Settings -class OpenLPPoll(RegistryProperties): +class Poll(RegistryProperties): """ Access by the web layer to get status type information from the application """ @@ -33,7 +33,7 @@ class OpenLPPoll(RegistryProperties): """ Constructor for the poll builder class. """ - super(OpenLPPoll, self).__init__() + super(Poll, self).__init__() def poll(self): """ diff --git a/openlp/core/api/wsserver.py b/openlp/core/api/wsserver.py index f12de7c19..108e68426 100644 --- a/openlp/core/api/wsserver.py +++ b/openlp/core/api/wsserver.py @@ -60,7 +60,7 @@ class WSThread(QtCore.QObject): self.ws_server.stop = True -class OpenLPWSServer(RegistryProperties, OpenLPMixin): +class WsServer(RegistryProperties, OpenLPMixin): """ Wrapper round a server instance """ @@ -68,7 +68,7 @@ class OpenLPWSServer(RegistryProperties, OpenLPMixin): """ Initialise the http server, and start the WebSockets server """ - super(OpenLPWSServer, self).__init__() + super(WsServer, self).__init__() self.settings_section = 'remotes' self.thread = QtCore.QThread() self.worker = WSThread(self) diff --git a/tests/functional/openlp_core_api/test_httpserver.py b/tests/functional/openlp_core_api/test_httpserver.py index 8ba8bd1b2..5cac46bac 100644 --- a/tests/functional/openlp_core_api/test_httpserver.py +++ b/tests/functional/openlp_core_api/test_httpserver.py @@ -25,7 +25,7 @@ Functional tests to test the Http Server Class. from unittest import TestCase -from openlp.core.api import OpenLPHttpServer +from openlp.core.api import HttpServer from tests.functional import patch @@ -42,7 +42,7 @@ class TestHttpServer(TestCase): """ # GIVEN: A new httpserver # WHEN: I start the server - server = OpenLPHttpServer() + server = HttpServer() # THEN: the api environment should have been created self.assertEquals(1, mock_qthread.call_count, 'The qthread should have been called once') diff --git a/tests/functional/openlp_core_api/test_poll.py b/tests/functional/openlp_core_api/test_poll.py index b606a2a5b..aee6486c2 100644 --- a/tests/functional/openlp_core_api/test_poll.py +++ b/tests/functional/openlp_core_api/test_poll.py @@ -26,7 +26,7 @@ import json from unittest import TestCase from openlp.core.common import Registry, Settings -from openlp.core.api.poll import OpenLPPoll +from openlp.core.api.poll import Poll from tests.functional import MagicMock from tests.helpers.testmixin import TestMixin @@ -52,7 +52,7 @@ class TestOpenLPPoll(TestCase, TestMixin): self.build_settings() Settings().extend_default_settings(__default_settings__) Registry().create() - self.poll = OpenLPPoll() + self.poll = Poll() def tearDown(self): """ diff --git a/tests/functional/openlp_core_api/test_wsserver.py b/tests/functional/openlp_core_api/test_wsserver.py index e3402cc8e..e40bd880d 100644 --- a/tests/functional/openlp_core_api/test_wsserver.py +++ b/tests/functional/openlp_core_api/test_wsserver.py @@ -25,7 +25,7 @@ Functional tests to test the Http Server Class. from unittest import TestCase -from openlp.core.api import OpenLPWSServer +from openlp.core.api import WsServer from tests.functional import patch @@ -42,7 +42,7 @@ class TestWSServer(TestCase): """ # GIVEN: A new httpserver # WHEN: I start the server - server = OpenLPWSServer() + server = WsServer() # THEN: the api environment should have been created self.assertEquals(1, mock_qthread.call_count, 'The qthread should have been called once') diff --git a/tests/functional/openlp_plugins/remotes/test_router.py b/tests/functional/openlp_plugins/remotes/test_router.py index 3fd72cf1f..c9d089632 100644 --- a/tests/functional/openlp_plugins/remotes/test_router.py +++ b/tests/functional/openlp_plugins/remotes/test_router.py @@ -26,7 +26,7 @@ import os import urllib.request from unittest import TestCase -from openlp.core.api.poll import OpenLPPoll +from openlp.core.api.poll import Poll from openlp.core.common import Settings, Registry from openlp.core.ui import ServiceManager from openlp.plugins.remotes.lib.httpserver import HttpRouter @@ -160,7 +160,7 @@ class TestRouter(TestCase, TestMixin): Registry.create() live_controller = MagicMock() Registry().register('live_controller', live_controller) - poll = OpenLPPoll() + poll = Poll() live_controller.slide_count = 2 # WHEN: main poll called