From 1005a3c1b1b3e32e44a3683e64362f1ed6623ca9 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 19 Jun 2010 19:29:18 +0100 Subject: [PATCH] Cleanup unneeded trailing backslashes --- openlp/core/lib/mediamanageritem.py | 28 +++++++++---------- openlp/core/ui/servicemanager.py | 2 +- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/alerts/lib/alertstab.py | 2 +- .../songusage/forms/songusagedetailform.py | 7 ++--- openlp/plugins/songusage/lib/manager.py | 2 +- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index c0f016f94..a011a1c94 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -208,40 +208,40 @@ class MediaManagerItem(QtGui.QWidget): ## Import Button ## if self.hasImportIcon: self.addToolbarButton( - unicode(translate('MediaManagerItem', 'Import %s')) % \ + unicode(translate('MediaManagerItem', 'Import %s')) % self.PluginNameShort, - unicode(translate('MediaManagerItem', 'Import a %s')) % \ + unicode(translate('MediaManagerItem', 'Import a %s')) % self.PluginNameVisible, u':/general/general_import.png', self.onImportClick) ## File Button ## if self.hasFileIcon: self.addToolbarButton( - unicode(translate('MediaManagerItem', 'Load %s')) % \ + unicode(translate('MediaManagerItem', 'Load %s')) % self.PluginNameShort, - unicode(translate('MediaManagerItem', 'Load a new %s')) % \ + unicode(translate('MediaManagerItem', 'Load a new %s')) % self.PluginNameVisible, u':/general/general_open.png', self.onFileClick) ## New Button ## if self.hasNewIcon: self.addToolbarButton( - unicode(translate('MediaManagerItem', 'New %s')) % \ + unicode(translate('MediaManagerItem', 'New %s')) % self.PluginNameShort, - unicode(translate('MediaManagerItem', 'Add a new %s')) % \ + unicode(translate('MediaManagerItem', 'Add a new %s')) % self.PluginNameVisible, u':/general/general_new.png', self.onNewClick) ## Edit Button ## if self.hasEditIcon: self.addToolbarButton( - unicode(translate('MediaManagerItem', 'Edit %s')) % \ + unicode(translate('MediaManagerItem', 'Edit %s')) % self.PluginNameShort, unicode(translate( - 'MediaManagerItem', 'Edit the selected %s')) % \ + 'MediaManagerItem', 'Edit the selected %s')) % self.PluginNameVisible, u':/general/general_edit.png', self.onEditClick) ## Delete Button ## if self.hasDeleteIcon: self.addToolbarButton( - unicode(translate('MediaManagerItem', 'Delete %s')) % \ + unicode(translate('MediaManagerItem', 'Delete %s')) % self.PluginNameShort, translate('MediaManagerItem', 'Delete the selected item'), u':/general/general_delete.png', self.onDeleteClick) @@ -249,7 +249,7 @@ class MediaManagerItem(QtGui.QWidget): self.addToolbarSeparator() ## Preview ## self.addToolbarButton( - unicode(translate('MediaManagerItem', 'Preview %s')) % \ + unicode(translate('MediaManagerItem', 'Preview %s')) % self.PluginNameShort, translate('MediaManagerItem', 'Preview the selected item'), u':/general/general_preview.png', self.onPreviewClick) @@ -260,7 +260,7 @@ class MediaManagerItem(QtGui.QWidget): u':/general/general_live.png', self.onLiveClick) ## Add to service Button ## self.addToolbarButton( - unicode(translate('MediaManagerItem', 'Add %s to Service')) % \ + unicode(translate('MediaManagerItem', 'Add %s to Service')) % self.PluginNameShort, translate('MediaManagerItem', 'Add the selected item(s) to the service'), @@ -285,7 +285,7 @@ class MediaManagerItem(QtGui.QWidget): self.ListView.addAction( context_menu_action( self.ListView, u':/general/general_edit.png', - unicode(translate('MediaManagerItem', '&Edit %s')) % \ + unicode(translate('MediaManagerItem', '&Edit %s')) % self.PluginNameVisible, self.onEditClick)) self.ListView.addAction(context_menu_separator(self.ListView)) @@ -293,14 +293,14 @@ class MediaManagerItem(QtGui.QWidget): self.ListView.addAction( context_menu_action( self.ListView, u':/general/general_delete.png', - unicode(translate('MediaManagerItem', '&Delete %s')) % \ + unicode(translate('MediaManagerItem', '&Delete %s')) % self.PluginNameVisible, self.onDeleteClick)) self.ListView.addAction(context_menu_separator(self.ListView)) self.ListView.addAction( context_menu_action( self.ListView, u':/general/general_preview.png', - unicode(translate('MediaManagerItem', '&Preview %s')) % \ + unicode(translate('MediaManagerItem', '&Preview %s')) % self.PluginNameVisible, self.onPreviewClick)) self.ListView.addAction( diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index cccd34195..b317c6bf9 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -677,7 +677,7 @@ class ServiceManager(QtGui.QWidget): translate('ServiceManager', 'File is not a valid service.\n' 'The content encoding is not UTF-8.')) - log.exception(u'Filename "%s" is not valid UTF-8' % \ + log.exception(u'Filename "%s" is not valid UTF-8' % file.decode(u'utf-8', u'replace')) continue osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile)) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 431b1d450..b645e541b 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -398,7 +398,7 @@ class ThemeManager(QtGui.QWidget): self, translate('ThemeManager', 'Error'), translate('ThemeManager', 'File is not a valid theme.\n' 'The content encoding is not UTF-8.')) - log.exception(u'Filename "%s" is not valid UTF-8' % \ + log.exception(u'Filename "%s" is not valid UTF-8' % file.decode(u'utf-8', u'replace')) continue osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile)) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 15f27df6d..fd8722ca9 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -294,5 +294,5 @@ class AlertsTab(SettingsTab): font.setBold(True) font.setPointSize(self.font_size) self.FontPreview.setFont(font) - self.FontPreview.setStyleSheet(u'background-color: %s; color: %s' % \ + self.FontPreview.setStyleSheet(u'background-color: %s; color: %s' % (self.bg_color, self.font_color)) diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index fb1d1c73d..50ea87abe 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -71,12 +71,11 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): def accept(self): log.debug(u'Detailed report generated') - filename = u'usage_detail_%s_%s.txt' % \ + filename = u'usage_detail_%s_%s.txt' % (self.FromDate.selectedDate().toString(u'ddMMyyyy'), self.ToDate.selectedDate().toString(u'ddMMyyyy')) - usage = self.parent.songusagemanager.get_all_songusage(\ - self.FromDate.selectedDate(), \ - self.ToDate.selectedDate()) + usage = self.parent.songusagemanager.get_all_songusage( + self.FromDate.selectedDate(), self.ToDate.selectedDate()) outname = os.path.join(unicode(self.FileLineEdit.text()), filename) file = None try: diff --git a/openlp/plugins/songusage/lib/manager.py b/openlp/plugins/songusage/lib/manager.py index b830fdafd..2339136d0 100644 --- a/openlp/plugins/songusage/lib/manager.py +++ b/openlp/plugins/songusage/lib/manager.py @@ -53,7 +53,7 @@ class SongUsageManager(object): db_type = unicode( settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString()) if db_type == u'sqlite': - self.db_url = u'sqlite:///%s/songusage.sqlite' % \ + self.db_url = u'sqlite:///%s/songusage.sqlite' % AppLocation.get_section_data_path(u'songusage') else: self.db_url = u'%s://%s:%s@%s/%s' % (db_type,