diff --git a/openlp/core/api/controller.py b/openlp/core/api/controller.py index 60b1ff4a3..ef0b72d30 100644 --- a/openlp/core/api/controller.py +++ b/openlp/core/api/controller.py @@ -21,7 +21,11 @@ ############################################################################### import logging +from openlp.core.api.http import register_endpoint from openlp.core.api.http.server import HttpServer +from openlp.core.api.http.endpoint.controller import controller_endpoint, api_controller_endpoint +from openlp.core.api.http.endpoint.core import stage_endpoint, blank_endpoint, main_endpoint +from openlp.core.api.http.endpoint.service import service_endpoint, api_service_endpoint from openlp.core.api.websockets import WebSocketServer from openlp.core.api.poll import Poller from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties @@ -40,6 +44,13 @@ class ApiController(RegistryMixin, OpenLPMixin, RegistryProperties): Constructor """ super(ApiController, self).__init__(parent) + register_endpoint(controller_endpoint) + register_endpoint(api_controller_endpoint) + register_endpoint(stage_endpoint) + register_endpoint(blank_endpoint) + register_endpoint(main_endpoint) + register_endpoint(service_endpoint) + register_endpoint(api_service_endpoint) def bootstrap_post_set_up(self): """ diff --git a/openlp/core/api/http/endpoint/__init__.py b/openlp/core/api/http/endpoint/__init__.py index 04631be78..038bd1d35 100644 --- a/openlp/core/api/http/endpoint/__init__.py +++ b/openlp/core/api/http/endpoint/__init__.py @@ -76,8 +76,4 @@ class Endpoint(object): kwargs['assets_url'] = '/assets' return Template(filename=path, input_encoding='utf-8').render(**kwargs) - -from .controller import controller_endpoint -from .core import stage_endpoint -from .service import service_endpoint from .pluginhelpers import search, live, service diff --git a/openlp/core/api/http/endpoint/controller.py b/openlp/core/api/http/endpoint/controller.py index 47503712d..d6b156aa9 100644 --- a/openlp/core/api/http/endpoint/controller.py +++ b/openlp/core/api/http/endpoint/controller.py @@ -26,7 +26,7 @@ import urllib.error import json from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http import register_endpoint, requires_auth +from openlp.core.api.http import requires_auth from openlp.core.common import Registry, AppLocation, Settings from openlp.core.lib import ItemCapabilities, create_thumb @@ -129,6 +129,3 @@ def controller_direction(request, controller, action): format(controller=controller, action=action)) event.emit() return {'results': {'success': True}} - -register_endpoint(controller_endpoint) -register_endpoint(api_controller_endpoint) diff --git a/openlp/core/api/http/endpoint/core.py b/openlp/core/api/http/endpoint/core.py index 9f38059a6..bfe8a0e54 100644 --- a/openlp/core/api/http/endpoint/core.py +++ b/openlp/core/api/http/endpoint/core.py @@ -167,7 +167,3 @@ def get_content_type(file_name): ext = os.path.splitext(file_name)[1] content_type = FILE_TYPES.get(ext, 'text/plain') return ext, content_type - -register_endpoint(stage_endpoint) -register_endpoint(blank_endpoint) -register_endpoint(main_endpoint) diff --git a/openlp/core/api/http/endpoint/service.py b/openlp/core/api/http/endpoint/service.py index c657f7062..f6029c341 100644 --- a/openlp/core/api/http/endpoint/service.py +++ b/openlp/core/api/http/endpoint/service.py @@ -98,6 +98,3 @@ def get_service_items(): 'selected': (service_item.unique_identifier == current_unique_identifier) }) return service_items - -register_endpoint(service_endpoint) -register_endpoint(api_service_endpoint)