From 3a13ebdce76e963160a8a12ebd128592c0718ce9 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 28 Nov 2010 14:41:50 +0100 Subject: [PATCH] remove strike tags in songBeamer files; decent check for digits --- openlp/plugins/songs/lib/songbeamerimport.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index a743faafc..44e8805c9 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -153,7 +153,9 @@ class SongBeamerImport(SongImport): (u'', u'{sb}'), (u'', u'{/sb}'), (u'', u''), - (u'', u'') + (u'', u''), + (u'', u''), + (u'', u'') ] for pair in tag_pairs: self.current_verse = self.current_verse.replace(pair[0], pair[1]) @@ -264,8 +266,8 @@ class SongBeamerImport(SongImport): def check_verse_marks(self, line): """ - Check and add the verse's MarkType. Returns ``True`` if the given mark - is correct otherwise ``False``. + Check and add the verse's MarkType. Returns ``True`` if the given line + contains a correct verse mark otherwise ``False``. ``line`` The line to check for marks (unicode). @@ -275,10 +277,8 @@ class SongBeamerImport(SongImport): self.current_verse_type = SongBeamerTypes.MarkTypes[marks[0]] if len(marks) == 2: # If we have a digit, we append it to current_verse_type. - try: - self.current_verse_type += u'%s' % int(marks[1]) - except ValueError: - pass + if marks[1].isdigit(): + self.current_verse_type += marks[1] return True else: return False