From 7d2f8fa6cd02537fdf961c1c53da17b3bf75c603 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 1 Jul 2014 22:10:26 +0100 Subject: [PATCH 1/9] Fix setup.py --- openlp/.version | 2 +- openlp/core/utils/__init__.py | 4 ++-- resources/openlp.desktop | 6 ------ setup.py | 6 +++--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/openlp/.version b/openlp/.version index 3245d0c77..406870ece 100644 --- a/openlp/.version +++ b/openlp/.version @@ -1 +1 @@ -2.1.0-bzr2234 +2.1.0-bzr2389 diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index add663132..9b024eb84 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -149,9 +149,9 @@ def get_application_version(): # If they are equal, then this tree is tarball with the source for the release. We do not want the revision # number in the full version. if tree_revision == tag_revision: - full_version = tag_version + full_version = tag_version.decode('utf-8') else: - full_version = '%s-bzr%s' % (tag_version, tree_revision) + full_version = '%s-bzr%s' % (tag_version.decode('utf-8'), tree_revision.decode('utf-8')) else: # We're not running the development version, let's use the file. filepath = AppLocation.get_directory(AppLocation.VersionDir) diff --git a/resources/openlp.desktop b/resources/openlp.desktop index b17cbaf96..d585f4022 100755 --- a/resources/openlp.desktop +++ b/resources/openlp.desktop @@ -1,7 +1,5 @@ [Desktop Entry] Categories=AudioVideo; -Comment[de]= -Comment= Exec=openlp %F GenericName[de]=Church lyrics projection GenericName=Church lyrics projection @@ -9,11 +7,7 @@ Icon=openlp MimeType=application/x-openlp-service; Name[de]=OpenLP Name=OpenLP -Path= StartupNotify=true Terminal=false Type=Application -X-DBUS-ServiceName= -X-DBUS-StartupType= X-KDE-SubstituteUID=false -X-KDE-Username= diff --git a/setup.py b/setup.py index fc4a6f89b..fbf53d6d5 100755 --- a/setup.py +++ b/setup.py @@ -106,9 +106,9 @@ try: # If they are equal, then this tree is tarball with the source for the release. We do not want the revision number # in the version string. if tree_revision == tag_revision: - version_string = tag_version + version_string = tag_version.decode('utf-8') else: - version_string = '%s-bzr%s' % (tag_version, tree_revision) + version_string = '%s-bzr%s' % (tag_version.decode('utf-8'), tree_revision.decode('utf-8')) ver_file = open(VERSION_FILE, 'w') ver_file.write(version_string) except: @@ -152,7 +152,7 @@ using a computer and a data projector.""", 'Operating System :: POSIX :: BSD :: FreeBSD', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', 'Topic :: Desktop Environment :: Gnome', 'Topic :: Desktop Environment :: K Desktop Environment (KDE)', 'Topic :: Multimedia', From b3041a528764b7cdda0ce7fbfec7ee1f8f1c1135 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 1 Jul 2014 22:11:13 +0100 Subject: [PATCH 2/9] Fix version --- openlp/.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/.version b/openlp/.version index 406870ece..3245d0c77 100644 --- a/openlp/.version +++ b/openlp/.version @@ -1 +1 @@ -2.1.0-bzr2389 +2.1.0-bzr2234 From f649f0af3c3c252f4b0c8d310170f8a7ad27f352 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Jul 2014 19:13:23 +0100 Subject: [PATCH 3/9] Fix initialisation --- openlp/core/lib/renderer.py | 1 - openlp/core/ui/maindisplay.py | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 71a1f6058..ab4a5a4df 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -59,7 +59,6 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties): """ super(Renderer, self).__init__(None) # Need live behaviour if this is also working as a pseudo MainDisplay. - self.is_live = True self.screens = ScreenList() self.theme_level = ThemeLevel.Global self.global_theme_name = '' diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 946299aca..5c905c972 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -66,11 +66,8 @@ class Display(QtGui.QGraphicsView): if hasattr(parent, 'is_live') and parent.is_live: self.is_live = True if self.is_live: - super(Display, self).__init__() - # Overwrite the parent() method. self.parent = lambda: parent - else: - super(Display, self).__init__(parent) + super(Display, self).__init__() self.controller = parent self.screen = {} # FIXME: On Mac OS X (tested on 10.7) the display screen is corrupt with From 4ac921a2e7292f27f837dc264b31436c16bebc1b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Jul 2014 19:38:10 +0100 Subject: [PATCH 4/9] tests --- .../openlp_core_common/test_registrymixin.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tests/functional/openlp_core_common/test_registrymixin.py diff --git a/tests/functional/openlp_core_common/test_registrymixin.py b/tests/functional/openlp_core_common/test_registrymixin.py new file mode 100644 index 000000000..75e134d5a --- /dev/null +++ b/tests/functional/openlp_core_common/test_registrymixin.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2014 Raoul Snyman # +# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan # +# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # +# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # +# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # +# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, # +# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, # +# Frode Woldsund, Martin Zibricky, Patrick Zimmermann # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +Package to test the openlp.core.common package. +""" +import os +from unittest import TestCase + +from openlp.core.common import RegistryMixin, Registry + +TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../', '..', 'resources')) + + +class TestRegistryMixin(TestCase): + + def registry_mixin_missing_test(self): + """ + Test the registry creation and its usage + """ + # GIVEN: A new registry + Registry.create() + + # WHEN: I create a new class + mock_1 = Test1() + + # THEN: The following methods are missing + self.assertEqual(len(Registry().functions_list), 0), 'The function should not be in the dict anymore.' + + def registry_mixin_present_test(self): + """ + Test the registry creation and its usage + """ + # GIVEN: A new registry + Registry.create() + + # WHEN: I create a new class + mock_2 = Test2() + + # THEN: The following bootstrap methods should be present + self.assertEqual(len(Registry().functions_list), 2), 'The bootstrap functions should be in the dict.' + + +class Test1(object): + def __init__(self): + pass + + +class Test2(RegistryMixin): + def __init__(self): + super(Test2, self).__init__(None) \ No newline at end of file From f71c4cc7af7e5544c5e021aff75daaa2ca1691a1 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Jul 2014 19:58:52 +0100 Subject: [PATCH 5/9] remove nonvalid test --- tests/functional/openlp_core_lib/test_renderer.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_renderer.py b/tests/functional/openlp_core_lib/test_renderer.py index 8814a21a0..8df4816bb 100644 --- a/tests/functional/openlp_core_lib/test_renderer.py +++ b/tests/functional/openlp_core_lib/test_renderer.py @@ -65,16 +65,6 @@ class TestRenderer(TestCase): """ del self.screens - def initial_renderer_test(self): - """ - Test the initial renderer state - """ - # GIVEN: A new renderer instance. - renderer = Renderer() - # WHEN: the default renderer is built. - # THEN: The renderer should be a live controller. - self.assertEqual(renderer.is_live, True, 'The base renderer should be a live controller') - def default_screen_layout_test(self): """ Test the default layout calculations From 3f889e08d4ea72ae940bcb5c174d93c6e423f0a8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Jul 2014 20:34:28 +0100 Subject: [PATCH 6/9] Fix setup.py --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index fbf53d6d5..28f3658f1 100755 --- a/setup.py +++ b/setup.py @@ -105,6 +105,8 @@ try: tag_version, tag_revision = tags[-1].split() # If they are equal, then this tree is tarball with the source for the release. We do not want the revision number # in the version string. + tree_revision = tree_revision.strip() + tag_revision = tag_revision.strip() if tree_revision == tag_revision: version_string = tag_version.decode('utf-8') else: From 6847ee2e37e4f4db3a514eed3ad85ed113bf4b9d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Jul 2014 20:47:54 +0100 Subject: [PATCH 7/9] remove bl --- tests/functional/openlp_core_common/test_registrymixin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/openlp_core_common/test_registrymixin.py b/tests/functional/openlp_core_common/test_registrymixin.py index 75e134d5a..800445637 100644 --- a/tests/functional/openlp_core_common/test_registrymixin.py +++ b/tests/functional/openlp_core_common/test_registrymixin.py @@ -73,4 +73,4 @@ class Test1(object): class Test2(RegistryMixin): def __init__(self): - super(Test2, self).__init__(None) \ No newline at end of file + super(Test2, self).__init__(None) From 12c8663f8e2e6e151d0d5ec1f397fc893822ce64 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Jul 2014 20:52:26 +0100 Subject: [PATCH 8/9] indent --- tests/functional/openlp_core_common/test_registrymixin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/openlp_core_common/test_registrymixin.py b/tests/functional/openlp_core_common/test_registrymixin.py index 800445637..d8636ac94 100644 --- a/tests/functional/openlp_core_common/test_registrymixin.py +++ b/tests/functional/openlp_core_common/test_registrymixin.py @@ -73,4 +73,4 @@ class Test1(object): class Test2(RegistryMixin): def __init__(self): - super(Test2, self).__init__(None) + super(Test2, self).__init__(None) From 2938df5e022ed3aa2f1240742196ec14c701fb3e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 6 Jul 2014 16:19:12 +0100 Subject: [PATCH 9/9] remove german --- resources/openlp.desktop | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/openlp.desktop b/resources/openlp.desktop index d585f4022..9f92f9d87 100755 --- a/resources/openlp.desktop +++ b/resources/openlp.desktop @@ -1,11 +1,9 @@ [Desktop Entry] Categories=AudioVideo; Exec=openlp %F -GenericName[de]=Church lyrics projection GenericName=Church lyrics projection Icon=openlp MimeType=application/x-openlp-service; -Name[de]=OpenLP Name=OpenLP StartupNotify=true Terminal=false