forked from openlp/openlp
move core endpoint definitions
This commit is contained in:
parent
e31f3b8603
commit
0da295f834
@ -21,7 +21,11 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from openlp.core.api.http import register_endpoint
|
||||||
from openlp.core.api.http.server import HttpServer
|
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.websockets import WebSocketServer
|
||||||
from openlp.core.api.poll import Poller
|
from openlp.core.api.poll import Poller
|
||||||
from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties
|
from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties
|
||||||
@ -40,6 +44,13 @@ class ApiController(RegistryMixin, OpenLPMixin, RegistryProperties):
|
|||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(ApiController, self).__init__(parent)
|
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):
|
def bootstrap_post_set_up(self):
|
||||||
"""
|
"""
|
||||||
|
@ -76,8 +76,4 @@ class Endpoint(object):
|
|||||||
kwargs['assets_url'] = '/assets'
|
kwargs['assets_url'] = '/assets'
|
||||||
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 .core import stage_endpoint
|
|
||||||
from .service import service_endpoint
|
|
||||||
from .pluginhelpers import search, live, service
|
from .pluginhelpers import search, live, service
|
||||||
|
@ -26,7 +26,7 @@ import urllib.error
|
|||||||
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, requires_auth
|
from openlp.core.api.http import requires_auth
|
||||||
from openlp.core.common import Registry, AppLocation, Settings
|
from openlp.core.common import Registry, AppLocation, Settings
|
||||||
from openlp.core.lib import ItemCapabilities, create_thumb
|
from openlp.core.lib import ItemCapabilities, create_thumb
|
||||||
|
|
||||||
@ -129,6 +129,3 @@ def controller_direction(request, controller, action):
|
|||||||
format(controller=controller, action=action))
|
format(controller=controller, action=action))
|
||||||
event.emit()
|
event.emit()
|
||||||
return {'results': {'success': True}}
|
return {'results': {'success': True}}
|
||||||
|
|
||||||
register_endpoint(controller_endpoint)
|
|
||||||
register_endpoint(api_controller_endpoint)
|
|
||||||
|
@ -167,7 +167,3 @@ def get_content_type(file_name):
|
|||||||
ext = os.path.splitext(file_name)[1]
|
ext = os.path.splitext(file_name)[1]
|
||||||
content_type = FILE_TYPES.get(ext, 'text/plain')
|
content_type = FILE_TYPES.get(ext, 'text/plain')
|
||||||
return ext, content_type
|
return ext, content_type
|
||||||
|
|
||||||
register_endpoint(stage_endpoint)
|
|
||||||
register_endpoint(blank_endpoint)
|
|
||||||
register_endpoint(main_endpoint)
|
|
||||||
|
@ -98,6 +98,3 @@ def get_service_items():
|
|||||||
'selected': (service_item.unique_identifier == current_unique_identifier)
|
'selected': (service_item.unique_identifier == current_unique_identifier)
|
||||||
})
|
})
|
||||||
return service_items
|
return service_items
|
||||||
|
|
||||||
register_endpoint(service_endpoint)
|
|
||||||
register_endpoint(api_service_endpoint)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user