diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 751e29ccf..495c8983f 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -30,7 +30,7 @@ from xml.etree.ElementTree import ElementTree, XML from openlp.core.lib import str_to_bool -blankthemexml = \ +BLANK_THEME_XML = \ ''' BlankStyle @@ -356,7 +356,7 @@ class ThemeXML(object): """ Pull in the blank theme XML as a starting point. """ - self.parse_xml(blankthemexml) + self.parse_xml(BLANK_THEME_XML) def parse_xml(self, xml): """ diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index a2508aa25..f63ee4c26 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -28,13 +28,13 @@ import types from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtGui -DelphiColors = {"clRed":0xFF0000, - "clBlue":0x0000FF, - "clYellow":0xFFFF00, - "clBlack":0x000000, - "clWhite":0xFFFFFF} +DELPHI_COLORS = {"clRed":0xFF0000, + "clBlue":0x0000FF, + "clYellow":0xFFFF00, + "clBlack":0x000000, + "clWhite":0xFFFFFF} -blankstylexml = \ +BLANK_STYLE_XML = \ ''' BlankStyle @@ -97,7 +97,7 @@ class Theme(object): 1 - lyrics """ # init to defaults - self._set_from_XML(blankstylexml) + self._set_from_XML(BLANK_STYLE_XML) self._set_from_XML(xml) def _get_as_string(self): @@ -128,8 +128,8 @@ class Theme(object): val = int(element_text[1:], 16) except ValueError: # nope pass - elif DelphiColors.has_key(element_text): - val = DelphiColors[element_text] + elif DELPHI_COLORS.has_key(element_text): + val = DELPHI_COLORS[element_text] delphiColorChange = True else: try: diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index c0eb7e5f1..f2cb37b51 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -231,7 +231,10 @@ class PresentationDocument(object): Cleans up/deletes any controller specific files created for a file, e.g. thumbnails """ - shutil.rmtree(self.thumbnailpath) + try: + shutil.rmtree(self.thumbnailpath) + except OSError: + log.exception(u'Failed to delete presentation controller files') def store_filename(self, presentation): """ @@ -388,3 +391,4 @@ class PresentationDocument(object): The slide the notes are required for, starting at 1 """ return '' + diff --git a/openlp/plugins/songs/lib/songxml.py b/openlp/plugins/songs/lib/songxml.py index 0979eb2b8..102fd3260 100644 --- a/openlp/plugins/songs/lib/songxml.py +++ b/openlp/plugins/songs/lib/songxml.py @@ -60,7 +60,7 @@ class SongFeatureError(SongException): # TODO: Song: Import ChangingSong # TODO: Song: Export ChangingSong -_blankOpenSongXml = \ +_BLANK_OPENSONG_XML = \ ''' @@ -84,7 +84,7 @@ class _OpenSong(XmlRootClass): def _reset(self): """Reset all song attributes""" - self._setFromXml(_blankOpenSongXml, 'song') + self._setFromXml(_BLANK_OPENSONG_XML, 'song') def from_buffer(self, xmlContent): """Initialize from buffer(string) with xml content"""