From 52c7d89706e9fc02299bea7437e1f4b11058c3c5 Mon Sep 17 00:00:00 2001 From: Phill Ridout Date: Tue, 30 Dec 2014 11:23:01 +0000 Subject: [PATCH] removal of util function --- openlp/core/ui/slidecontroller.py | 2 +- openlp/core/utils/__init__.py | 12 ------------ tests/functional/openlp_core_utils/test_init.py | 1 - .../openlp_plugins/bibles/test_mediaitem.py | 16 ---------------- 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 7791604c1..0ca6968df 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -132,7 +132,7 @@ class InfoLabel(QtGui.QLabel): """ self.setToolTip(text) super().setText(text) - + class SlideController(DisplayController, RegistryProperties): """ diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 0c3eb6634..148b351ed 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -506,18 +506,6 @@ def get_natural_key(string): return [b''] + key return key -def elide_text(text, font, width): - """ - Add an ellipsis to text if it is wider than width. - - :param text: The string to elide - :param font: The font that the text is being desplayed in - :param width: The width that the elided text string needs to fill - :return: The elided string or just text - """ - font_metrics = QtGui.QFontMetrics(font) - return font_metrics.elidedText(text, QtCore.Qt.ElideRight, width) - from .languagemanager import LanguageManager from .actions import ActionList diff --git a/tests/functional/openlp_core_utils/test_init.py b/tests/functional/openlp_core_utils/test_init.py index 6979be7b3..563f0dc5b 100644 --- a/tests/functional/openlp_core_utils/test_init.py +++ b/tests/functional/openlp_core_utils/test_init.py @@ -133,4 +133,3 @@ class TestInitFunctions(TestMixin, TestCase): # THEN: The connection parameters should be set for socket self.assertEqual(result, 'libreoffice --nologo --norestore --minimized --nodefault --nofirststartwizard' ' "--accept=socket,host=localhost,port=2002;urp;"') - diff --git a/tests/functional/openlp_plugins/bibles/test_mediaitem.py b/tests/functional/openlp_plugins/bibles/test_mediaitem.py index 131a679f0..305870d24 100644 --- a/tests/functional/openlp_plugins/bibles/test_mediaitem.py +++ b/tests/functional/openlp_plugins/bibles/test_mediaitem.py @@ -118,19 +118,3 @@ class TestMediaItem(TestCase, TestMixin): mocked_list_view.selectAll.assert_called_once_with() self.assertEqual(self.media_item.search_results, {}) self.assertEqual(self.media_item.second_search_results, {}) - - - def elide_text_short_text_test(self): - result = elide_text('Test String', QtGui.QFont(),) - -def elide_text(text, font, width): - """ - Add an ellipsis to text if it is wider than width. - - :param text: The string to elide - :param font: The font that the text is being desplayed in - :param width: The width that the elided text string needs to fill - :return: The elided string or just text - """ - font_metrics = QtGui.QFontMetrics(font) - return font_metrics.elidedText(text, QtCore.Qt.ElideRight, width) \ No newline at end of file