From aa390e9831a65ff73781ab7de2d0147bea748404 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 3 Jul 2010 22:50:42 +0100 Subject: [PATCH] Cleanups --- openlp/core/theme/theme.py | 1 - openlp/plugins/songs/forms/editsongform.py | 1 - openlp/plugins/songs/lib/songxmlhandler.py | 8 ++++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index 6cddbcb45..82e7ac2cc 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -222,4 +222,3 @@ class Theme(object): if key[0:1] != u'_': theme_strings.append(u'%30s : %s' % (key, getattr(self, key))) return u'\n'.join(theme_strings) - diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 663b510d3..c0db7b741 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -664,4 +664,3 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): log.debug(u'processTitle') self.song.search_title = \ re.sub(r'[\'"`,;:(){}?]+', u'', unicode(self.song.search_title)) - diff --git a/openlp/plugins/songs/lib/songxmlhandler.py b/openlp/plugins/songs/lib/songxmlhandler.py index 395777c17..9237c7622 100644 --- a/openlp/plugins/songs/lib/songxmlhandler.py +++ b/openlp/plugins/songs/lib/songxmlhandler.py @@ -38,10 +38,8 @@ The basic XML is of the format:: """ import logging -import StringIO from lxml import etree, objectify -#from lxml.etree import SubElement, XMLSyntaxError, dump log = logging.getLogger(__name__) @@ -86,13 +84,15 @@ class SongXMLBuilder(object): """ Debugging aid to dump XML so that we can see what we have. """ - return etree.tostring(self.song_xml, pretty_print=True) + return etree.tostring(self.song_xml, encoding=u'UTF-8', + xml_declaration=True, pretty_print=True) def extract_xml(self): """ Extract our newly created XML song. """ - return etree.tostring(self.song_xml, encoding=u'utf-8') + return etree.tostring(self.song_xml, encoding=u'UTF-8', + xml_declaration=True) class SongXMLParser(object):