From b868ecc57dffab2835b5e2d0939289876d6a7a3f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 14 Sep 2013 20:16:14 +0100 Subject: [PATCH] remove reminances of cherrypy --- openlp/core/ui/exceptionform.py | 7 ------- openlp/plugins/remotes/remoteplugin.py | 7 ++++--- scripts/check_dependencies.py | 14 +++++++++----- .../openlp_plugins/remotes/test_server.py | 4 +--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 758fc6ecc..2dc034f71 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -75,12 +75,6 @@ try: ICU_VERSION = 'OK' except ImportError: ICU_VERSION = '-' -try: - import cherrypy - CHERRYPY_VERSION = cherrypy.__version__ -except ImportError: - CHERRYPY_VERSION = '-' - try: WEBKIT_VERSION = QtWebKit.qWebKitVersion() except AttributeError: @@ -140,7 +134,6 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): 'Chardet: %s\n' % CHARDET_VERSION + \ 'PyEnchant: %s\n' % ENCHANT_VERSION + \ 'Mako: %s\n' % MAKO_VERSION + \ - 'CherryPy: %s\n' % CHERRYPY_VERSION + \ 'pyICU: %s\n' % ICU_VERSION + \ 'pyUNO bridge: %s\n' % self._pyuno_import() + \ 'VLC: %s\n' % VLC_VERSION diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 0c23978b6..d5b5545ba 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -28,6 +28,7 @@ ############################################################################### import logging +import time from openlp.core.lib import Plugin, StringContent, translate, build_icon from openlp.plugins.remotes.lib import RemoteTab, OpenLPServer @@ -66,7 +67,6 @@ class RemotesPlugin(Plugin): log.debug('initialise') super(RemotesPlugin, self).initialise() self.server = OpenLPServer() - #self.server.start_server() def finalise(self): """ @@ -107,5 +107,6 @@ class RemotesPlugin(Plugin): Called when Config is changed to restart the server on new address or port """ log.debug('remote config changed') - self.main_window.information_message(translate('RemotePlugin', 'Configuration Change'), - translate('RemotePlugin', 'OpenLP will need to be restarted for the Remote changes to become active.')) + self.finalise() + time.sleep(0.5) + self.initialise() diff --git a/scripts/check_dependencies.py b/scripts/check_dependencies.py index 348a809eb..698a65a96 100755 --- a/scripts/check_dependencies.py +++ b/scripts/check_dependencies.py @@ -48,6 +48,7 @@ except ImportError: IS_WIN = sys.platform.startswith('win') + VERS = { 'Python': '2.6', 'PyQt4': '4.6', @@ -82,7 +83,6 @@ MODULES = [ 'enchant', 'bs4', 'mako', - 'cherrypy', 'uno', 'icu', 'bs4', @@ -98,6 +98,7 @@ OPTIONAL_MODULES = [ w = sys.stdout.write + def check_vers(version, required, text): if not isinstance(version, str): version = '.'.join(map(str, version)) @@ -111,13 +112,16 @@ def check_vers(version, required, text): w('FAIL' + os.linesep) return False + def print_vers_fail(required, text): print(' %s >= %s ... FAIL' % (text, required)) + def verify_python(): if not check_vers(list(sys.version_info), VERS['Python'], text='Python'): exit(1) + def verify_versions(): print('Verifying version of modules...') try: @@ -138,6 +142,7 @@ def verify_versions(): except ImportError: print_vers_fail(VERS['enchant'], 'enchant') + def check_module(mod, text='', indent=' '): space = (30 - len(mod) - len(text)) * ' ' w(indent + '%s%s... ' % (mod, text) + space) @@ -148,6 +153,7 @@ def check_module(mod, text='', indent=' '): w('FAIL') w(os.linesep) + def verify_pyenchant(): w('Enchant (spell checker)... ') try: @@ -160,6 +166,7 @@ def verify_pyenchant(): except ImportError: w('FAIL' + os.linesep) + def verify_pyqt(): w('Qt4 image formats... ') try: @@ -174,22 +181,19 @@ def verify_pyqt(): except ImportError: w('FAIL' + os.linesep) + def main(): verify_python() - print('Checking for modules...') for m in MODULES: check_module(m) - print('Checking for optional modules...') for m in OPTIONAL_MODULES: check_module(m[0], text=m[1]) - if IS_WIN: print('Checking for Windows specific modules...') for m in WIN32_MODULES: check_module(m) - verify_versions() verify_pyqt() verify_pyenchant() diff --git a/tests/interfaces/openlp_plugins/remotes/test_server.py b/tests/interfaces/openlp_plugins/remotes/test_server.py index 63975370f..101444829 100644 --- a/tests/interfaces/openlp_plugins/remotes/test_server.py +++ b/tests/interfaces/openlp_plugins/remotes/test_server.py @@ -7,9 +7,8 @@ from unittest import TestCase from tempfile import mkstemp from mock import MagicMock import urllib.request, urllib.error, urllib.parse -import cherrypy -from BeautifulSoup import BeautifulSoup +from bs4 import BeautifulSoup from openlp.core.lib import Settings from openlp.plugins.remotes.lib.httpserver import HttpServer @@ -133,6 +132,5 @@ def process_http_request(url_path, *args): ``*args`` Some args. """ - cherrypy.response.status = 200 return None