← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/fixes into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  #598393 After adding a new image to a selected (image) item in the service manager it is not selected anymore
  https://bugs.launchpad.net/bugs/598393

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/49683

Hello!

Disable features depending on mutagen. Temporary fix, as Tim plans to remove mutagen.

Cheers
-- 
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/49683
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes into lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2011-02-13 13:11:15 +0000
+++ openlp/core/lib/serviceitem.py	2011-02-14 18:27:58 +0000
@@ -30,7 +30,11 @@
 
 import datetime
 import logging
-import mutagen
+try:
+    import mutagen
+    MUTAGEN_AVAILABLE = True
+except ImportError:
+    MUTAGEN_AVAILABLE = False
 import os
 import uuid
 
@@ -433,6 +437,8 @@
         """
         Returns the start and finish time for a media item
         """
+        if not MUTAGEN_AVAILABLE:
+            return u''
         tooltip = None
         start = None
         end = None

=== modified file 'openlp/core/ui/printserviceorderform.py'
--- openlp/core/ui/printserviceorderform.py	2011-02-07 17:27:38 +0000
+++ openlp/core/ui/printserviceorderform.py	2011-02-14 18:27:58 +0000
@@ -24,7 +24,11 @@
 # Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
 ###############################################################################
 import datetime
-import mutagen
+try:
+    import mutagen
+    MUTAGEN_AVAILABLE = True
+except ImportError:
+    MUTAGEN_AVAILABLE = False
 import os
 
 from PyQt4 import QtCore, QtGui
@@ -43,6 +47,8 @@
         self.printDialog = QtGui.QPrintDialog(self.printer, self)
         self.document = QtGui.QTextDocument()
         self.setupUi(self)
+        if not MUTAGEN_AVAILABLE:
+            self.printMetaDataCheckBox.setEnabled(False)
         # Load the settings for the dialog.
         settings = QtCore.QSettings()
         settings.beginGroup(u'advanced')
@@ -112,7 +118,8 @@
                         'OpenLP.ServiceManager', 'Notes:'),
                         item.notes.replace(u'\n', u'<br />'))
             # Add play length of media files.
-            if item.is_media() and self.printMetaDataCheckBox.isChecked():
+            if item.is_media() and self.printMetaDataCheckBox.isChecked() and \
+                MUTAGEN_AVAILABLE:
                 path = os.path.join(item.get_frames()[0][u'path'],
                     item.get_frames()[0][u'title'])
                 if not os.path.isfile(path):


Follow ups