Merge lp:~trb143/openlp/bug-884533 into lp:openlp

Proposed by Tim Bentley
Status: Merged
Approved by: Raoul Snyman
Approved revision: 1758
Merged at revision: 1796
Proposed branch: lp:~trb143/openlp/bug-884533
Merge into: lp:openlp
Diff against target: 17 lines (+6/-1)
1 file modified
openlp/core/lib/renderer.py (+6/-1)
To merge this branch: bzr merge lp:~trb143/openlp/bug-884533
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Review via email: mp+81076@code.launchpad.net

This proposal supersedes a proposal from 2011-11-02.

Description of the change

Fix case where two [---] lines are next to each other.

To post a comment you must log in.
Revision history for this message
Frank (frankopmeer) wrote : Posted in a previous version of this proposal

note: there was a second method. to get the same crash.
when you use [---] in a line. like:
songline one [---] this also gives a crash, end of songline one.

Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal

@Tim:
I think we should also make sure that we do not save such wrong lyrics (Song Editor).

Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

That could be hard see the follow up comment on the bug.
This also fixes that!

Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/renderer.py'
2--- openlp/core/lib/renderer.py 2011-10-16 14:40:46 +0000
3+++ openlp/core/lib/renderer.py 2011-11-02 20:39:25 +0000
4@@ -250,7 +250,12 @@
5 # render the first virtual slide.
6 text_contains_break = u'[---]' in text
7 if text_contains_break:
8- text_to_render, text = text.split(u'\n[---]\n', 1)
9+ try:
10+ text_to_render, text = \
11+ text.split(u'\n[---]\n', 1)
12+ except:
13+ text_to_render = text.split(u'\n[---]\n')[0]
14+ text = u''
15 else:
16 text_to_render = text
17 text = u''