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

Proposed by Phill
Status: Merged
Approved by: Tim Bentley
Approved revision: 2134
Merged at revision: 2131
Proposed branch: lp:~phill-ridout/openlp/bug1098075_2.0
Merge into: lp:openlp/2.0
Diff against target: 60 lines (+14/-3)
4 files modified
openlp/plugins/songs/lib/__init__.py (+2/-0)
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
Tim Bentley Approve
Raoul Snyman Approve
Review via email: mp+146488@code.launchpad.net

This proposal supersedes a proposal from 2013-02-04.

Description of the change

Fixes bug 1098075 by returning None as requested by Raoul. Now for the correct target branch.
Changed the return var to result
A little tweak to reduce code

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

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

review: Approve
Revision history for this message
Phill (phill-ridout) wrote :

I'm done resubmitting. Promise. Sorry

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

Subscribers

People subscribed via source and target branches