From e33628e049021058f246160171f363ea8093ab3d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 15 Jan 2011 11:56:40 +0000 Subject: [PATCH] Merge fixes --- openlp/core/lib/__init__.py | 1 + openlp/core/ui/thememanager.py | 34 +++++++++++++------------- openlp/plugins/bibles/lib/mediaitem.py | 8 +++--- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 7ad377817..76d7c0617 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -293,6 +293,7 @@ def clean_tags(text): Remove Tags from text for display """ text = text.replace(u'
', u'\n') + text = text.replace(u' ', u' ') for tag in DisplayTags.get_html_tags(): text = text.replace(tag[u'start tag'], u'') text = text.replace(tag[u'end tag'], u'') diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 81e191396..b0f3d6147 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -527,7 +527,7 @@ class ThemeManager(QtGui.QWidget): log.exception(u'Theme XML is not UTF-8 ' u'encoded.') break - filexml = self.checkVersionAndConvert(xml_data) + filexml = self._checkVersionAndConvert(xml_data) outfile = open(fullpath, u'w') outfile.write(filexml.encode(u'utf-8')) else: @@ -557,22 +557,6 @@ class ThemeManager(QtGui.QWidget): if outfile: outfile.close() - def checkVersionAndConvert(self, xml_data): - """ - Check if a theme is from OpenLP version 1 - - ``xml_data`` - Theme XML to check the version of - """ - log.debug(u'checkVersion1 ') - theme = xml_data.encode(u'ascii', u'xmlcharrefreplace') - tree = ElementTree(element=XML(theme)).getroot() - # look for old version 1 tags - if tree.find(u'BackgroundType') is None: - return xml_data - else: - return self._migrateVersion122(xml_data) - def checkIfThemeExists(self, themeName): """ Check if theme already exists and displays error message @@ -667,6 +651,22 @@ class ThemeManager(QtGui.QWidget): image = os.path.join(self.path, theme + u'.png') return image + def _checkVersionAndConvert(self, xml_data): + """ + Check if a theme is from OpenLP version 1 + + ``xml_data`` + Theme XML to check the version of + """ + log.debug(u'checkVersion1 ') + theme = xml_data.encode(u'ascii', u'xmlcharrefreplace') + tree = ElementTree(element=XML(theme)).getroot() + # look for old version 1 tags + if tree.find(u'BackgroundType') is None: + return xml_data + else: + return self._migrateVersion122(xml_data) + def _createThemeFromXml(self, themeXml, path): """ Return a theme object using information parsed from XML diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 40deb2244..20adc97fe 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -716,21 +716,21 @@ class BibleMediaItem(MediaManagerItem): second_copyright, second_permissions) if footer not in raw_footer: raw_footer.append(footer) - bible_text = u'%s%s\n\n%s%s' % (verse_text, text, + bible_text = u'%s %s\n\n%s%s' % (verse_text, text, verse_text, second_text) raw_slides.append(bible_text.rstrip()) bible_text = u'' # If we are 'Verse Per Slide' then create a new slide. elif self.parent.settings_tab.layout_style == 0: - bible_text = u'%s%s' % (verse_text, text) + bible_text = u'%s %s' % (verse_text, text) raw_slides.append(bible_text.rstrip()) bible_text = u'' # If we are 'Verse Per Line' then force a new line. elif self.parent.settings_tab.layout_style == 1: - bible_text = u'%s %s%s\n' % (bible_text, verse_text, text) + bible_text = u'%s %s %s\n' % (bible_text, verse_text, text) # We have to be 'Continuous'. else: - bible_text = u'%s %s%s\n' % (bible_text, verse_text, text) + bible_text = u'%s %s %s\n' % (bible_text, verse_text, text) if not old_item: start_item = item elif self.checkTitle(item, old_item):