← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/testing into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/testing into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~meths/openlp/testing/+merge/45622

Refactor out first_item.  Removes an unnecessary variable and sorts out the use before assignment warning from pylint.
-- 
https://code.launchpad.net/~meths/openlp/testing/+merge/45622
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/testing into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-01-05 18:25:40 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-01-08 21:52:59 +0000
@@ -709,11 +709,11 @@
         if len(items) == 0:
             return False
         bible_text = u''
+        old_item = None
         old_chapter = -1
         raw_footer = []
         raw_slides = []
         raw_title = []
-        first_item = True
         for item in items:
             bitem = self.listView.item(item.row())
             book = self._decodeQtObject(bitem, 'book')
@@ -754,9 +754,8 @@
             # We have to be 'Continuous'.
             else:
                 bible_text = u'%s %s\u00a0%s\n' % (bible_text, verse_text, text)
-            if first_item:
+            if not old_item:
                 start_item = item
-                first_item = False
             elif self.checkTitle(item, old_item):
                 raw_title.append(self.formatTitle(start_item, old_item))
                 start_item = item


Follow ups