← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/trivialfixes into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Fixes and cleanups
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/29200
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/lib/db.py'
--- openlp/core/lib/db.py	2010-07-01 10:31:37 +0000
+++ openlp/core/lib/db.py	2010-07-05 11:57:29 +0000
@@ -189,7 +189,7 @@
             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 @@
             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()
 

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2010-06-29 15:25:24 +0000
+++ openlp/core/lib/renderer.py	2010-07-05 11:57:29 +0000
@@ -29,6 +29,7 @@
 import logging
 
 from PyQt4 import QtGui, QtCore
+
 from openlp.core.lib import resize_image
 
 log = logging.getLogger(__name__)

=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py	2010-05-29 19:50:50 +0000
+++ openlp/core/lib/rendermanager.py	2010-07-05 11:57:29 +0000
@@ -27,8 +27,7 @@
 
 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__)
 

=== modified file 'openlp/core/lib/theme.py'
--- openlp/core/lib/theme.py	2010-07-03 13:26:29 +0000
+++ openlp/core/lib/theme.py	2010-07-05 11:57:29 +0000
@@ -358,15 +358,9 @@
         ``xml``
             The XML string to parse.
         """
-        self.base_parse_xml()
+        self.parse_xml(BLANK_THEME_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)
-
     def parse_xml(self, xml):
         """
         Parse an XML string.

=== modified file 'openlp/plugins/songs/lib/xml.py'
--- openlp/plugins/songs/lib/xml.py	2010-07-04 16:40:53 +0000
+++ openlp/plugins/songs/lib/xml.py	2010-07-05 11:57:29 +0000
@@ -109,8 +109,10 @@
             The XML of the song to be parsed.
         """
         self.song_xml = None
+        if xml[:5] == u'<?xml':
+            xml = xml[38:]
         try:
-            self.song_xml = objectify.fromstring(str(xml))
+            self.song_xml = objectify.fromstring(xml)
         except etree.XMLSyntaxError:
             log.exception(u'Invalid xml %s', xml)
 
@@ -125,8 +127,7 @@
             if element.tag == u'verse':
                 if element.text is None:
                     element.text = u''
-                verse_list.append([element.attrib,
-                    unicode(element.text).decode('unicode-escape')])
+                verse_list.append([element.attrib, unicode(element.text)])
         return verse_list
 
     def dump_xml(self):


Follow ups