A real fix this time!

This commit is contained in:
Philip Ridout 2012-07-15 09:03:37 +01:00
parent b37bf5022c
commit ae37f749f1

View File

@ -483,9 +483,11 @@ class FoilPresenter(object):
# Process verse order # Process verse order
verse_order = [] verse_order = []
verse_strophenr = [] verse_strophenr = []
if hasattr(foilpresenterfolie, u'reihenfolge.strophennummer'): try:
for strophennummer in foilpresenterfolie.reihenfolge.strophennummer: for strophennummer in foilpresenterfolie.reihenfolge.strophennummer:
verse_strophenr.append(strophennummer) verse_strophenr.append(strophennummer)
except AttributeError:
pass
# Currently we do not support different "parts"! # Currently we do not support different "parts"!
if u'0' in temp_verse_order: if u'0' in temp_verse_order:
for vers in temp_verse_order_backup: for vers in temp_verse_order_backup:
@ -539,16 +541,15 @@ class FoilPresenter(object):
``song`` ``song``
The song object. The song object.
""" """
if hasattr(foilpresenterfolie, u'titel.titelstring'): try:
for title_string in foilpresenterfolie.titel.titelstring: for title_string in foilpresenterfolie.titel.titelstring:
if not song.title: if not song.title:
song.title = self._child(title_string) song.title = self._child(title_string)
song.alternate_title = u'' song.alternate_title = u''
else: else:
song.alternate_title = self._child(title_string) song.alternate_title = self._child(title_string)
else: except AttributeError:
# Use first line of first verse # Use first line of first verse
#if hasattr(foilpresenterfolie, u'strophen.strophe'):
first_line = self._child(foilpresenterfolie.strophen.strophe.text_) first_line = self._child(foilpresenterfolie.strophen.strophe.text_)
song.title = first_line.split('\n')[0] song.title = first_line.split('\n')[0]