← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bugfixes1 into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bugfixes1 into lp:openlp.

Requested reviews:
  Jon Tibble (meths)
Related bugs:
  #637547 Editing a song in a loaded service file crashes
  https://bugs.launchpad.net/bugs/637547
  #637886 Replacing live video background with nothing live causes crash
  https://bugs.launchpad.net/bugs/637886


Try again 
White space and bug fixes.
-- 
https://code.launchpad.net/~trb143/openlp/bugfixes1/+merge/35446
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2010-09-14 14:43:21 +0000
+++ openlp/core/ui/maindisplay.py	2010-09-14 17:34:40 +0000
@@ -303,6 +303,9 @@
         Generates a preview of the image displayed.
         """
         log.debug(u'preview for %s', self.isLive)
+        # We must have a service item to preview
+        if not hasattr(self, u'serviceItem'):
+            return
         if self.isLive:
             # Wait for the fade to finish before geting the preview.
             # Important otherwise preview will have incorrect text if at all !

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2010-09-10 17:49:22 +0000
+++ openlp/core/ui/servicemanager.py	2010-09-14 17:34:40 +0000
@@ -279,7 +279,8 @@
         self.editAction.setVisible(False)
         self.maintainAction.setVisible(False)
         self.notesAction.setVisible(False)
-        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit):
+        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit) \
+            and hasattr(serviceItem[u'service_item'], u'editId'):
             self.editAction.setVisible(True)
         if serviceItem[u'service_item']\
             .is_capable(ItemCapabilities.AllowsMaintain):

=== modified file 'openlp/plugins/songs/lib/cclifileimport.py'
--- openlp/plugins/songs/lib/cclifileimport.py	2010-09-14 14:43:21 +0000
+++ openlp/plugins/songs/lib/cclifileimport.py	2010-09-14 17:34:40 +0000
@@ -70,7 +70,7 @@
         for filename in self.filenames:
             self.import_wizard.incrementProgressBar(
                 u'Importing song %s of %s' % (song_count, song_total))
-            filename = unicode(filename) 
+            filename = unicode(filename)
             log.debug(u'Importing CCLI File: %s', filename)
             lines = []
             if os.path.isfile(filename):
@@ -92,23 +92,23 @@
                     log.info(u'Extension %s is not valid', filename)
                 song_count += 1
             if self.stop_import_flag:
-                return False  
+                return False
         return True
 
     def do_import_usr_file(self, textList):
         """
         The :method:`do_import_usr_file` method provides OpenLP
         with the ability to import CCLI SongSelect songs in
-        *USR* file format   
-        
+        *USR* file format
+
         ``textList``
             An array of strings containing the usr file content.
-            
+
         **SongSelect .usr file format**
         ``[File]``
             USR file format first line
         ``Type=``
-            Indicates the file type 
+            Indicates the file type
             e.g. *Type=SongSelect Import File*
         ``Version=3.0``
             File format version
@@ -117,7 +117,7 @@
         ``Title=``
             Contains the song title (e.g. *Title=Above All*)
         ``Author=``
-            Contains a | delimited list of the  song authors 
+            Contains a | delimited list of the  song authors
             e.g. *Author=LeBlanc, Lenny | Baloche, Paul*
         ``Copyright=``
             Contains a | delimited list of the song copyrights
@@ -137,7 +137,7 @@
             Contains a list of the songs fields in order /t delimited
             e.g. *Fields=Vers 1/tVers 2/tChorus 1/tAndere 1*
         ``Words=``
-            Contains the songs various lyrics in order as shown by the 
+            Contains the songs various lyrics in order as shown by the
             *Fields* description
             e.g. *Words=Above all powers....* [/n = CR, /n/t = CRLF]
         """
@@ -175,7 +175,7 @@
                 verse_type = u'O'
             verse_text = unicode(words_list[counter])
             verse_text = verse_text.replace("/n",  "\n")
-            if len(verse_text) > 0:                
+            if len(verse_text) > 0:
                 self.add_verse(verse_text, verse_type)
         #Handle multiple authors
         author_list = song_author.split(u'/')
@@ -193,10 +193,10 @@
         """
         The :method:`do_import_txt_file` method provides OpenLP
         with the ability to import CCLI SongSelect songs in
-        *TXT* file format   
-                
+        *TXT* file format
+
         ``textList``
-            An array of strings containing the txt file content. 
+            An array of strings containing the txt file content.
 
         **SongSelect .txt file format**
 
@@ -226,13 +226,13 @@
             e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)
         ``Song Copyright``
             e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing
-        ``Song Authors``    
+        ``Song Authors``
             e.g. Lenny LeBlanc | Paul Baloche
         ``Licencing info``
-            e.g. For use solely with the SongSelect Terms of Use.  
+            e.g. For use solely with the SongSelect Terms of Use.
             All rights Reserved.  www.ccli.com
-        ``CCLI Licence number of user``    
-            e.g. CCL-Liedlizenznummer: 14 / CCLI License No. 14   
+        ``CCLI Licence number of user``
+            e.g. CCL-Liedlizenznummer: 14 / CCLI License No. 14
         """
         log.debug(u'TXT file text: %s', textList)
         self.set_defaults()
@@ -256,7 +256,7 @@
                 if line_number == 0:
                     song_name = clean_line
                     line_number += 1
-                #line_number=1, verses    
+                #line_number=1, verses
                 elif line_number == 1:
                     #line_number=1, ccli number, first line after verses
                     if clean_line.startswith(u'CCLI'):
@@ -289,11 +289,11 @@
                     if line_number == 2:
                         line_number += 1
                         song_copyright = clean_line
-                    #n=3, authors    
+                    #n=3, authors
                     elif line_number == 3:
                         line_number += 1
                         song_author = clean_line
-                    #line_number=4, comments lines before last line    
+                    #line_number=4, comments lines before last line
                     elif (line_number == 4) and \
                         (not clean_line.startswith(u'CCL')):
                         song_comments = song_comments + clean_line


Follow ups