From 443962501353546a8efb3cccce8664a1f7f1ca8a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 5 Jul 2010 12:39:48 +0100 Subject: [PATCH] Fixes and cleanups --- openlp/core/lib/db.py | 4 ++-- openlp/core/lib/renderer.py | 1 + openlp/core/lib/rendermanager.py | 3 +-- openlp/core/lib/theme.py | 8 +------- openlp/plugins/songs/lib/xml.py | 7 ++++--- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index f20f3ab38..8acc79541 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -189,7 +189,7 @@ class Manager(object): Any parameters to order the returned objects by. Defaults to None. """ query = self.session.query(object_class) - if order_by_ref: + if order_by_ref is not None: return query.order_by(order_by_ref).all() return query.all() @@ -208,7 +208,7 @@ class Manager(object): Any parameters to order the returned objects by. Defaults to None. """ query = self.session.query(object_class).filter(filter_clause) - if order_by_ref: + if order_by_ref is not None: return query.order_by(order_by_ref).all() return query.all() diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index c7f96528c..04c854afa 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -29,6 +29,7 @@ format it for the output display. import logging from PyQt4 import QtGui, QtCore + from openlp.core.lib import resize_image log = logging.getLogger(__name__) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 431f74564..b3c46a5eb 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -27,8 +27,7 @@ import logging from PyQt4 import QtCore -from renderer import Renderer -from openlp.core.lib import ThemeLevel +from openlp.core.lib import Renderer, ThemeLevel log = logging.getLogger(__name__) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index fe797279a..3f7b613d4 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -358,14 +358,8 @@ class ThemeXML(object): ``xml`` The XML string to parse. """ - self.base_parse_xml() - self.parse_xml(xml) - - def base_parse_xml(self): - """ - Pull in the blank theme XML as a starting point. - """ self.parse_xml(BLANK_THEME_XML) + self.parse_xml(xml) def parse_xml(self, xml): """ diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 41490b8fd..e73e020af 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -109,8 +109,10 @@ class SongXMLParser(object): The XML of the song to be parsed. """ self.song_xml = None + if xml[:5] == u'