openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #20886
[Merge] lp:~googol/openlp/print-func into lp:openlp
Andreas Preikschat has proposed merging lp:~googol/openlp/print-func into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~googol/openlp/print-func/+merge/172245
- Converted last print statements to print functions.
- Removed old test
I removed the test, because the test did not work:
[andreas@andylaptop trunk]$ python2 openlp/plugins/songs/lib/test/test_opensongimport.py
Traceback (most recent call last):
File "openlp/plugins/songs/lib/test/test_opensongimport.py", line 30, in <module>
from openlp.plugins.songs.lib.opensongimport import OpenSongImport
File "/home/andreas/Projects/OpenLP/trunk/openlp/plugins/songs/lib/__init__.py", line 147, in <module>
class VerseType(object):
File "/home/andreas/Projects/OpenLP/trunk/openlp/plugins/songs/lib/__init__.py", line 178, in VerseType
translated_tags = [name[0].lower() for name in translated_names]
AttributeError: 'QString' object has no attribute 'lower'
I added the sip code and the next traceback was this. So I thought I should remove it (nobody noticed until now, nobody will miss this code).
Traceback (most recent call last):
File "openlp/plugins/songs/lib/test/test_opensongimport.py", line 140, in <module>
test()
File "openlp/plugins/songs/lib/test/test_opensongimport.py", line 60, in test
manager = Manager(u'songs', init_schema)
File "/home/andreas/Projects/OpenLP/print-func/openlp/core/lib/db.py", line 188, in __init__
db_type = settings.value(u'db type')
File "/home/andreas/Projects/OpenLP/print-func/openlp/core/lib/settings.py", line 429, in value
default_value = Settings.__default_settings__[self.group() + u'/' + key]
KeyError: u'songs/db type'
--
https://code.launchpad.net/~googol/openlp/print-func/+merge/172245
Your team OpenLP Core is requested to review the proposed merge of lp:~googol/openlp/print-func into lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/pptviewlib/ppttest.py'
--- openlp/plugins/presentations/lib/pptviewlib/ppttest.py 2013-02-04 21:26:27 +0000
+++ openlp/plugins/presentations/lib/pptviewlib/ppttest.py 2013-06-30 18:10:33 +0000
@@ -174,13 +174,13 @@
int(self.widthEdit.text()), int(self.heightEdit.text()))
filename = str(self.pptEdit.text().replace(u'/', u'\\'))
folder = str(self.folderEdit.text().replace(u'/', u'\\'))
- print filename, folder
+ print(filename, folder)
self.pptid = self.pptdll.OpenPPT(filename, None, rect, folder)
- print u'id: ' + unicode(self.pptid)
+ print(u'id: ' + unicode(self.pptid))
if oldid >= 0:
self.pptdll.ClosePPT(oldid);
slides = self.pptdll.GetSlideCount(self.pptid)
- print u'slidecount: ' + unicode(slides)
+ print(u'slidecount: ' + unicode(slides))
self.total.setNum(self.pptdll.GetSlideCount(self.pptid))
self.updateCurrSlide()
@@ -188,14 +188,14 @@
if self.pptid < 0:
return
slide = unicode(self.pptdll.GetCurrentSlide(self.pptid))
- print u'currslide: ' + slide
+ print(u'currslide: ' + slide)
self.slideEdit.setText(slide)
app.processEvents()
def gotoClick(self):
if self.pptid < 0:
return
- print self.slideEdit.text()
+ print(self.slideEdit.text())
self.pptdll.GotoSlide(self.pptid, int(self.slideEdit.text()))
self.updateCurrSlide()
app.processEvents()
@@ -207,7 +207,7 @@
if __name__ == '__main__':
pptdll = cdll.LoadLibrary(r'pptviewlib.dll')
pptdll.SetDebug(1)
- print u'Begin...'
+ print(u'Begin...')
app = QtGui.QApplication(sys.argv)
window = PPTViewer()
window.pptdll = pptdll
=== removed file 'openlp/plugins/songs/lib/test/test_opensongimport.py'
--- openlp/plugins/songs/lib/test/test_opensongimport.py 2012-12-29 20:56:56 +0000
+++ openlp/plugins/songs/lib/test/test_opensongimport.py 1970-01-01 00:00:00 +0000
@@ -1,131 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
-
-###############################################################################
-# OpenLP - Open Source Lyrics Projection #
-# --------------------------------------------------------------------------- #
-# Copyright (c) 2008-2013 Raoul Snyman #
-# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
-# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
-# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
-# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
-# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
-# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
-# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
-# --------------------------------------------------------------------------- #
-# This program is free software; you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the Free #
-# Software Foundation; version 2 of the License. #
-# #
-# This program is distributed in the hope that it will be useful, but WITHOUT #
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
-# more details. #
-# #
-# You should have received a copy of the GNU General Public License along #
-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-###############################################################################
-
-from openlp.plugins.songs.lib.opensongimport import OpenSongImport
-from openlp.core.lib.db import Manager
-from openlp.plugins.songs.lib.db import init_schema
-
-import logging
-LOG_FILENAME = 'test.log'
-logging.basicConfig(filename=LOG_FILENAME,level=logging.INFO)
-
-# Stubs to replace the UI functions for raw testing
-class wizard_stub:
- def __init__(self):
- self.progressBar=progbar_stub()
- def incrementProgressBar(self, str):
- pass
-class progbar_stub:
- def __init__(self):
- pass
- def setMaximum(self, arg):
- pass
-
-def test():
- manager = Manager(u'songs', init_schema)
- o = OpenSongImport(manager, filenames=[u'test.opensong'])
- o.import_wizard = wizard_stub()
- o.commit = False
- o.do_import()
- o.print_song()
- assert o.copyright == u'2010 Martin Thompson'
- assert o.authors == [u'MartiÑ Thómpson', u'Martin2 Thómpson']
- assert o.title == u'Martins Test'
- assert o.alternate_title == u''
- assert o.song_number == u'1'
- assert [u'C1', u'Chorus 1'] in o.verses
- assert [u'C2', u'Chorus 2'] in o.verses
- assert not [u'C3', u'Chorus 3'] in o.verses
- assert [u'B1', u'Bridge 1\nBridge 1 line 2'] in o.verses
- assert [u'V1', u'v1 Line 1\nV1 Line 2'] in o.verses
- assert [u'V2', u'v2 Line 1\nV2 Line 2'] in o.verses
- assert [u'V3A', u'V3 Line 1\nV3 Line 2'] in o.verses
- assert [u'RAP1', u'Rap 1 Line 1\nRap 1 Line 2'] in o.verses
- assert [u'RAP2', u'Rap 2 Line 1\nRap 2 Line 2'] in o.verses
- assert [u'RAP3', u'Rap 3 Line 1\nRap 3 Line 2'] in o.verses
- assert [u'X1', u'Unreferenced verse line 1'] in o.verses
- assert o.verse_order_list == [u'V1', u'C1', u'V2', u'C2', u'V3A', u'B1', u'V1', u'T1', u'RAP1', u'RAP2', u'RAP3']
- assert o.ccli_number == u'Blah'
- assert o.topics == [u'TestTheme', u'TestAltTheme']
-
- o.filenames = [u'test.opensong.zip']
- o.set_defaults()
- o.do_import()
- o.print_song()
- assert o.copyright == u'2010 Martin Thompson'
- assert o.authors == [u'MartiÑ Thómpson']
- assert o.title == u'Martins Test'
- assert o.alternate_title == u''
- assert o.song_number == u'1'
- assert [u'B1', u'Bridge 1\nBridge 1 line 2'] in o.verses
- assert [u'C1', u'Chorus 1'] in o.verses
- assert [u'C2', u'Chorus 2'] in o.verses
- assert not [u'C3', u'Chorus 3'] in o.verses
- assert [u'V1', u'v1 Line 1\nV1 Line 2'] in o.verses
- assert [u'V2', u'v2 Line 1\nV2 Line 2'] in o.verses
- print o.verse_order_list
- assert o.verse_order_list == [u'V1', u'C1', u'V2', u'C2', u'V3', u'B1', u'V1']
-
- o.filenames = [u'test2.opensong']
- o.set_defaults()
- o.do_import()
- o.print_song()
- assert o.copyright == u'2010 Martin Thompson'
- assert o.authors == [u'Martin Thompson']
- assert o.title == u'Martins 2nd Test'
- assert o.alternate_title == u''
- assert o.song_number == u'2'
- print o.verses
- assert [u'B1', u'Bridge 1\nBridge 1 line 2'] in o.verses
- assert [u'C1', u'Chorus 1'] in o.verses
- assert [u'C2', u'Chorus 2'] in o.verses
- assert not [u'C3', u'Chorus 3'] in o.verses
- assert [u'V1', u'v1 Line 1\nV1 Line 2'] in o.verses
- assert [u'V2', u'v2 Line 1\nV2 Line 2'] in o.verses
- print o.verse_order_list
- assert o.verse_order_list == [u'V1', u'V2', u'B1', u'C1', u'C2']
-
- o.filenames = [u'test3.opensong']
- o.set_defaults()
- o.do_import()
- o.print_song()
- assert o.copyright == u'2010'
- assert o.authors == [u'Martin Thompson']
- assert o.title == u'Test single verse'
- assert o.alternate_title == u''
- assert o.ccli_number == u'123456'
- assert o.verse_order_list == [u'V1']
- assert o.topics == [u'Worship: Declaration']
- print o.verses[0]
- assert [u'V1', u'Line 1\nLine 2'] in o.verses
-
- print "Tests passed"
-
-if __name__ == "__main__":
- test()
Follow ups