Merge lp:~phill-ridout/openlp/bug1098075_2.0 into lp:openlp/2.0

Proposed by Phill
Status: Superseded
Proposed branch: lp:~phill-ridout/openlp/bug1098075_2.0
Merge into: lp:openlp/2.0
Diff against target: 63 lines (+16/-4)
4 files modified
openlp/plugins/songs/lib/__init__.py (+4/-1)
openlp/plugins/songs/lib/ewimport.py (+4/-1)
openlp/plugins/songs/lib/songproimport.py (+4/-1)
openlp/plugins/songs/lib/sundayplusimport.py (+4/-1)
To merge this branch: bzr merge lp:~phill-ridout/openlp/bug1098075_2.0
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Review via email: mp+146321@code.launchpad.net

This proposal has been superseded by a proposal from 2013-02-03.

Description of the change

Fixes bug 1098075 by returning None as requested by Raoul. Now for the correct target branch.

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

Looks alright to me. I probably would have named the return value "result", but that's neither here nor there.

review: Approve
2133. By Phill

changed variables to result

2134. By Phill

Reduced some code

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/songs/lib/__init__.py'
2--- openlp/plugins/songs/lib/__init__.py 2012-12-30 19:41:24 +0000
3+++ openlp/plugins/songs/lib/__init__.py 2013-02-03 20:19:19 +0000
4@@ -581,7 +581,10 @@
5 try:
6 encoding, default_encoding = get_encoding(font,
7 font_table, default_encoding, failed=failed)
8- out.append(chr(charcode).decode(encoding))
9+ if encoding:
10+ out.append(chr(charcode).decode(encoding))
11+ else:
12+ return None
13 except UnicodeDecodeError:
14 failed = True
15 else:
16
17=== modified file 'openlp/plugins/songs/lib/ewimport.py'
18--- openlp/plugins/songs/lib/ewimport.py 2012-12-30 19:41:24 +0000
19+++ openlp/plugins/songs/lib/ewimport.py 2013-02-03 20:19:19 +0000
20@@ -180,7 +180,10 @@
21 self.addAuthor(author_name.strip())
22 if words:
23 # Format the lyrics
24- words, self.encoding = strip_rtf(words, self.encoding)
25+ words = strip_rtf(words, self.encoding)
26+ if words is None:
27+ return
28+ words, self.encoding = words
29 verse_type = VerseType.Tags[VerseType.Verse]
30 for verse in SLIDE_BREAK_REGEX.split(words):
31 verse = verse.strip()
32
33=== modified file 'openlp/plugins/songs/lib/songproimport.py'
34--- openlp/plugins/songs/lib/songproimport.py 2012-12-30 19:41:24 +0000
35+++ openlp/plugins/songs/lib/songproimport.py 2013-02-03 20:19:19 +0000
36@@ -109,7 +109,10 @@
37 self.finish()
38 return
39 if u'rtf1' in text:
40- text, self.encoding = strip_rtf(text, self.encoding)
41+ text = strip_rtf(text, self.encoding)
42+ if text is None:
43+ return
44+ text, self.encoding = text
45 text = text.rstrip()
46 if not text:
47 return
48
49=== modified file 'openlp/plugins/songs/lib/sundayplusimport.py'
50--- openlp/plugins/songs/lib/sundayplusimport.py 2012-12-30 19:41:24 +0000
51+++ openlp/plugins/songs/lib/sundayplusimport.py 2013-02-03 20:19:19 +0000
52@@ -150,7 +150,10 @@
53 verse_type = HOTKEY_TO_VERSE_TYPE[value]
54 if name == 'rtf':
55 value = self.unescape(value)
56- verse, self.encoding = strip_rtf(value, self.encoding)
57+ verse = strip_rtf(value, self.encoding)
58+ if verse is None:
59+ return
60+ verse, self.encoding = verse
61 lines = verse.strip().split('\n')
62 # If any line inside any verse contains CCLI or
63 # only Public Domain, we treat this as special data:

Subscribers

People subscribed via source and target branches