Hello community,

here is the log from the commit of package OpenLP for openSUSE:Factory checked 
in at 2014-07-02 15:04:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/OpenLP (Old)
 and      /work/SRC/openSUSE:Factory/.OpenLP.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "OpenLP"

Changes:
--------
--- /work/SRC/openSUSE:Factory/OpenLP/OpenLP.changes    2014-02-16 
19:54:01.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.OpenLP.new/OpenLP.changes       2014-07-02 
15:04:50.000000000 +0200
@@ -1,0 +2,52 @@
+Mon Jun 30 23:56:46 EDT 2014 - jos...@mulloy.me
+
+- Updated to 2.0.5 (bnc#884901)
+  * Upstream bugfix/stabilization release
+  * Final release in the 2.0 branch
+  * Change to BibleGateway URL to use legacy web interface
+  * Issues with Themes when comparing theme files (lp#719514)
+  * Improved error messages with Easy Worship Song Imports (lp#1326664)
+  * Allow more than 26 equal verses within a Song (lp#1310523)
+  * Handle songs where two optional breaks follow each other (lp#1296104)
+  * Improve Database update error handling (lp#1136278)
+
+-------------------------------------------------------------------
+Mon Jun 30 23:14:58 EDT 2014 - jos...@mulloy.me
+
+- Updated to 2.0.5 (bnc#884901)
+  * Upstream bugfix/stabilization release
+  * Final release in the 2.0 branch
+  * Change to BibleGateway URL to use legacy web interface
+  * Issues with Themes when comparing theme files (lp#719514)
+  * Improved error messages with Easy Worship Song Imports (lp#1326664)
+  * Allow more than 26 equal verses within a Song (lp#1310523)
+  * Handle songs where two optional breaks follow each other (lp#1296104)
+  * Improve Database update error handling (lp#1136278)
+
+-------------------------------------------------------------------
+Mon Jun 30 22:36:20 EDT 2014 - jos...@mulloy.me
+
+- Updated to 2.0.5 (bnc#884901)
+  * Upstream bugfix/stabilization release
+  * Final release in the 2.0 branch
+  * Change to BibleGateway URL to use legacy web interface
+  * Issues with Themes when comparing theme files (lp#719514)
+  * Improved error messages with Easy Worship Song Imports (lp#1326664)
+  * Allow more than 26 equal verses within a Song (lp#1310523)
+  * Handle songs where two optional breaks follow each other (lp#1296104)
+  * Improve Database update error handling (lp#1136278)
+
+-------------------------------------------------------------------
+Mon Jun 30 00:27:40 EDT 2014 - jos...@mulloy.me
+
+- Updated to 2.0.5 (bnc#884901)
+  * Upstream bugfix/stabilization release
+  * Final release in the 2.0 branch
+  * Change to BibleGateway URL to use legacy web interface
+  * Issues with Themes when comparing theme files (lp#719514)
+  * Improved error messages with Easy Worship Song Imports (lp#1326664)
+  * Allow more than 26 equal verses within a Song. (lp#1310523)
+  * Handle songs where two optional breaks follow each other. (lp#1296104)
+  * Improve Database update error handling. (lp#1136278)
+
+-------------------------------------------------------------------

Old:
----
  OpenLP-2.0.4.tar.gz

New:
----
  OpenLP-2.0.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ OpenLP.spec ++++++
--- /var/tmp/diff_new_pack.u8vtnQ/_old  2014-07-02 15:04:51.000000000 +0200
+++ /var/tmp/diff_new_pack.u8vtnQ/_new  2014-07-02 15:04:51.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           OpenLP
-Version:        2.0.4
+Version:        2.0.5
 Release:        0
 Summary:        Open source Church presentation and lyrics projection 
application
 License:        GPL-2.0

++++++ OpenLP-2.0.4.tar.gz -> OpenLP-2.0.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/.version 
new/OpenLP-2.0.5/openlp/.version
--- old/OpenLP-2.0.4/openlp/.version    2014-02-01 20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/.version    2014-06-28 20:53:00.000000000 +0200
@@ -1 +1 @@
-2.0.4
+2.0.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/core/lib/renderer.py 
new/OpenLP-2.0.5/openlp/core/lib/renderer.py
--- old/OpenLP-2.0.4/openlp/core/lib/renderer.py        2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/core/lib/renderer.py        2014-06-28 
20:53:00.000000000 +0200
@@ -284,6 +284,9 @@
         elif item.is_capable(ItemCapabilities.CanSoftBreak):
             pages = []
             if u'[---]' in text:
+                # Remove two or more option slide breaks next to each other 
(causing infinite loop).
+                while u'\n[---]\n[---]\n' in text:
+                        text = text.replace(u'\n[---]\n[---]\n', u'\n[---]\n')
                 while True:
                     slides = text.split(u'\n[---]\n', 2)
                     # If there are (at least) two occurrences of [---] we use
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/core/ui/thememanager.py 
new/OpenLP-2.0.5/openlp/core/ui/thememanager.py
--- old/OpenLP-2.0.4/openlp/core/ui/thememanager.py     2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/core/ui/thememanager.py     2014-06-28 
20:53:00.000000000 +0200
@@ -698,7 +698,7 @@
         finally:
             if out_file:
                 out_file.close()
-        if image_from and image_from != image_to:
+        if image_from and os.path.abspath(image_from) != 
os.path.abspath(image_to):
             try:
                 encoding = get_filesystem_encoding()
                 shutil.copyfile(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/plugins/bibles/lib/http.py 
new/OpenLP-2.0.5/openlp/plugins/bibles/lib/http.py
--- old/OpenLP-2.0.4/openlp/plugins/bibles/lib/http.py  2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/bibles/lib/http.py  2014-06-28 
20:53:00.000000000 +0200
@@ -238,7 +238,7 @@
             version)
         cleaner = [(re.compile('&nbsp;|<br />|\'\+\''), lambda match: '')]
         soup = get_soup_for_bible_ref(
-            u'http://www.biblegateway.com/passage/?%s' % url_params,
+            u'http://legacy.biblegateway.com/passage/?%s' % url_params,
             pre_parse_regex=r'<meta name.*?/>', pre_parse_substitute='',
             cleaner=cleaner)
         if not soup:
@@ -271,7 +271,7 @@
         log.debug(u'BGExtract.get_books_from_http("%s")', version)
         url_params = urllib.urlencode(
             {u'action': 'getVersionInfo', u'vid': u'%s' % version})
-        reference_url = u'http://www.biblegateway.com/versions/?%s#books' % \
+        reference_url = u'http://legacy.biblegateway.com/versions/?%s#books' % 
\
             url_params
         page = get_web_page(reference_url)
         if not page:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/plugins/bibles/lib/upgrade.py 
new/OpenLP-2.0.5/openlp/plugins/bibles/lib/upgrade.py
--- old/OpenLP-2.0.4/openlp/plugins/bibles/lib/upgrade.py       2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/bibles/lib/upgrade.py       2014-06-28 
20:53:00.000000000 +0200
@@ -37,6 +37,7 @@
 __version__ = 1
 log = logging.getLogger(__name__)
 
+
 def upgrade_setup(metadata):
     """
     Set up the latest revision all tables, with reflection, needed for the
@@ -61,31 +62,37 @@
     metadata_table = metadata.tables[u'metadata']
     # Copy "Version" to "name" ("version" used by upgrade system)
     # TODO: Clean up in a subsequent release of OpenLP (like 2.0 final)
-    session.execute(insert(metadata_table).values(
-        key=u'name',
-        value=select(
-            [metadata_table.c.value],
-            metadata_table.c.key == u'Version'
-        ).as_scalar()
-    ))
+    if select([metadata_table.c.value], metadata_table.c.key == u'Version')\
+            .as_scalar().execute().fetchall():
+        session.execute(insert(metadata_table).values(
+            key=u'name',
+            value=select(
+                [metadata_table.c.value],
+                metadata_table.c.key == u'Version'
+            ).as_scalar()
+        ))
     # Copy "Copyright" to "copyright"
     # TODO: Clean up in a subsequent release of OpenLP (like 2.0 final)
-    session.execute(insert(metadata_table).values(
-        key=u'copyright',
-        value=select(
-            [metadata_table.c.value],
-            metadata_table.c.key == u'Copyright'
-        ).as_scalar()
-    ))
+    if select([metadata_table.c.value], metadata_table.c.key == u'Copyright')\
+            .as_scalar().execute().fetchall():
+        session.execute(insert(metadata_table).values(
+            key=u'copyright',
+            value=select(
+                [metadata_table.c.value],
+                metadata_table.c.key == u'Copyright'
+            ).as_scalar()
+        ))
     # Copy "Permissions" to "permissions"
     # TODO: Clean up in a subsequent release of OpenLP (like 2.0 final)
-    session.execute(insert(metadata_table).values(
-        key=u'permissions',
-        value=select(
-            [metadata_table.c.value],
-            metadata_table.c.key == u'Permissions'
-        ).as_scalar()
-    ))
+    if select([metadata_table.c.value], metadata_table.c.key == 
u'Permissions')\
+            .as_scalar().execute().fetchall():
+        session.execute(insert(metadata_table).values(
+            key=u'permissions',
+            value=select(
+                [metadata_table.c.value],
+                metadata_table.c.key == u'Permissions'
+            ).as_scalar()
+        ))
     # Copy "Bookname language" to "book_name_language"
     # TODO: Clean up in a subsequent release of OpenLP (like 2.0 final)
     value_count = session.execute(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OpenLP-2.0.4/openlp/plugins/presentations/lib/powerpointcontroller.py 
new/OpenLP-2.0.5/openlp/plugins/presentations/lib/powerpointcontroller.py
--- old/OpenLP-2.0.4/openlp/plugins/presentations/lib/powerpointcontroller.py   
2014-02-01 20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/presentations/lib/powerpointcontroller.py   
2014-06-28 20:53:00.000000000 +0200
@@ -37,6 +37,7 @@
     import pywintypes
 
 from presentationcontroller import PresentationController, PresentationDocument
+from openlp.core.lib.ui import UiStrings,  critical_error_message_box
 
 log = logging.getLogger(__name__)
 
@@ -100,7 +101,7 @@
                 if self.process.Presentations.Count > 0:
                     return
                 self.process.Quit()
-            except pywintypes.com_error:
+            except (AttributeError, pywintypes.com_error):
                 pass
             self.process = None
 
@@ -124,18 +125,28 @@
         Opens the PowerPoint file using the process created earlier.
         """
         log.debug(u'load_presentation')
-        if not self.controller.process or not self.controller.process.Visible:
-            self.controller.start_process()
         try:
+            if not self.controller.process or not 
self.controller.process.Visible:
+                self.controller.start_process()
             self.controller.process.Presentations.Open(self.filepath, False,
                 False, True)
+            self.presentation = self.controller.process.Presentations(
+                self.controller.process.Presentations.Count)
+            self.create_thumbnails()
+            # Powerpoint 2013 pops up when loading a file, so we minimize it 
again
+            if self.presentation.Application.Version == u'15.0':
+                try:
+                    self.presentation.Application.WindowState = 2
+                except:
+                    log.exception(u'Failed to minimize main powerpoint window')
+                    exc_type, exc_value, exc_traceback = sys.exc_info()
+                    log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            return True
         except pywintypes.com_error:
-            log.debug(u'PPT open failed')
+            log.exception(u'PPT open failed')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
             return False
-        self.presentation = self.controller.process.Presentations(
-            self.controller.process.Presentations.Count)
-        self.create_thumbnails()
-        return True
 
     def create_thumbnails(self):
         """
@@ -187,7 +198,6 @@
             return False
         return True
 
-
     def is_active(self):
         """
         Returns ``True`` if a presentation is currently active.
@@ -209,23 +219,35 @@
         Unblanks (restores) the presentation.
         """
         log.debug(u'unblank_screen')
-        self.presentation.SlideShowSettings.Run()
-        self.presentation.SlideShowWindow.View.State = 1
-        self.presentation.SlideShowWindow.Activate()
-        if self.presentation.Application.Version == u'14.0':
-            # Unblanking is broken in PowerPoint 2010, need to redisplay
-            slide = self.presentation.SlideShowWindow.View.CurrentShowPosition
-            click = self.presentation.SlideShowWindow.View.GetClickIndex()
-            self.presentation.SlideShowWindow.View.GotoSlide(slide)
-            if click:
-                self.presentation.SlideShowWindow.View.GotoClick(click)
+        try:
+            self.presentation.SlideShowSettings.Run()
+            self.presentation.SlideShowWindow.View.State = 1
+            self.presentation.SlideShowWindow.Activate()
+            if self.presentation.Application.Version == u'14.0':
+                # Unblanking is broken in PowerPoint 2010, need to redisplay
+                slide = 
self.presentation.SlideShowWindow.View.CurrentShowPosition
+                click = self.presentation.SlideShowWindow.View.GetClickIndex()
+                self.presentation.SlideShowWindow.View.GotoSlide(slide)
+                if click:
+                    self.presentation.SlideShowWindow.View.GotoClick(click)
+        except pywintypes.com_error:
+            log.exception(u'COM error while in unblank_screen')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            self.show_error_msg()
 
     def blank_screen(self):
         """
         Blanks the screen.
         """
         log.debug(u'blank_screen')
-        self.presentation.SlideShowWindow.View.State = 3
+        try:
+            self.presentation.SlideShowWindow.View.State = 3
+        except pywintypes.com_error:
+            log.exception(u'COM error while in blank_screen')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            self.show_error_msg()
 
     def is_blank(self):
         """
@@ -233,7 +255,13 @@
         """
         log.debug(u'is_blank')
         if self.is_active():
-            return self.presentation.SlideShowWindow.View.State == 3
+            try:
+                return self.presentation.SlideShowWindow.View.State == 3
+            except pywintypes.com_error:
+                log.exception(u'COM error while in is_blank')
+                exc_type, exc_value, exc_traceback = sys.exc_info()
+                log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+                return False
         else:
             return False
 
@@ -242,8 +270,12 @@
         Stops the current presentation and hides the output.
         """
         log.debug(u'stop_presentation')
-        self.presentation.SlideShowWindow.View.Exit()
-
+        try:
+            self.presentation.SlideShowWindow.View.Exit()
+        except pywintypes.com_error as e:
+            log.exception(u'COM error while in stop_presentation')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
     if os.name == u'nt':
         def start_presentation(self):
             """
@@ -264,39 +296,80 @@
             ppt_window = self.presentation.SlideShowSettings.Run()
             if not ppt_window:
                 return
-            ppt_window.Top = rect.y() * 72 / dpi
-            ppt_window.Height = rect.height() * 72 / dpi
-            ppt_window.Left = rect.x() * 72 / dpi
-            ppt_window.Width = rect.width() * 72 / dpi
-
+            try:
+                ppt_window.Top = rect.y() * 72 / dpi
+                ppt_window.Height = rect.height() * 72 / dpi
+                ppt_window.Left = rect.x() * 72 / dpi
+                ppt_window.Width = rect.width() * 72 / dpi
+            except AttributeError as e:
+                log.exception(u'AttributeError while in start_presentation')
+                exc_type, exc_value, exc_traceback = sys.exc_info()
+                log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            # Powerpoint 2013 pops up when starting a file, so we minimize it 
again
+            if self.presentation.Application.Version == u'15.0':
+                try:
+                    self.presentation.Application.WindowState = 2
+                except:
+                    log.exception(u'Failed to minimize main powerpoint window')
+                    exc_type, exc_value, exc_traceback = sys.exc_info()
+                    log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
 
     def get_slide_number(self):
         """
         Returns the current slide number.
         """
         log.debug(u'get_slide_number')
-        return self.presentation.SlideShowWindow.View.CurrentShowPosition
+        try:
+            ret = self.presentation.SlideShowWindow.View.CurrentShowPosition
+        except pywintypes.com_error as e:
+            ret = 0
+            log.exception(u'COM error while in get_slide_number')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            self.show_error_msg()
+        return ret
 
     def get_slide_count(self):
         """
         Returns total number of slides.
         """
         log.debug(u'get_slide_count')
-        return self.presentation.Slides.Count
+        try:
+            ret = self.presentation.Slides.Count
+        except pywintypes.com_error as e:
+            ret = 0
+            log.exception(u'COM error while in get_slide_count')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            self.show_error_msg()
+        return ret
 
     def goto_slide(self, slideno):
         """
         Moves to a specific slide in the presentation.
         """
         log.debug(u'goto_slide')
-        self.presentation.SlideShowWindow.View.GotoSlide(slideno)
+        try:
+            self.presentation.SlideShowWindow.View.GotoSlide(slideno)
+        except pywintypes.com_error as e:
+            log.exception(u'COM error while in goto_slide')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            self.show_error_msg()
 
     def next_step(self):
         """
         Triggers the next effect of slide on the running presentation.
         """
         log.debug(u'next_step')
-        self.presentation.SlideShowWindow.View.Next()
+        try:
+            self.presentation.SlideShowWindow.View.Next()
+        except pywintypes.com_error as e:
+            log.exception(u'COM error while in next_step')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            self.show_error_msg()
+            return
         if self.get_slide_number() > self.get_slide_count():
             self.previous_step()
 
@@ -305,7 +378,13 @@
         Triggers the previous slide on the running presentation.
         """
         log.debug(u'previous_step')
-        self.presentation.SlideShowWindow.View.Previous()
+        try:
+            self.presentation.SlideShowWindow.View.Previous()
+        except pywintypes.com_error as e:
+            log.exception(u'COM error while in previous_step')
+            exc_type, exc_value, exc_traceback = sys.exc_info()
+            log.exception(''.join(traceback.format_exception(exc_type, 
exc_value, exc_traceback)))
+            self.show_error_msg()
 
     def get_slide_text(self, slide_no):
         """
@@ -326,6 +405,16 @@
         return _get_text_from_shapes(
             self.presentation.Slides(slide_no).NotesPage.Shapes)
 
+    def show_error_msg(self):
+        """
+        Stop presentation and display an error message.
+        """
+        self.stop_presentation()
+        critical_error_message_box(UiStrings().Error, 
translate('PresentationPlugin.PowerpointDocument', 
+                                                                'An error 
occurred in the Powerpoint integration '
+                                                                'and the 
presentation will be stopped. '
+                                                                'Restart the 
presentation if you wish to present it.'))
+
 def _get_text_from_shapes(shapes):
     """
     Returns any text extracted from the shapes on a presentation slide.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OpenLP-2.0.4/openlp/plugins/songs/forms/editsongform.py 
new/OpenLP-2.0.5/openlp/plugins/songs/forms/editsongform.py
--- old/OpenLP-2.0.4/openlp/plugins/songs/forms/editsongform.py 2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/songs/forms/editsongform.py 2014-06-28 
20:53:00.000000000 +0200
@@ -723,19 +723,32 @@
                 return False
         cnt_errors = 0
         error_list = ''
-        verse_tag = []
-        verse_num = []
+        verse_tags = []
+        wrong_verse_tags = []
+        wrong_verse_nums = []
         for i in range(self.verseListWidget.rowCount()):
             item = self.verseListWidget.item(i, 0)
             tags = self.find_tags.findall(item.text())
+            
verse_tags.append(unicode(item.data(QtCore.Qt.UserRole).toString()))
             if self._validate_tags(tags) == False:
                 field = unicode(item.data(QtCore.Qt.UserRole).toString())
-                verse_tag.append(VerseType.translated_name(field[0]))
-                verse_num.append(field[1:])
+                wrong_verse_tags.append(VerseType.translated_name(field[0]))
+                wrong_verse_nums.append(field[1:])
                 cnt_errors += 1;
+        for tag in verse_tags:
+            if verse_tags.count(tag) > 26:
+                # lp#1310523: OpenLyrics allows only a-z variants of one verse:
+                # http://openlyrics.info/dataformat.html#verse-name
+                critical_error_message_box(
+                    message=translate('SongsPlugin.EditSongForm',
+                    'You have %(count)s verses named %(name)s %(number)s. '
+                    'You can have at most 26 verses with the same name' %
+                    {'count': verse_tags.count(tag), 'name': 
VerseType.translated_name(tag[0]),
+                     'number': tag[1:]}))
+                return False
         if cnt_errors > 0:
             for i in range(cnt_errors):
-                error_list += '%s %s' % (verse_tag[i], verse_num[i])
+                error_list += '%s %s' % (wrong_verse_tags[i], 
wrong_verse_nums[i])
                 if i < cnt_errors-1:
                     error_list += ', '
             critical_error_message_box(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/plugins/songs/lib/ewimport.py 
new/OpenLP-2.0.5/openlp/plugins/songs/lib/ewimport.py
--- old/OpenLP-2.0.4/openlp/plugins/songs/lib/ewimport.py       2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/songs/lib/ewimport.py       2014-06-28 
20:53:00.000000000 +0200
@@ -64,13 +64,23 @@
 
     def doImport(self):
         # Open the DB and MB files if they exist
-        import_source_mb = self.importSource.replace('.DB', '.MB')
+        import_source_mb = self.importSource.replace('.DB', 
'.MB').replace('.db', '.mb')
         if not os.path.isfile(self.importSource):
+            self.logError(self.importSource, translate(
+                'SongsPlugin.EasyWorshipSongImport',
+                'This file does not exist.'))
             return
         if not os.path.isfile(import_source_mb):
+            self.logError(self.importSource, translate(
+                'SongsPlugin.EasyWorshipSongImport', 
+                'Could not find the "Songs.MB" file. It must be in the same '
+                'folder as the "Songs.DB" file.'))
             return
         db_size = os.path.getsize(self.importSource)
         if db_size < 0x800:
+            self.logError(self.importSource, translate(
+                'SongsPlugin.EasyWorshipSongImport',
+                'This file is not a valid EasyWorship database.'))
             return
         db_file = open(self.importSource, 'rb')
         self.memoFile = open(import_source_mb, 'rb')
@@ -80,6 +90,9 @@
         if header_size != 0x800 or block_size < 1 or block_size > 4:
             db_file.close()
             self.memoFile.close()
+            self.logError(self.importSource, translate(
+                'SongsPlugin.EasyWorshipSongImport',
+                'This file is not a valid EasyWorship database.'))
             return
         # Take a stab at how text is encoded
         self.encoding = u'cp1252'
@@ -188,7 +201,15 @@
                         self.addAuthor(author_name.strip())
                 if words:
                     # Format the lyrics
-                    result = strip_rtf(words, self.encoding)
+                    result = None
+                    try:
+                        result = strip_rtf(words, self.encoding)
+                    except UnicodeDecodeError:
+                        # The unicode chars in the rtf was not escaped in the 
expected manner.
+                        self.logError(self.title, unicode(translate(
+                            'SongsPlugin.EasyWorshipSongImport',
+                            'Unexpected data formatting.')))
+                        continue
                     if result is None:
                         return
                     words, self.encoding = result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/plugins/songs/lib/upgrade.py 
new/OpenLP-2.0.5/openlp/plugins/songs/lib/upgrade.py
--- old/OpenLP-2.0.4/openlp/plugins/songs/lib/upgrade.py        2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/songs/lib/upgrade.py        2014-06-28 
20:53:00.000000000 +0200
@@ -30,18 +30,24 @@
 The :mod:`upgrade` module provides a way for the database and schema that is 
the
 backend for the Songs plugin
 """
+import logging
 
 from sqlalchemy import Column, Table, types
+from sqlalchemy.exc import NoSuchTableError, OperationalError
 from sqlalchemy.sql.expression import func
 from migrate.changeset.constraint import ForeignKeyConstraint
 
+log = logging.getLogger(__name__)
 __version__ = 3
 
+
 def upgrade_setup(metadata):
     """
     Set up the latest revision all tables, with reflection, needed for the
     upgrade process. If you want to drop a table, you need to remove it from
     here, and add it to your upgrade function.
+
+    :param metadata: The SQLAlchemy metadata object
     """
     tables = {
         u'authors': Table(u'authors', metadata, autoload=True),
@@ -66,16 +72,23 @@
     In order to facilitate this one-to-many relationship, a song_id column is
     added to the media_files table, and a weight column so that the media
     files can be ordered.
-    """
-    Table(u'media_files_songs', metadata, autoload=True).drop(checkfirst=True)
-    Column(u'song_id', types.Integer(), default=None)\
-        .create(table=tables[u'media_files'])
-    Column(u'weight', types.Integer(), default=0)\
-        .create(table=tables[u'media_files'])
-    if metadata.bind.url.get_dialect().name != 'sqlite':
-        # SQLite doesn't support ALTER TABLE ADD CONSTRAINT
-        ForeignKeyConstraint([u'song_id'], [u'songs.id'],
-            table=tables[u'media_files']).create()
+
+    :param session: An SQLAlchemy Session object
+    :param metadata: An SQLAlchemy MetaData object
+    :param tables: A dictionary of tables
+    """
+    try:
+        Table(u'media_files_songs', metadata, 
autoload=True).drop(checkfirst=True)
+        Column(u'song_id', types.Integer(), default=None)\
+            .create(table=tables[u'media_files'])
+        Column(u'weight', types.Integer(), default=0)\
+            .create(table=tables[u'media_files'])
+        if metadata.bind.url.get_dialect().name != 'sqlite':
+            # SQLite doesn't support ALTER TABLE ADD CONSTRAINT
+            ForeignKeyConstraint([u'song_id'], [u'songs.id'],
+                table=tables[u'media_files']).create()
+    except (NoSuchTableError, OperationalError):
+        log.info(u'Upgrade 1 has already been run, continue with upgrade')
 
 
 def upgrade_2(session, metadata, tables):
@@ -83,11 +96,18 @@
     Version 2 upgrade.
 
     This upgrade adds a create_date and last_modified date to the songs table
-    """
-    Column(u'create_date', types.DateTime(), default=func.now())\
-        .create(table=tables[u'songs'])
-    Column(u'last_modified', types.DateTime(), default=func.now())\
-        .create(table=tables[u'songs'])
+
+    :param session: An SQLAlchemy Session object
+    :param metadata: An SQLAlchemy MetaData object
+    :param tables: A dictionary of tables
+    """
+    try:
+        Column(u'create_date', types.DateTime(), default=func.now())\
+            .create(table=tables[u'songs'])
+        Column(u'last_modified', types.DateTime(), default=func.now())\
+            .create(table=tables[u'songs'])
+    except OperationalError:
+        log.info(u'Upgrade 2 has already been run, continue with upgrade')
 
 
 def upgrade_3(session, metadata, tables):
@@ -95,7 +115,13 @@
     Version 3 upgrade.
 
     This upgrade adds a temporary song flag to the songs table
-    """
-    Column(u'temporary', types.Boolean(), default=False)\
-        .create(table=tables[u'songs'])
 
+    :param session: An SQLAlchemy Session object
+    :param metadata: An SQLAlchemy MetaData object
+    :param tables: A dictionary of tables
+    """
+    try:
+        Column(u'temporary', types.Boolean(), default=False)\
+            .create(table=tables[u'songs'])
+    except OperationalError:
+        log.info(u'Upgrade 3 has already been run, continue with upgrade')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/plugins/songs/lib/xml.py 
new/OpenLP-2.0.5/openlp/plugins/songs/lib/xml.py
--- old/OpenLP-2.0.4/openlp/plugins/songs/lib/xml.py    2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/songs/lib/xml.py    2014-06-28 
20:53:00.000000000 +0200
@@ -360,9 +360,9 @@
             verse_tag = verse[0][u'type'][0].lower()
             verse_number = verse[0][u'label']
             verse_def = verse_tag + verse_number
-            verse_tags.append(verse_def)
             # Create the letter from the number of duplicates
-            verse[0][u'suffix'] = chr(96 + verse_tags.count(verse_def))
+            verse[0][u'suffix'] = chr(97 + (verse_tags.count(verse_def) % 26))
+            verse_tags.append(verse_def)
         # If the verse tag is a duplicate use the suffix letter
         for verse in verse_list:
             verse_tag = verse[0][u'type'][0].lower()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/openlp/plugins/songusage/lib/upgrade.py 
new/OpenLP-2.0.5/openlp/plugins/songusage/lib/upgrade.py
--- old/OpenLP-2.0.4/openlp/plugins/songusage/lib/upgrade.py    2014-02-01 
20:00:36.000000000 +0100
+++ new/OpenLP-2.0.5/openlp/plugins/songusage/lib/upgrade.py    2014-06-28 
20:53:00.000000000 +0200
@@ -30,11 +30,15 @@
 The :mod:`upgrade` module provides a way for the database and schema that is 
the
 backend for the SongsUsage plugin
 """
+import logging
 
 from sqlalchemy import Column, Table, types
+from sqlalchemy.exc import OperationalError
 
+log = logging.getLogger(__name__)
 __version__ = 1
 
+
 def upgrade_setup(metadata):
     """
     Set up the latest revision all tables, with reflection, needed for the
@@ -53,7 +57,10 @@
 
     This upgrade adds two new fields to the songusage database
     """
-    Column(u'plugin_name', types.Unicode(20), default=u'') \
-        .create(table=tables[u'songusage_data'], populate_default=True)
-    Column(u'source', types.Unicode(10), default=u'') \
-        .create(table=tables[u'songusage_data'], populate_default=True)
+    try:
+        Column(u'plugin_name', types.Unicode(20), default=u'') \
+            .create(table=tables[u'songusage_data'], populate_default=True)
+        Column(u'source', types.Unicode(10), default=u'') \
+            .create(table=tables[u'songusage_data'], populate_default=True)
+    except OperationalError:
+        log.info(u'Upgrade 1 has already been run, continue with upgrade')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OpenLP-2.0.4/resources/openlp.desktop 
new/OpenLP-2.0.5/resources/openlp.desktop
--- old/OpenLP-2.0.4/resources/openlp.desktop   2014-02-01 20:00:36.000000000 
+0100
+++ new/OpenLP-2.0.5/resources/openlp.desktop   2014-06-28 20:53:00.000000000 
+0200
@@ -1,7 +1,5 @@
 [Desktop Entry]
 Categories=AudioVideo;
-Comment[de]=
-Comment=
 Exec=openlp %F
 GenericName[de]=Church lyrics projection
 GenericName=Church lyrics projection
@@ -9,11 +7,7 @@
 MimeType=application/x-openlp-service;
 Name[de]=OpenLP
 Name=OpenLP
-Path=
 StartupNotify=true
 Terminal=false
 Type=Application
-X-DBUS-ServiceName=
-X-DBUS-StartupType=
-X-KDE-SubstituteUID=false
-X-KDE-Username=
+X-KDE-SubstituteUID=false
\ No newline at end of file

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to