working fixed point

This commit is contained in:
Tim Bentley 2016-06-20 17:32:29 +01:00
parent f92701ff98
commit e642335fd3
3 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -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:

View File

@ -21,7 +21,7 @@
###############################################################################
-->
<head>
<meta charset="utf-8" />s
<meta charset="utf-8" />
<title>${live_title}</title>
<link rel="stylesheet" href="/static/css/main.css" />
<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.ico">