This commit is contained in:
Tim Bentley 2016-06-19 09:57:38 +01:00
parent 9e62366d2b
commit 549598e5be
4 changed files with 7 additions and 4 deletions

View File

@ -24,8 +24,10 @@ The Endpoint class, which provides plugins with a way to serve their own portion
""" """
import os import os
from functools import wraps
from mako.template import Template from mako.template import Template
from webob import Request, Response
class Endpoint(object): class Endpoint(object):
@ -69,6 +71,7 @@ class Endpoint(object):
print("path = ", path) print("path = ", path)
return Template(filename=path, input_encoding='utf-8').render(**kwargs) return Template(filename=path, input_encoding='utf-8').render(**kwargs)
from .controller import controller_endpoint from .controller import controller_endpoint
from .core import stage_endpoint from .core import stage_endpoint
from .service import service_endpoint from .service import service_endpoint

View File

@ -104,7 +104,7 @@ def controller_set(request):
data = int(json.loads(json_data)['request']['id']) data = int(json.loads(json_data)['request']['id'])
event.emit([data]) event.emit([data])
except KeyError: except KeyError:
log.error("Endpoint controller/live/set request id not found")s log.error("Endpoint controller/live/set request id not found")
return {'results': {'success': True}} return {'results': {'success': True}}
register_endpoint(controller_endpoint) register_endpoint(controller_endpoint)

View File

@ -19,7 +19,7 @@
window.OpenLP = { window.OpenLP = {
loadService: function (event) { loadService: function (event) {
$.getJSON( $.getJSON(
"/api/service/list", "/service/list",
function (data, status) { function (data, status) {
OpenLP.nextSong = ""; OpenLP.nextSong = "";
$("#notes").html(""); $("#notes").html("");
@ -39,7 +39,7 @@ window.OpenLP = {
}, },
loadSlides: function (event) { loadSlides: function (event) {
$.getJSON( $.getJSON(
"/api/controller/live/text", "/controller/live/text",
function (data, status) { function (data, status) {
OpenLP.currentSlides = data.results.slides; OpenLP.currentSlides = data.results.slides;
OpenLP.currentSlide = 0; OpenLP.currentSlide = 0;

View File

@ -143,7 +143,7 @@ class HttpRouter(RegistryProperties, OpenLPMixin):
""" """
auth_code = "{user}:{password}".format(user=Settings().value('remotes/user id'), auth_code = "{user}:{password}".format(user=Settings().value('remotes/user id'),
password=Settings().value('remotes/password')) password=Settings().value('remotes/password'))
self.openlppoll = Registry().get('api_poll') self.openlppoll = Registry().get('poller')
try: try:
self.auth = base64.b64encode(auth_code) self.auth = base64.b64encode(auth_code)
except TypeError: except TypeError: