diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index f57243818..c4ac846c9 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -62,12 +62,10 @@ class ItemCapabilities(object): tab when making the previous item live. ``CanEdit`` - The capability to allow the ServiceManager to allow the item to be - edited + The capability to allow the ServiceManager to allow the item to be edited ``CanMaintain`` - The capability to allow the ServiceManager to allow the item to be - reordered. + The capability to allow the ServiceManager to allow the item to be reordered. ``RequiresMedia`` Determines is the service_item needs a Media Player diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 0489428ac..083f36db0 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -132,7 +132,7 @@ from cherrypy._cpcompat import sha, ntob log = logging.getLogger(__name__) -def sha_password_encrypter(password): +def make_sha_hash(password): """ Create an encrypted password for the given password. """ @@ -145,7 +145,7 @@ def fetch_password(username): """ if username != Settings().value(u'remotes/user id'): return None - return sha_password_encrypter(Settings().value(u'remotes/password')) + return make_sha_hash(Settings().value(u'remotes/password')) class HttpServer(object): @@ -207,7 +207,7 @@ class HttpServer(object): u'tools.basic_auth.on': Settings().value(u'remotes/authentication enabled'), u'tools.basic_auth.realm': u'OpenLP Remote Login', u'tools.basic_auth.users': fetch_password, - u'tools.basic_auth.encrypt': sha_password_encrypter}, + u'tools.basic_auth.encrypt': make_sha_hash}, u'/files': {u'tools.staticdir.on': True, u'tools.staticdir.dir': self.router.html_dir, u'tools.basic_auth.on': False}, diff --git a/tests/functional/openlp_plugins/remotes/test_router.py b/tests/functional/openlp_plugins/remotes/test_router.py index 3b344c3b2..2980a339b 100644 --- a/tests/functional/openlp_plugins/remotes/test_router.py +++ b/tests/functional/openlp_plugins/remotes/test_router.py @@ -8,7 +8,7 @@ from tempfile import mkstemp from mock import MagicMock from openlp.core.lib import Settings -from openlp.plugins.remotes.lib.httpserver import HttpRouter, fetch_password, sha_password_encrypter +from openlp.plugins.remotes.lib.httpserver import HttpRouter, fetch_password, make_sha_hash from PyQt4 import QtGui __default_settings__ = { @@ -62,7 +62,7 @@ class TestRouter(TestCase): # GIVEN: A default configuration # WHEN: called with the defined userid password = fetch_password(u'openlp') - required_password = sha_password_encrypter(u'password') + required_password = make_sha_hash(u'password') # THEN: the function should return the correct password self.assertEqual(password, required_password, u'The result for fetch_password should be the defined password') @@ -73,12 +73,12 @@ class TestRouter(TestCase): """ # GIVEN: A default configuration # WHEN: called with the defined userid - required_password = sha_password_encrypter(u'password') + required_password = make_sha_hash(u'password') test_value = u'5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8' # THEN: the function should return the correct password self.assertEqual(required_password, test_value, - u'The result for sha_password_encrypter should return the correct encrypted password') + u'The result for make_sha_hash should return the correct encrypted password') def process_http_request_test(self): """ diff --git a/tests/interfaces/openlp_plugins/remotes/test_server.py b/tests/interfaces/openlp_plugins/remotes/test_server.py index d7ce88010..9ae544d21 100644 --- a/tests/interfaces/openlp_plugins/remotes/test_server.py +++ b/tests/interfaces/openlp_plugins/remotes/test_server.py @@ -9,10 +9,10 @@ from mock import MagicMock import urllib2 import cherrypy -from BeautifulSoup import BeautifulSoup, NavigableString, Tag +from BeautifulSoup import BeautifulSoup from openlp.core.lib import Settings -from openlp.plugins.remotes.lib.httpserver import HttpServer, fetch_password, sha_password_encrypter +from openlp.plugins.remotes.lib.httpserver import HttpServer from PyQt4 import QtGui __default_settings__ = {