diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 11ba7e2dc..4718e289e 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -202,15 +202,6 @@ def check_item_selected(list_widget, message): return False return True - -class ThemeLevel(object): - """ - Provides an enumeration for the level a theme applies to - """ - Global = 1 - Service = 2 - Song = 3 - from eventreceiver import Receiver from settingsmanager import SettingsManager from plugin import PluginStatus, Plugin @@ -221,7 +212,7 @@ from serviceitem import ServiceItemType from serviceitem import ItemCapabilities from toolbar import OpenLPToolbar from dockwidget import OpenLPDockWidget -from themexmlhandler import ThemeXML +from theme import ThemeLevel, ThemeXML from renderer import Renderer from rendermanager import RenderManager from mediamanageritem import MediaManagerItem diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/theme.py similarity index 99% rename from openlp/core/lib/themexmlhandler.py rename to openlp/core/lib/theme.py index a5b4137ce..fe797279a 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/theme.py @@ -79,6 +79,14 @@ BLANK_THEME_XML = \ ''' +class ThemeLevel(object): + """ + Provides an enumeration for the level a theme applies to + """ + Global = 1 + Service = 2 + Song = 3 + class ThemeXML(object): """ A class to encapsulate the Theme XML. @@ -313,7 +321,6 @@ class ThemeXML(object): element.appendChild(value) background.appendChild(element) - def child_element(self, element, tag, value): """ Generic child element creator. @@ -414,4 +421,3 @@ class ThemeXML(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/lib/songxml.py b/openlp/plugins/songs/lib/songxml.py index 08234f093..2965c579b 100644 --- a/openlp/plugins/songs/lib/songxml.py +++ b/openlp/plugins/songs/lib/songxml.py @@ -34,10 +34,8 @@ from xml.etree.ElementTree import ElementTree, XML #sys.path.append(os.path.abspath(u'./../../../..')) #sys.path.append(os.path.abspath(os.path.join(u'.', u'..', u'..'))) - log = logging.getLogger(__name__) - class SongException(Exception): pass @@ -84,7 +82,9 @@ class _OpenSong(object): """ Initialize from given xml content """ - self.from_buffer(xmlContent) + self._set_from_xml(_BLANK_OPENSONG_XML, 'song') + if xmlContent: + self._set_from_xml(xmlContent, 'song') def _set_from_xml(self, xml, root_tag): """ @@ -147,16 +147,6 @@ class _OpenSong(object): result += u'_%s_' % getattr(self, attrib) return result - def _reset(self): - """Reset all song attributes""" - self._setFromXml(_BLANK_OPENSONG_XML, 'song') - - def from_buffer(self, xmlContent): - """Initialize from buffer(string) with xml content""" - self._reset() - if xmlContent: - self._setFromXml(xmlContent, 'song') - def get_author_list(self): """Convert author field to an authorlist diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 2be9573a2..4fa7424f9 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -136,4 +136,3 @@ class LyricsXML(object): song_output = u'' + \ u'%s' % lyrics_output return song_output -