openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #14714
[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)
For more details, see:
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/98113
Various cleanups and fix bugs #888815 and #941966
If people want to wait for Derek to confirm this fixes those bugs before merging that's fine.
Sorry for the cleanups mixed in, I was going to propose them separately then it became easier to just commit the fix to give to ElderP so they're all in.
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/98113
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 2012-02-28 14:06:14 +0000
+++ openlp/core/lib/db.py 2012-03-18 21:30:29 +0000
@@ -33,7 +33,8 @@
from PyQt4 import QtCore
from sqlalchemy import Table, MetaData, Column, types, create_engine
-from sqlalchemy.exc import SQLAlchemyError, InvalidRequestError, DBAPIError
+from sqlalchemy.exc import SQLAlchemyError, InvalidRequestError, DBAPIError, \
+ OperationalError
from sqlalchemy.orm import scoped_session, sessionmaker, mapper
from sqlalchemy.pool import NullPool
=== modified file 'openlp/core/lib/imagemanager.py'
--- openlp/core/lib/imagemanager.py 2011-12-27 10:33:55 +0000
+++ openlp/core/lib/imagemanager.py 2012-03-18 21:30:29 +0000
@@ -166,7 +166,7 @@
self.height = current_screen[u'size'].height()
# Mark the images as dirty for a rebuild by setting the image and byte
# stream to None.
- for key, image in self._cache.iteritems():
+ for image in self._cache.values():
self._reset_image(image)
def update_images(self, image_type, background):
@@ -176,7 +176,7 @@
log.debug(u'update_images')
# Mark the images as dirty for a rebuild by setting the image and byte
# stream to None.
- for key, image in self._cache.iteritems():
+ for image in self._cache.values():
if image.source == image_type:
image.background = background
self._reset_image(image)
@@ -188,7 +188,7 @@
log.debug(u'update_images')
# Mark the images as dirty for a rebuild by setting the image and byte
# stream to None.
- for key, image in self._cache.iteritems():
+ for image in self._cache.values():
if image.source == image_type and image.name == name:
image.background = background
self._reset_image(image)
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2012-03-12 21:05:39 +0000
+++ openlp/core/lib/serviceitem.py 2012-03-18 21:30:29 +0000
@@ -300,6 +300,7 @@
``path``
Defaults to *None*. Any path data, usually for images.
"""
+ log.debug(u'set_from_service called with path %s' % path)
header = serviceitem[u'serviceitem'][u'header']
self.title = header[u'title']
self.name = header[u'name']
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2012-03-10 22:59:38 +0000
+++ openlp/core/ui/generaltab.py 2012-03-18 21:30:29 +0000
@@ -295,7 +295,8 @@
QtCore.QVariant(False)).toBool())
self.timeoutSpinBox.setValue(settings.value(u'loop delay',
QtCore.QVariant(5)).toInt()[0])
- self.monitorRadioButton.setChecked(not settings.value(u'override position',
+ self.monitorRadioButton.setChecked(
+ not settings.value(u'override position',
QtCore.QVariant(False)).toBool())
self.overrideRadioButton.setChecked(settings.value(u'override position',
QtCore.QVariant(False)).toBool())
@@ -313,11 +314,14 @@
u'audio repeat list', QtCore.QVariant(False)).toBool())
settings.endGroup()
self.monitorComboBox.setDisabled(self.overrideRadioButton.isChecked())
- self.displayOnMonitorCheck.setDisabled(self.overrideRadioButton.isChecked())
+ self.displayOnMonitorCheck.setDisabled(
+ self.overrideRadioButton.isChecked())
self.customXValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customYValueEdit.setEnabled(self.overrideRadioButton.isChecked())
- self.customHeightValueEdit.setEnabled(self.overrideRadioButton.isChecked())
- self.customWidthValueEdit.setEnabled(self.overrideRadioButton.isChecked())
+ self.customHeightValueEdit.setEnabled(
+ self.overrideRadioButton.isChecked())
+ self.customWidthValueEdit.setEnabled(
+ self.overrideRadioButton.isChecked())
self.display_changed = False
settings.beginGroup(self.settingsSection)
=== modified file 'openlp/core/ui/media/mediacontroller.py'
--- openlp/core/ui/media/mediacontroller.py 2012-03-16 21:09:27 +0000
+++ openlp/core/ui/media/mediacontroller.py 2012-03-18 21:30:29 +0000
@@ -286,7 +286,8 @@
controller.mediabar.setVisible(value)
if controller.isLive and controller.display:
if self.curDisplayMediaPlayer and value:
- if self.curDisplayMediaPlayer[controller.display] != self.mediaPlayers[u'webkit']:
+ if self.curDisplayMediaPlayer[controller.display] != \
+ self.mediaPlayers[u'webkit']:
controller.display.setTransparency(False)
# Special controls: Here media type specific Controls will be enabled
# (e.g. for DVD control, ...)
=== modified file 'openlp/core/ui/printserviceform.py'
--- openlp/core/ui/printserviceform.py 2011-12-27 10:33:55 +0000
+++ openlp/core/ui/printserviceform.py 2012-03-18 21:30:29 +0000
@@ -405,7 +405,7 @@
# Only continue when we include the song's text.
if not self.slideTextCheckBox.isChecked():
return
- for index, item in enumerate(self.serviceManager.serviceItems):
+ for item in self.serviceManager.serviceItems:
# Trigger Audit requests
Receiver.send_message(u'print_service_started',
[item[u'service_item']])
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2012-03-17 21:30:53 +0000
+++ openlp/core/ui/servicemanager.py 2012-03-18 21:30:29 +0000
@@ -461,7 +461,7 @@
log.debug(temp_file_name)
path_file_name = unicode(self.fileName())
path, file_name = os.path.split(path_file_name)
- basename, extension = os.path.splitext(file_name)
+ basename = os.path.splitext(file_name)[0]
service_file_name = '%s.osd' % basename
log.debug(u'ServiceManager.saveFile - %s', path_file_name)
SettingsManager.set_last_dir(
@@ -483,8 +483,7 @@
for i, filename in \
enumerate(service_item[u'header'][u'background_audio']):
new_file = os.path.join(u'audio',
- item[u'service_item']._uuid,
- os.path.split(filename)[1])
+ item[u'service_item']._uuid, filename)
audio_files.append((filename, new_file))
service_item[u'header'][u'background_audio'][i] = new_file
# Add the service item to the service.
@@ -1354,15 +1353,15 @@
Handle of the event pint passed
"""
link = event.mimeData()
- if event.mimeData().hasUrls():
+ if link.hasUrls():
event.setDropAction(QtCore.Qt.CopyAction)
event.accept()
- for url in event.mimeData().urls():
+ for url in link.urls():
filename = unicode(url.toLocalFile())
if filename.endswith(u'.osz'):
self.onLoadServiceClicked(filename)
- elif event.mimeData().hasText():
- plugin = unicode(event.mimeData().text())
+ elif link.hasText():
+ plugin = unicode(link.text())
item = self.serviceManagerList.itemAt(event.pos())
# ServiceManager started the drag and drop
if plugin == u'ServiceManager':
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2011-12-27 10:33:55 +0000
+++ openlp/core/ui/settingsform.py 2012-03-18 21:30:29 +0000
@@ -57,7 +57,7 @@
def exec_(self):
# load all the settings
self.settingListWidget.clear()
- for tabIndex in range(0, self.stackedLayout.count() + 1):
+ while self.stackedLayout.count():
# take at 0 and the rest shuffle up.
self.stackedLayout.takeAt(0)
self.insertTab(self.generalTab, 0, PluginStatus.Active)
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2012-03-16 23:05:06 +0000
+++ openlp/core/ui/slidecontroller.py 2012-03-18 21:30:29 +0000
@@ -563,7 +563,8 @@
Receiver.send_message('servicemanager_previous_item')
elif keypressCommand == ServiceItemAction.PreviousLastSlide:
# Go to the last slide of the previous item
- Receiver.send_message('servicemanager_previous_item', u'last slide')
+ Receiver.send_message('servicemanager_previous_item',
+ u'last slide')
else:
Receiver.send_message('servicemanager_next_item')
self.keypress_loop = False
@@ -1190,7 +1191,8 @@
if self.slide_limits == SlideLimits.Wrap:
row = self.previewListWidget.rowCount() - 1
elif self.isLive and self.slide_limits == SlideLimits.Next:
- self.keypress_queue.append(ServiceItemAction.PreviousLastSlide)
+ self.keypress_queue.append(
+ ServiceItemAction.PreviousLastSlide)
self._process_queue()
return
else:
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2012-03-11 16:41:24 +0000
+++ openlp/core/ui/thememanager.py 2012-03-18 21:30:29 +0000
@@ -153,7 +153,6 @@
Import new themes downloaded by the first time wizard
"""
Receiver.send_message(u'cursor_busy')
- encoding = get_filesystem_encoding()
files = SettingsManager.get_files(self.settingsSection, u'.otz')
for file in files:
file = os.path.join(self.path, file)
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2012-02-28 09:24:42 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2012-03-18 21:30:29 +0000
@@ -27,7 +27,7 @@
import logging
-from PyQt4 import QtCore, QtGui
+from PyQt4 import QtGui
from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import create_action, UiStrings
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2012-03-15 06:15:21 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2012-03-18 21:30:29 +0000
@@ -189,7 +189,7 @@
# Continue with the existing images.
for bitem in items:
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
- (path, name) = os.path.split(filename)
+ name = os.path.split(filename)[1]
service_item.add_from_image(filename, name, background)
return True
@@ -220,7 +220,7 @@
bitem = self.listView.item(item.row())
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
if os.path.exists(filename):
- (path, name) = os.path.split(filename)
+ name = os.path.split(filename)[1]
if self.plugin.liveController.display.directImage(name,
filename, background):
self.resetAction.setVisible(True)
=== modified file 'openlp/plugins/remotes/lib/remotetab.py'
--- openlp/plugins/remotes/lib/remotetab.py 2012-03-17 10:51:04 +0000
+++ openlp/plugins/remotes/lib/remotetab.py 2012-03-18 21:30:29 +0000
@@ -87,7 +87,8 @@
self.qrLayout = QtGui.QVBoxLayout(self.androidAppGroupBox)
self.qrLayout.setObjectName(u'qrLayout')
self.qrCodeLabel = QtGui.QLabel(self.androidAppGroupBox)
- self.qrCodeLabel.setPixmap(QtGui.QPixmap(u':/remotes/android_app_qr.png'))
+ self.qrCodeLabel.setPixmap(QtGui.QPixmap(
+ u':/remotes/android_app_qr.png'))
self.qrCodeLabel.setAlignment(QtCore.Qt.AlignCenter)
self.qrCodeLabel.setObjectName(u'qrCodeLabel')
self.qrLayout.addWidget(self.qrCodeLabel)
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2012-03-11 21:32:43 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2012-03-18 21:30:29 +0000
@@ -589,7 +589,7 @@
verse_names.append(u'%s%s' % (
VerseType.translated_tag(verse[0]), verse[1:]))
verses_not_used = []
- for count, verse in enumerate(verses):
+ for verse in verses:
if not verse in order:
verses_not_used.append(verse)
self.warningLabel.setVisible(len(verses_not_used) > 0)
@@ -680,7 +680,6 @@
self.verseListWidget.rowCount())
if not result:
return False
- item = int(self.songBookComboBox.currentIndex())
text = unicode(self.songBookComboBox.currentText())
if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0:
if QtGui.QMessageBox.question(self,
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2012-03-15 06:15:21 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2012-03-18 21:30:29 +0000
@@ -36,7 +36,7 @@
from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
translate, check_item_selected, PluginStatus, create_separated_list
-from openlp.core.lib.ui import UiStrings, create_action, create_widget_action
+from openlp.core.lib.ui import UiStrings, create_widget_action
from openlp.core.utils import AppLocation
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
SongImportForm, SongExportForm
Follow ups