openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #22305
[Merge] lp:~sam92/openlp/fix-presentation-loading into lp:openlp
Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/fix-presentation-loading into lp:openlp.
Requested reviews:
Raoul Snyman (raoul-snyman)
Tim Bentley (trb143)
For more details, see:
https://code.launchpad.net/~sam92/openlp/fix-presentation-loading/+merge/198161
Imported presentations were not displayed - the variable has been renamed sometime.
--
https://code.launchpad.net/~sam92/openlp/fix-presentation-loading/+merge/198161
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py 2013-12-06 19:00:37 +0000
+++ openlp/plugins/presentations/lib/messagelistener.py 2013-12-07 17:36:53 +0000
@@ -281,7 +281,7 @@
class MessageListener(object):
"""
- This is the Presentation listener who acts on events from the slide controller and passes the messages on the the
+ This is the Presentation listener who acts on events from the slide controller and passes the messages on the
correct presentation handlers
"""
log.info('Message Listener loaded')
=== modified file 'openlp/plugins/presentations/lib/presentationcontroller.py'
--- openlp/plugins/presentations/lib/presentationcontroller.py 2013-10-13 20:36:42 +0000
+++ openlp/plugins/presentations/lib/presentationcontroller.py 2013-12-07 17:36:53 +0000
@@ -292,8 +292,8 @@
class PresentationController(object):
"""
- This class is used to control interactions with presentation applications by creating a runtime environment. This is
- a base class for presentation controllers to inherit from.
+ This class is used to control interactions with presentation applications by creating a runtime environment.
+ This is a base class for presentation controllers to inherit from.
To create a new controller, take a copy of this file and name it so it ends with ``controller.py``, i.e.
``foobarcontroller.py``. Make sure it inherits
@@ -341,8 +341,7 @@
"""
log.info('PresentationController loaded')
- def __init__(self, plugin=None, name='PresentationController',
- document_class=PresentationDocument):
+ def __init__(self, plugin=None, name='PresentationController', document_class=PresentationDocument):
"""
This is the constructor for the presentationcontroller object. This provides an easy way for descendent plugins
to populate common data. This method *must* be overridden, like so::
=== added file 'tests/functional/openlp_plugins/presentations/test_presentationcontroller.py'
--- tests/functional/openlp_plugins/presentations/test_presentationcontroller.py 1970-01-01 00:00:00 +0000
+++ tests/functional/openlp_plugins/presentations/test_presentationcontroller.py 2013-12-07 17:36:53 +0000
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2013 Raoul Snyman #
+# Portions copyright (c) 2008-2013 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 #
+###############################################################################
+"""
+This module contains tests for the Presentation Controller.
+"""
+from unittest import TestCase
+
+from openlp.plugins.presentations.lib.presentationcontroller import PresentationController
+from tests.functional import MagicMock
+
+class TestPresentationController(TestCase):
+ """
+ Test the PresentationController.
+ """
+ def constructor_test(self):
+ """
+ Test the Constructor
+ """
+ # GIVEN: No presentation controller
+ controller = None
+
+ # WHEN: The presentation controller object is created
+ controller = PresentationController(plugin=MagicMock())
+
+ # THEN: The name of the presentation controller should be correct
+ self.assertEqual('PresentationController', controller.name,
+ 'The name of the presentation controller should be correct')
References