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
1=== modified file 'openlp/plugins/songs/lib/cclifileimport.py'
2--- openlp/plugins/songs/lib/cclifileimport.py 2012-01-28 16:15:11 +0000
3+++ openlp/plugins/songs/lib/cclifileimport.py 2012-03-16 09:25:22 +0000
4@@ -159,6 +159,12 @@
5 song_author = u''
6 song_topics = u''
7 for line in textList:
8+ if line.startswith(u'[S '):
9+ ccli, line = line.split(u']', 1)
10+ if ccli.startswith(u'[S A'):
11+ self.ccliNumber = ccli[4:].strip()
12+ else:
13+ self.ccliNumber = ccli[3:].strip()
14 if line.startswith(u'Title='):
15 self.title = line[6:].strip()
16 elif line.startswith(u'Author='):
17@@ -166,9 +172,7 @@
18 elif line.startswith(u'Copyright='):
19 self.copyright = line[10:].strip()
20 elif line.startswith(u'Themes='):
21- song_topics = line[7:].strip()
22- elif line.startswith(u'[S A'):
23- self.ccliNumber = line[4:-3].strip()
24+ song_topics = line[7:].strip().replace(u' | ', u'/t')
25 elif line.startswith(u'Fields='):
26 # Fields contain single line indicating verse, chorus, etc,
27 # /t delimited, same as with words field. store seperately
28@@ -193,6 +197,7 @@
29 check_first_verse_line = True
30 verse_text = unicode(words_list[counter])
31 verse_text = verse_text.replace(u'/n', u'\n')
32+ verse_text = verse_text.replace(u' | ', u'\n')
33 verse_lines = verse_text.split(u'\n', 1)
34 if check_first_verse_line:
35 if verse_lines[0].startswith(u'(PRE-CHORUS'):
36@@ -243,7 +248,7 @@
37 <Empty line>
38 Song CCLI number
39 # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)
40- Song copyright
41+ Song copyright (if it begins ©, otherwise after authors)
42 # e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing
43 Song authors # e.g. Lenny LeBlanc | Paul Baloche
44 Licencing info
45@@ -322,11 +327,17 @@
46 #line_number=2, copyright
47 if line_number == 2:
48 line_number += 1
49- self.copyright = clean_line
50+ if clean_line.startswith(u'©'):
51+ self.copyright = clean_line
52+ else:
53+ song_author = clean_line
54 #n=3, authors
55 elif line_number == 3:
56 line_number += 1
57- song_author = clean_line
58+ if song_author:
59+ self.copyright = clean_line
60+ else:
61+ song_author = clean_line
62 #line_number=4, comments lines before last line
63 elif line_number == 4 and not clean_line.startswith(u'CCL'):
64 self.comments += clean_line