From 9c5e9f14435f1ef9c853a39d9939dac7d9e42863 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 20 Jul 2010 23:27:21 +0200 Subject: [PATCH 1/8] Some tweaks to the display of the media items. --- openlp/core/ui/mainwindow.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ec34a483b..7e735a434 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -39,19 +39,18 @@ from openlp.core.utils import check_latest_version, AppLocation, add_actions, \ log = logging.getLogger(__name__) MEDIA_MANAGER_STYLE = """ + QToolBox::tab:selected { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 palette(mid), stop: 0.4999 palette(button), stop: 0.5 palette(dark), stop: 1.0 palette(mid)); + } QToolBox::tab { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(button), stop: 1.0 palette(dark)); + stop: 0 palette(button), stop: 0.4999 palette(light), stop: 0.5 palette(mid), stop: 1.0 palette(button)); border-width: 1px; border-style: outset; border-color: palette(dark); border-radius: 5px; } - QToolBox::tab:selected { - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(light), stop: 1.0 palette(button)); - border-color: palette(button); - } """ class VersionThread(QtCore.QThread): """ From d105ee8dfb029044b3a1c15ee0190c411ca64531 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 21 Jul 2010 23:27:36 +0200 Subject: [PATCH 2/8] Playing some more with the tabs of the media manager. --- openlp/core/ui/mainwindow.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 7e735a434..d162a804d 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -41,15 +41,14 @@ log = logging.getLogger(__name__) MEDIA_MANAGER_STYLE = """ QToolBox::tab:selected { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(mid), stop: 0.4999 palette(button), stop: 0.5 palette(dark), stop: 1.0 palette(mid)); + stop: 0 palette(light), stop: 0.5 palette(button), stop: 1.0 palette(dark)); + border: 1px groove palette(dark); } QToolBox::tab { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(button), stop: 0.4999 palette(light), stop: 0.5 palette(mid), stop: 1.0 palette(button)); - border-width: 1px; - border-style: outset; - border-color: palette(dark); - border-radius: 5px; + stop: 0 palette(midlight), stop: 0.5 palette(button), stop: 1.0 palette(mid)); + border: 1px groove palette(mid); + border-radius: 6px; } """ class VersionThread(QtCore.QThread): From d2372850e4779204f18211cd8a4ebab0be52d30f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 22 Jul 2010 01:28:56 +0100 Subject: [PATCH 3/8] DocStrings --- openlp/plugins/presentations/presentationplugin.py | 5 ++++- openlp/plugins/songs/lib/olpimport.py | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 50784ed51..58e033ae6 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -22,7 +22,10 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### - +""" +The :mod:`presentationplugin` module provides the ability for OpenLP to display +presentations from a variety of document formats. +""" import os import logging diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index e4a58277c..5056f6534 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -70,11 +70,18 @@ class OldTopic(BaseModel): class OpenLPSongImport(object): """ - + The :class:`OpenLPSongImport` class provides OpenLP with the ability to + import song databases from other installations of OpenLP. """ def __init__(self, master_manager, source_db): """ + Initialise the import. + ``master_manager`` + The song manager for the running OpenLP installation. + + ``source_db`` + The database providing the data to import. """ self.master_manager = master_manager self.import_source = source_db @@ -82,7 +89,7 @@ class OpenLPSongImport(object): def import_source_v2_db(self): """ - + Run the import for an OpenLP version 2 song database. """ engine = create_engine(self.import_source) source_meta = MetaData() From 4263d541dc438cf0ef60d8b7061c87cd5d5e952b Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 22 Jul 2010 21:30:16 +0200 Subject: [PATCH 4/8] Minor tweak to make the active tab's text bold in Windows. --- openlp/core/ui/mainwindow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 14bd19dc7..87603e2d2 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -49,6 +49,7 @@ MEDIA_MANAGER_STYLE = """ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(light), stop: 0.5 palette(midlight), stop: 1.0 palette(dark)); border: 1px groove palette(dark); + font-weight: bold; } """ class VersionThread(QtCore.QThread): From 306a403195c9ffbc238e890d1eea9409b4fa7e42 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 22 Jul 2010 21:55:09 +0200 Subject: [PATCH 5/8] Another tweak for Windows. --- openlp/core/ui/mainwindow.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 87603e2d2..f08fe4dff 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -39,6 +39,9 @@ from openlp.core.utils import check_latest_version, AppLocation, add_actions, \ log = logging.getLogger(__name__) MEDIA_MANAGER_STYLE = """ + QToolBox { + padding-bottom: 2px; + } QToolBox::tab { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(button), stop: 0.5 palette(button), stop: 1.0 palette(mid)); From f3b44b40be461769c68805d430910aa5b1b3b28e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 22 Jul 2010 22:01:03 +0200 Subject: [PATCH 6/8] Some newlines to make Jon T happy. --- openlp/core/ui/mainwindow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index f08fe4dff..d78788203 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -44,13 +44,15 @@ MEDIA_MANAGER_STYLE = """ } QToolBox::tab { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(button), stop: 0.5 palette(button), stop: 1.0 palette(mid)); + stop: 0 palette(button), stop: 0.5 palette(button), + stop: 1.0 palette(mid)); border: 1px groove palette(mid); border-radius: 5px; } QToolBox::tab:selected { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(light), stop: 0.5 palette(midlight), stop: 1.0 palette(dark)); + stop: 0 palette(light), stop: 0.5 palette(midlight), + stop: 1.0 palette(dark)); border: 1px groove palette(dark); font-weight: bold; } From 4b5ad13eec20d417b3512b9817a302189ff08c80 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 24 Jul 2010 13:59:02 +0100 Subject: [PATCH 7/8] Fix numbered book BG bibles --- openlp/plugins/bibles/lib/http.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 8bf7ac63e..347393c3d 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -197,12 +197,13 @@ class BGExtract(BibleCommon): Chapter number """ log.debug(u'get_bible_chapter %s, %s, %s', version, bookname, chapter) - urlstring = u'http://www.biblegateway.com/passage/?search=%s+%s' \ + urlstring = u'http://www.biblegateway.com/passage/?search=%s %s' \ u'&version=%s' % (bookname, chapter, version) - log.debug(u'BibleGateway url = %s' % urlstring) + url = urlstring.replace(u' ', u'%20') + log.debug(u'BibleGateway url = %s' % url) # Let's get the page, and then open it in BeautifulSoup, so as to # attempt to make "easy" work of bad HTML. - page = urllib2.urlopen(urlstring) + page = urllib2.urlopen(url) Receiver.send_message(u'openlp_process_events') soup = BeautifulSoup(page) Receiver.send_message(u'openlp_process_events') From 3ea6ce95203c09b6ce552e9fc2d3f77f12f39106 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 24 Jul 2010 15:03:04 +0100 Subject: [PATCH 8/8] Use urllib.urlencode() --- openlp/plugins/bibles/lib/http.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 347393c3d..43c9cf405 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -24,10 +24,11 @@ ############################################################################### import logging -import urllib2 import os -import sqlite3 import re +import sqlite3 +import urllib +import urllib2 from BeautifulSoup import BeautifulSoup, Tag, NavigableString @@ -197,13 +198,14 @@ class BGExtract(BibleCommon): Chapter number """ log.debug(u'get_bible_chapter %s, %s, %s', version, bookname, chapter) - urlstring = u'http://www.biblegateway.com/passage/?search=%s %s' \ - u'&version=%s' % (bookname, chapter, version) - url = urlstring.replace(u' ', u'%20') - log.debug(u'BibleGateway url = %s' % url) + url_params = urllib.urlencode( + {u'search': u'%s %s' % (bookname, chapter), + u'version': u'%s' % version}) # Let's get the page, and then open it in BeautifulSoup, so as to # attempt to make "easy" work of bad HTML. - page = urllib2.urlopen(url) + page = urllib2.urlopen( + u'http://www.biblegateway.com/passage/?%s' % url_params) + log.debug(u'BibleGateway url = %s' % page.geturl()) Receiver.send_message(u'openlp_process_events') soup = BeautifulSoup(page) Receiver.send_message(u'openlp_process_events')