From ebf3ce587d477d35970a7cce8f8547a092d3898c Mon Sep 17 00:00:00 2001 From: Martin Thompson Date: Wed, 15 Sep 2010 21:12:03 +0100 Subject: [PATCH] Tweaks from review --- .bzrignore | 2 -- openlp/plugins/songs/lib/opensongimport.py | 15 ++++++++------- openlp/plugins/songs/lib/songimport.py | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.bzrignore b/.bzrignore index fd38bd412..073fb531a 100644 --- a/.bzrignore +++ b/.bzrignore @@ -19,5 +19,3 @@ _eric4project *.qm openlp/core/resources.py.old *.qm -import_lots_errors.txt -../import_lots_errors.txt diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index b0a21271a..bf384e6f0 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -119,7 +119,7 @@ class OpenSongImport(SongImport): multiple opensong files. If `self.commit` is set False, the import will not be committed to the database (useful for test scripts). """ - success = False + success = True numfiles = 0 for filename in self.filenames: ext = os.path.splitext(filename)[1] @@ -157,7 +157,8 @@ class OpenSongImport(SongImport): if self.stop_import_flag: success = False break - else: # not a zipfile + else: + # not a zipfile log.info('Direct import %s', filename) self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', @@ -244,9 +245,7 @@ class OpenSongImport(SongImport): if thisline[0].isdigit(): versenum = thisline[0] words = thisline[1:].strip() - if words is None:# and \ - #versenum is not None and \ - #versetype is not None: + if words is None: words = thisline if not versenum: versenum = u'1' @@ -295,9 +294,11 @@ class OpenSongImport(SongImport): log.warn(u'No verse order available (either explicit or inferred) for %s, skipping.', self.title) for tag in order: if tag[0].isdigit(): - tag = u'V' + tag # Assume it's a verse if it has no prefix + # Assume it's a verse if it has no prefix + tag = u'V' + tag elif not re.search('\d+', tag): - tag = tag + u'1' # Assume it's no.1 if there's no digits + # Assume it's no.1 if there's no digits + tag = tag + u'1' if not versetags.has_key(tag): log.info(u'Got order %s but not in versetags, dropping this item from presentation order', tag) else: diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index a3085bb1c..dcf4ed8d8 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -291,7 +291,6 @@ class SongImport(QtCore.QObject): versetag = newversetag sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext) song.search_lyrics += u' ' + self.remove_punctuation(versetext) - # print verses_changed_to_other song.lyrics = unicode(sxml.extract_xml(), u'utf-8') for i, current_verse_tag in enumerate(self.verse_order_list): if verses_changed_to_other.has_key(current_verse_tag):