Merge lp:~j-corwin/openlp/bug-929825 into lp:openlp

Proposed by Jonathan Corwin
Status: Merged
Merged at revision: 1906
Proposed branch: lp:~j-corwin/openlp/bug-929825
Merge into: lp:openlp
Diff against target: 64 lines (+17/-6)
1 file modified
openlp/plugins/songs/lib/cclifileimport.py (+17/-6)
To merge this branch: bzr merge lp:~j-corwin/openlp/bug-929825
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Raoul Snyman Approve
Review via email: mp+97815@code.launchpad.net

Description of the change

Fix a few songselect file format issues

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Looks OK to me, though I don't have any files to test it out with.

review: Approve
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/plugins/songs/lib/cclifileimport.py'
--- openlp/plugins/songs/lib/cclifileimport.py 2012-01-28 16:15:11 +0000
+++ openlp/plugins/songs/lib/cclifileimport.py 2012-03-16 09:25:22 +0000
@@ -159,6 +159,12 @@
159 song_author = u''159 song_author = u''
160 song_topics = u''160 song_topics = u''
161 for line in textList:161 for line in textList:
162 if line.startswith(u'[S '):
163 ccli, line = line.split(u']', 1)
164 if ccli.startswith(u'[S A'):
165 self.ccliNumber = ccli[4:].strip()
166 else:
167 self.ccliNumber = ccli[3:].strip()
162 if line.startswith(u'Title='):168 if line.startswith(u'Title='):
163 self.title = line[6:].strip()169 self.title = line[6:].strip()
164 elif line.startswith(u'Author='):170 elif line.startswith(u'Author='):
@@ -166,9 +172,7 @@
166 elif line.startswith(u'Copyright='):172 elif line.startswith(u'Copyright='):
167 self.copyright = line[10:].strip()173 self.copyright = line[10:].strip()
168 elif line.startswith(u'Themes='):174 elif line.startswith(u'Themes='):
169 song_topics = line[7:].strip()175 song_topics = line[7:].strip().replace(u' | ', u'/t')
170 elif line.startswith(u'[S A'):
171 self.ccliNumber = line[4:-3].strip()
172 elif line.startswith(u'Fields='):176 elif line.startswith(u'Fields='):
173 # Fields contain single line indicating verse, chorus, etc,177 # Fields contain single line indicating verse, chorus, etc,
174 # /t delimited, same as with words field. store seperately178 # /t delimited, same as with words field. store seperately
@@ -193,6 +197,7 @@
193 check_first_verse_line = True197 check_first_verse_line = True
194 verse_text = unicode(words_list[counter])198 verse_text = unicode(words_list[counter])
195 verse_text = verse_text.replace(u'/n', u'\n')199 verse_text = verse_text.replace(u'/n', u'\n')
200 verse_text = verse_text.replace(u' | ', u'\n')
196 verse_lines = verse_text.split(u'\n', 1)201 verse_lines = verse_text.split(u'\n', 1)
197 if check_first_verse_line:202 if check_first_verse_line:
198 if verse_lines[0].startswith(u'(PRE-CHORUS'):203 if verse_lines[0].startswith(u'(PRE-CHORUS'):
@@ -243,7 +248,7 @@
243 <Empty line>248 <Empty line>
244 Song CCLI number249 Song CCLI number
245 # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)250 # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)
246 Song copyright251 Song copyright (if it begins ©, otherwise after authors)
247 # e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing252 # e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing
248 Song authors # e.g. Lenny LeBlanc | Paul Baloche253 Song authors # e.g. Lenny LeBlanc | Paul Baloche
249 Licencing info254 Licencing info
@@ -322,11 +327,17 @@
322 #line_number=2, copyright327 #line_number=2, copyright
323 if line_number == 2:328 if line_number == 2:
324 line_number += 1329 line_number += 1
325 self.copyright = clean_line330 if clean_line.startswith(u'©'):
331 self.copyright = clean_line
332 else:
333 song_author = clean_line
326 #n=3, authors334 #n=3, authors
327 elif line_number == 3:335 elif line_number == 3:
328 line_number += 1336 line_number += 1
329 song_author = clean_line337 if song_author:
338 self.copyright = clean_line
339 else:
340 song_author = clean_line
330 #line_number=4, comments lines before last line341 #line_number=4, comments lines before last line
331 elif line_number == 4 and not clean_line.startswith(u'CCL'):342 elif line_number == 4 and not clean_line.startswith(u'CCL'):
332 self.comments += clean_line343 self.comments += clean_line