diff --git a/openlp/core/utils/applocation.py b/openlp/core/utils/applocation.py index 4215cad22..2f1cb45ba 100644 --- a/openlp/core/utils/applocation.py +++ b/openlp/core/utils/applocation.py @@ -63,7 +63,6 @@ class AppLocation(object): VersionDir = 5 CacheDir = 6 LanguageDir = 7 - SharedData = 8 # Base path where data/config/cache dir is located BaseDir = None @@ -150,18 +149,18 @@ def _get_os_dir_path(dir_type): if sys.platform == u'win32': if dir_type == AppLocation.DataDir: return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), u'openlp', u'data') - elif dir_type == AppLocation.LanguageDir or dir_type == AppLocation.SharedData: + elif dir_type == AppLocation.LanguageDir: return os.path.split(openlp.__file__)[0] return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), u'openlp') elif sys.platform == u'darwin': if dir_type == AppLocation.DataDir: return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'Library', u'Application Support', u'openlp', u'Data') - elif dir_type == AppLocation.LanguageDir or dir_type == AppLocation.SharedData: + elif dir_type == AppLocation.LanguageDir: return os.path.split(openlp.__file__)[0] return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'Library', u'Application Support', u'openlp') else: - if dir_type == AppLocation.LanguageDir or dir_type == AppLocation.SharedData: + if dir_type == AppLocation.LanguageDir: prefixes = [u'/usr/local', u'/usr'] for prefix in prefixes: directory = os.path.join(prefix, u'share', u'openlp') diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 677ea3146..51490bb38 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -190,11 +190,11 @@ class HttpServer(object): if Settings().value(self.plugin.settings_section + u'/https enabled'): port = Settings().value(self.plugin.settings_section + u'/https port') address = Settings().value(self.plugin.settings_section + u'/ip address') - shared_data = AppLocation.get_directory(AppLocation.SharedData) + local_data = AppLocation.get_directory(AppLocation.DataDir) cherrypy.config.update({u'server.socket_host': str(address), u'server.socket_port': port, - u'server.ssl_certificate': os.path.join(shared_data, u'openlp.crt'), - u'server.ssl_private_key': os.path.join(shared_data, u'openlp.key')}) + u'server.ssl_certificate': os.path.join(local_data, u'remotes', u'openlp.crt'), + u'server.ssl_private_key': os.path.join(local_data, u'remotes', u'openlp.key')}) else: port = Settings().value(self.plugin.settings_section + u'/port') address = Settings().value(self.plugin.settings_section + u'/ip address') diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index 685cd5882..09934b58c 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -217,9 +217,9 @@ class RemoteTab(SettingsTab): self.address_edit.setText(Settings().value(self.settings_section + u'/ip address')) self.twelve_hour = Settings().value(self.settings_section + u'/twelve hour') self.twelve_hour_check_box.setChecked(self.twelve_hour) - shared_data = AppLocation.get_directory(AppLocation.SharedData) - if not os.path.exists(os.path.join(shared_data, u'openlp.crt')) or \ - not os.path.exists(os.path.join(shared_data, u'openlp.key')): + local_data = AppLocation.get_directory(AppLocation.DataDir) + if not os.path.exists(os.path.join(local_data, u'remotes', u'openlp.crt')) or \ + not os.path.exists(os.path.join(local_data, u'remotes', u'openlp.key')): self.https_settings_group_box.setChecked(False) self.https_settings_group_box.setEnabled(False) self.https_error_label.setVisible(True) diff --git a/tests/functional/openlp_plugins/remotes/__init__.py b/tests/functional/openlp_plugins/remotes/__init__.py index f87606f07..e69de29bb 100644 --- a/tests/functional/openlp_plugins/remotes/__init__.py +++ b/tests/functional/openlp_plugins/remotes/__init__.py @@ -1 +0,0 @@ -__author__ = 'tim' diff --git a/tests/functional/openlp_plugins/remotes/test_router.py b/tests/functional/openlp_plugins/remotes/test_router.py index f86b69612..3b344c3b2 100644 --- a/tests/functional/openlp_plugins/remotes/test_router.py +++ b/tests/functional/openlp_plugins/remotes/test_router.py @@ -5,7 +5,7 @@ import os from unittest import TestCase from tempfile import mkstemp -from mock import patch, MagicMock +from mock import MagicMock from openlp.core.lib import Settings from openlp.plugins.remotes.lib.httpserver import HttpRouter, fetch_password, sha_password_encrypter @@ -51,7 +51,6 @@ class TestRouter(TestCase): # GIVEN: A default configuration # WHEN: called with the defined userid password = fetch_password(u'itwinkle') - print password # THEN: the function should return None self.assertEqual(password, None, u'The result for fetch_password should be None') @@ -75,7 +74,7 @@ class TestRouter(TestCase): # GIVEN: A default configuration # WHEN: called with the defined userid required_password = sha_password_encrypter(u'password') - test_value = '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8' + test_value = u'5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8' # THEN: the function should return the correct password self.assertEqual(required_password, test_value,