From e642335fd37bb1abd803dd6f199b950b62bcfb0b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 20 Jun 2016 17:32:29 +0100 Subject: [PATCH] working fixed point --- openlp/core/api/http/endpoint/__init__.py | 2 ++ openlp/core/api/http/endpoint/service.py | 8 +++++--- openlp/core/api/http/endpoint/templates/main.mako | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openlp/core/api/http/endpoint/__init__.py b/openlp/core/api/http/endpoint/__init__.py index 03025fafb..f3d0157ce 100644 --- a/openlp/core/api/http/endpoint/__init__.py +++ b/openlp/core/api/http/endpoint/__init__.py @@ -67,6 +67,8 @@ class Endpoint(object): raise Exception('No template directory specified') path = os.path.abspath(os.path.join(self.template_dir, filename)) print("path = ", path) + # if self.static_dir: + # kwargs['static_url'] = '/{prefix}/static'.format(prefix=self.url_prefix) return Template(filename=path, input_encoding='utf-8').render(**kwargs) diff --git a/openlp/core/api/http/endpoint/service.py b/openlp/core/api/http/endpoint/service.py index 60bb3794f..f1d192858 100644 --- a/openlp/core/api/http/endpoint/service.py +++ b/openlp/core/api/http/endpoint/service.py @@ -23,7 +23,7 @@ import logging import json from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http import register_endpoint +from openlp.core.api.http import register_endpoint, requires_auth from openlp.core.common import Registry @@ -33,20 +33,22 @@ service_endpoint = Endpoint('service') @service_endpoint.route('list') -def list(request): +def list_service(request): """ Handles requests for service items in the service manager + :param request: The http request object. """ return {'results': {'items': get_service_items()}} @service_endpoint.route('set') +@requires_auth def service_set(request): """ Handles requests for setting service items in the service manager - :param action: The action to perform. + :param request: The http request object. """ event = getattr(Registry().get('service_manager'), 'servicemanager_set_item') try: diff --git a/openlp/core/api/http/endpoint/templates/main.mako b/openlp/core/api/http/endpoint/templates/main.mako index bdd75f661..1b0d22437 100644 --- a/openlp/core/api/http/endpoint/templates/main.mako +++ b/openlp/core/api/http/endpoint/templates/main.mako @@ -21,7 +21,7 @@ ############################################################################### --> - s + ${live_title}