← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol/openlp/bug-1116528 into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol/openlp/bug-1116528 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1116528 in OpenLP: "Song Import Wizzard does not work in trunk"
  https://bugs.launchpad.net/openlp/+bug/1116528

For more details, see:
https://code.launchpad.net/~googol/openlp/bug-1116528/+merge/151284

Hello,

- fixed bug #1116528 (Song Import Wizzard does not work in trunk)
- fixed exception form not being displayed
- always log exceptions
- fixed/extended test
-- 
https://code.launchpad.net/~googol/openlp/bug-1116528/+merge/151284
Your team OpenLP Core is requested to review the proposed merge of lp:~googol/openlp/bug-1116528 into lp:openlp.
=== modified file 'openlp/core/__init__.py'
--- openlp/core/__init__.py	2013-02-16 12:30:16 +0000
+++ openlp/core/__init__.py	2013-03-01 16:22:25 +0000
@@ -184,10 +184,8 @@
         ``traceback``
             A traceback object with the details of where the exception occurred.
         """
-        if not hasattr(self, u'mainWindow'):
-            log.exception(''.join(format_exception(exctype, value, traceback)))
-            return
-        if not hasattr(self, u'exceptionForm'):
+        log.exception(''.join(format_exception(exctype, value, traceback)))
+        if not hasattr(self, u'exception_form'):
             self.exception_form = ExceptionForm(self.main_window)
         self.exception_form.exceptionTextEdit.setPlainText(''.join(format_exception(exctype, value, traceback)))
         self.set_normal_cursor()

=== modified file 'openlp/plugins/songs/forms/songimportform.py'
--- openlp/plugins/songs/forms/songimportform.py	2013-02-05 08:05:28 +0000
+++ openlp/plugins/songs/forms/songimportform.py	2013-03-01 16:22:25 +0000
@@ -35,7 +35,7 @@
 
 from PyQt4 import QtCore, QtGui
 
-from openlp.core.lib import Settings, UiStrings, translate
+from openlp.core.lib import Registry, Settings, UiStrings, translate
 from openlp.core.lib.ui import critical_error_message_box
 from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
 from openlp.plugins.songs.lib.importer import SongFormat, SongFormatSelect
@@ -489,6 +489,16 @@
         self.formatWidgets[this_format][u'importWidget'] = importWidget
         return importWidget
 
+    def _get_main_window(self):
+        """
+        Adds the main window to the class dynamically
+        """
+        if not hasattr(self, u'_main_window'):
+            self._main_window = Registry().get(u'main_window')
+        return self._main_window
+
+    main_window = property(_get_main_window)
+
 
 class SongImportSourcePage(QtGui.QWizardPage):
     """

=== modified file 'tests/functional/openlp_core_utils/test_applocation.py'
--- tests/functional/openlp_core_utils/test_applocation.py	2013-02-27 21:40:55 +0000
+++ tests/functional/openlp_core_utils/test_applocation.py	2013-03-01 16:22:25 +0000
@@ -83,7 +83,10 @@
             mocked_listdir.return_value = copy.deepcopy(FILE_LIST)
 
             # When: Get the list of files.
-            result = AppLocation.get_files(u'section', u'.mp3')
+            result = AppLocation.get_files(u'sectidon', u'.mp3')
+
+            # Then: Check if the section parameter was used correctly.
+            mocked_listdir.assert_called_with(u'test/dir/section')
 
             # Then: check if the file lists are identical.
             assert result == [u'file5.mp3', u'file6.mp3'],  u'The file lists should be identical.'