Rename Classes

This commit is contained in:
Tim Bentley 2016-06-14 21:12:04 +01:00
parent 4a76b3d26d
commit 7d049eb2af
9 changed files with 22 additions and 22 deletions

View File

@ -49,9 +49,9 @@ def register_endpoint(end_point):
from .endpoint import Endpoint
from .apitab import ApiTab
from .poll import OpenLPPoll
from .wsserver import OpenLPWSServer
from .httpserver import OpenLPHttpServer
from .poll import Poll
from .wsserver import WsServer
from .httpserver import HttpServer
from .apicontroller import ApiController
__all__ = ['OpenLPPoll', 'RemoteController', 'OpenLPHttpServer', 'application']
__all__ = ['Poll', 'RemoteController', 'HttpServer', 'application']

View File

@ -21,7 +21,7 @@
###############################################################################
import logging
from openlp.core.api import OpenLPWSServer, OpenLPPoll, OpenLPHttpServer
from openlp.core.api import WsServer, Poll, HttpServer
from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties
# These are here to load the endpoints
@ -48,7 +48,7 @@ class ApiController(RegistryMixin, OpenLPMixin, RegistryProperties):
"""
Register the poll return service and start the servers.
"""
self.poll = OpenLPPoll()
self.poll = Poll()
Registry().register('OpenLPPoll', self.poll)
self.wsserver = OpenLPWSServer()
self.httpserver = OpenLPHttpServer()
self.wsserver = WsServer()
self.httpserver = HttpServer()

View File

@ -58,7 +58,7 @@ class HttpThread(QtCore.QObject):
pass
class OpenLPHttpServer(RegistryProperties, OpenLPMixin):
class HttpServer(RegistryProperties, OpenLPMixin):
"""
Wrapper round a server instance
"""
@ -66,7 +66,7 @@ class OpenLPHttpServer(RegistryProperties, OpenLPMixin):
"""
Initialise the http server, and start the http server
"""
super(OpenLPHttpServer, self).__init__()
super(HttpServer, self).__init__()
self.thread = QtCore.QThread()
self.worker = HttpThread()
self.worker.moveToThread(self.thread)

View File

@ -25,7 +25,7 @@ import json
from openlp.core.common import RegistryProperties, Settings
class OpenLPPoll(RegistryProperties):
class Poll(RegistryProperties):
"""
Access by the web layer to get status type information from the application
"""
@ -33,7 +33,7 @@ class OpenLPPoll(RegistryProperties):
"""
Constructor for the poll builder class.
"""
super(OpenLPPoll, self).__init__()
super(Poll, self).__init__()
def poll(self):
"""

View File

@ -60,7 +60,7 @@ class WSThread(QtCore.QObject):
self.ws_server.stop = True
class OpenLPWSServer(RegistryProperties, OpenLPMixin):
class WsServer(RegistryProperties, OpenLPMixin):
"""
Wrapper round a server instance
"""
@ -68,7 +68,7 @@ class OpenLPWSServer(RegistryProperties, OpenLPMixin):
"""
Initialise the http server, and start the WebSockets server
"""
super(OpenLPWSServer, self).__init__()
super(WsServer, self).__init__()
self.settings_section = 'remotes'
self.thread = QtCore.QThread()
self.worker = WSThread(self)

View File

@ -25,7 +25,7 @@ Functional tests to test the Http Server Class.
from unittest import TestCase
from openlp.core.api import OpenLPHttpServer
from openlp.core.api import HttpServer
from tests.functional import patch
@ -42,7 +42,7 @@ class TestHttpServer(TestCase):
"""
# GIVEN: A new httpserver
# WHEN: I start the server
server = OpenLPHttpServer()
server = HttpServer()
# THEN: the api environment should have been created
self.assertEquals(1, mock_qthread.call_count, 'The qthread should have been called once')

View File

@ -26,7 +26,7 @@ import json
from unittest import TestCase
from openlp.core.common import Registry, Settings
from openlp.core.api.poll import OpenLPPoll
from openlp.core.api.poll import Poll
from tests.functional import MagicMock
from tests.helpers.testmixin import TestMixin
@ -52,7 +52,7 @@ class TestOpenLPPoll(TestCase, TestMixin):
self.build_settings()
Settings().extend_default_settings(__default_settings__)
Registry().create()
self.poll = OpenLPPoll()
self.poll = Poll()
def tearDown(self):
"""

View File

@ -25,7 +25,7 @@ Functional tests to test the Http Server Class.
from unittest import TestCase
from openlp.core.api import OpenLPWSServer
from openlp.core.api import WsServer
from tests.functional import patch
@ -42,7 +42,7 @@ class TestWSServer(TestCase):
"""
# GIVEN: A new httpserver
# WHEN: I start the server
server = OpenLPWSServer()
server = WsServer()
# THEN: the api environment should have been created
self.assertEquals(1, mock_qthread.call_count, 'The qthread should have been called once')

View File

@ -26,7 +26,7 @@ import os
import urllib.request
from unittest import TestCase
from openlp.core.api.poll import OpenLPPoll
from openlp.core.api.poll import Poll
from openlp.core.common import Settings, Registry
from openlp.core.ui import ServiceManager
from openlp.plugins.remotes.lib.httpserver import HttpRouter
@ -160,7 +160,7 @@ class TestRouter(TestCase, TestMixin):
Registry.create()
live_controller = MagicMock()
Registry().register('live_controller', live_controller)
poll = OpenLPPoll()
poll = Poll()
live_controller.slide_count = 2
# WHEN: main poll called