forked from openlp/openlp
working fixed point
This commit is contained in:
parent
f92701ff98
commit
e642335fd3
|
@ -67,6 +67,8 @@ class Endpoint(object):
|
||||||
raise Exception('No template directory specified')
|
raise Exception('No template directory specified')
|
||||||
path = os.path.abspath(os.path.join(self.template_dir, filename))
|
path = os.path.abspath(os.path.join(self.template_dir, filename))
|
||||||
print("path = ", path)
|
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)
|
return Template(filename=path, input_encoding='utf-8').render(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import logging
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from openlp.core.api.http.endpoint import Endpoint
|
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
|
from openlp.core.common import Registry
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,20 +33,22 @@ service_endpoint = Endpoint('service')
|
||||||
|
|
||||||
|
|
||||||
@service_endpoint.route('list')
|
@service_endpoint.route('list')
|
||||||
def list(request):
|
def list_service(request):
|
||||||
"""
|
"""
|
||||||
Handles requests for service items in the service manager
|
Handles requests for service items in the service manager
|
||||||
|
|
||||||
|
:param request: The http request object.
|
||||||
"""
|
"""
|
||||||
return {'results': {'items': get_service_items()}}
|
return {'results': {'items': get_service_items()}}
|
||||||
|
|
||||||
|
|
||||||
@service_endpoint.route('set')
|
@service_endpoint.route('set')
|
||||||
|
@requires_auth
|
||||||
def service_set(request):
|
def service_set(request):
|
||||||
"""
|
"""
|
||||||
Handles requests for setting service items in the service manager
|
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')
|
event = getattr(Registry().get('service_manager'), 'servicemanager_set_item')
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
-->
|
-->
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />s
|
<meta charset="utf-8" />
|
||||||
<title>${live_title}</title>
|
<title>${live_title}</title>
|
||||||
<link rel="stylesheet" href="/static/css/main.css" />
|
<link rel="stylesheet" href="/static/css/main.css" />
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.ico">
|
<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.ico">
|
||||||
|
|
Loading…
Reference in New Issue