From ec162989084d19d15da143d50e11f131cf8f8ad9 Mon Sep 17 00:00:00 2001 From: rimach Date: Wed, 29 Sep 2010 23:06:59 +0200 Subject: [PATCH] add missing newlines, simplify getString function, wrap long lines --- openlp/core/lib/plugin.py | 12 ++++----- openlp/core/ui/settingsform.py | 3 ++- openlp/plugins/alerts/alertsplugin.py | 3 ++- openlp/plugins/bibles/bibleplugin.py | 23 ++++++++++------ openlp/plugins/custom/customplugin.py | 26 ++++++++++++------- openlp/plugins/images/imageplugin.py | 23 ++++++++++------ openlp/plugins/media/mediaplugin.py | 23 ++++++++++------ .../presentations/presentationplugin.py | 17 +++++++----- openlp/plugins/remotes/remoteplugin.py | 2 +- openlp/plugins/songs/songsplugin.py | 20 +++++++++----- openlp/plugins/songusage/songusageplugin.py | 2 +- 11 files changed, 98 insertions(+), 56 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 8069d9a71..a4487dc0a 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -305,13 +305,13 @@ class Plugin(QtCore.QObject): pass def getString(self, name): - if name in self.text_strings: - return self.text_strings[name] - else: - # do something here? - return None + """ + encapsulate access of plugins translated text strings + """ + return self.text_strings[name] def setPluginTextStrings(self): """ Called to define all translatable texts of the plugin - """ \ No newline at end of file + """ + diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 631ebd534..d1cf19622 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -79,7 +79,8 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): log.debug(u'remove %s tab' % tab.tabTitleVisible) for tabIndex in range(0, self.settingsTabWidget.count()): if self.settingsTabWidget.widget(tabIndex): - if self.settingsTabWidget.widget(tabIndex).tabTitleVisible == tab.tabTitleVisible: + if self.settingsTabWidget.widget(tabIndex).tabTitleVisible == \ + tab.tabTitleVisible: self.settingsTabWidget.removeTab(tabIndex) def accept(self): diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 44d919295..0b3063ed7 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -114,4 +114,5 @@ class AlertsPlugin(Plugin): ## Name for MediaDockManager, SettingsManager ## self.text_strings[StringContent.VisibleName] = { u'title': translate('AlertsPlugin', 'Alerts') - } \ No newline at end of file + } + diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 3f27f0736..d81329025 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -135,35 +135,42 @@ class BiblePlugin(Plugin): ## Import Button ## self.text_strings[StringContent.Import] = { u'title': translate('BiblesPlugin', 'Import'), - u'tooltip': translate('BiblesPlugin', 'Import a Bible') + u'tooltip': translate('BiblesPlugin', + 'Import a Bible') } ## New Button ## self.text_strings[StringContent.New] = { u'title': translate('BiblesPlugin', 'Add'), - u'tooltip': translate('BiblesPlugin', 'Add a new Bible') + u'tooltip': translate('BiblesPlugin', + 'Add a new Bible') } ## Edit Button ## self.text_strings[StringContent.Edit] = { u'title': translate('BiblesPlugin', 'Edit'), - u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible') + u'tooltip': translate('BiblesPlugin', + 'Edit the selected Bible') } ## Delete Button ## self.text_strings[StringContent.Delete] = { u'title': translate('BiblesPlugin', 'Delete'), - u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible') + u'tooltip': translate('BiblesPlugin', + 'Delete the selected Bible') } ## Preview ## self.text_strings[StringContent.Preview] = { u'title': translate('BiblesPlugin', 'Preview'), - u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible') + u'tooltip': translate('BiblesPlugin', + 'Preview the selected Bible') } ## Live Button ## self.text_strings[StringContent.Live] = { u'title': translate('BiblesPlugin', 'Live'), - u'tooltip': translate('BiblesPlugin', 'Send the selected Bible live') + u'tooltip': translate('BiblesPlugin', + 'Send the selected Bible live') } ## Add to service Button ## self.text_strings[StringContent.Service] = { u'title': translate('BiblesPlugin', 'Service'), - u'tooltip': translate('BiblesPlugin', 'Add the selected Bible to the service') - } \ No newline at end of file + u'tooltip': translate('BiblesPlugin', + 'Add the selected Bible to the service') + } diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 91f928ad8..1b828c9de 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -115,40 +115,48 @@ class CustomPlugin(Plugin): ## Import Button ## self.text_strings[StringContent.Import] = { u'title': translate('CustomsPlugin', 'Import'), - u'tooltip': translate('CustomsPlugin', 'Import a Custom') + u'tooltip': translate('CustomsPlugin', + 'Import a Custom') } ## Load Button ## self.text_strings[StringContent.Load] = { u'title': translate('CustomsPlugin', 'Load'), - u'tooltip': translate('CustomsPlugin', 'Load a new Custom') + u'tooltip': translate('CustomsPlugin', + 'Load a new Custom') } ## New Button ## self.text_strings[StringContent.New] = { u'title': translate('CustomsPlugin', 'Add'), - u'tooltip': translate('CustomsPlugin', 'Add a new Custom') + u'tooltip': translate('CustomsPlugin', + 'Add a new Custom') } ## Edit Button ## self.text_strings[StringContent.Edit] = { u'title': translate('CustomsPlugin', 'Edit'), - u'tooltip': translate('CustomsPlugin', 'Edit the selected Custom') + u'tooltip': translate('CustomsPlugin', + 'Edit the selected Custom') } ## Delete Button ## self.text_strings[StringContent.Delete] = { u'title': translate('CustomsPlugin', 'Delete'), - u'tooltip': translate('CustomsPlugin', 'Delete the selected Custom') + u'tooltip': translate('CustomsPlugin', + 'Delete the selected Custom') } ## Preview ## self.text_strings[StringContent.Preview] = { u'title': translate('CustomsPlugin', 'Preview'), - u'tooltip': translate('CustomsPlugin', 'Preview the selected Custom') + u'tooltip': translate('CustomsPlugin', + 'Preview the selected Custom') } ## Live Button ## self.text_strings[StringContent.Live] = { u'title': translate('CustomsPlugin', 'Live'), - u'tooltip': translate('CustomsPlugin', 'Send the selected Custom live') + u'tooltip': translate('CustomsPlugin', + 'Send the selected Custom live') } ## Add to service Button ## self.text_strings[StringContent.Service] = { u'title': translate('CustomsPlugin', 'Service'), - u'tooltip': translate('CustomsPlugin', 'Add the selected Custom to the service') - } \ No newline at end of file + u'tooltip': translate('CustomsPlugin', + 'Add the selected Custom to the service') + } diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 5f4f5d146..c6c5aceb9 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -75,35 +75,42 @@ class ImagePlugin(Plugin): ## Load Button ## self.text_strings[StringContent.Load] = { u'title': translate('ImagePlugin', 'Load'), - u'tooltip': translate('ImagePlugin', 'Load a new Image') + u'tooltip': translate('ImagePlugin', + 'Load a new Image') } ## New Button ## self.text_strings[StringContent.New] = { u'title': translate('ImagePlugin', 'Add'), - u'tooltip': translate('ImagePlugin', 'Add a new Image') + u'tooltip': translate('ImagePlugin', + 'Add a new Image') } ## Edit Button ## self.text_strings[StringContent.Edit] = { u'title': translate('ImagePlugin', 'Edit'), - u'tooltip': translate('ImagePlugin', 'Edit the selected Image') + u'tooltip': translate('ImagePlugin', + 'Edit the selected Image') } ## Delete Button ## self.text_strings[StringContent.Delete] = { u'title': translate('ImagePlugin', 'Delete'), - u'tooltip': translate('ImagePlugin', 'Delete the selected Image') + u'tooltip': translate('ImagePlugin', + 'Delete the selected Image') } ## Preview ## self.text_strings[StringContent.Preview] = { u'title': translate('ImagePlugin', 'Preview'), - u'tooltip': translate('ImagePlugin', 'Preview the selected Image') + u'tooltip': translate('ImagePlugin', + 'Preview the selected Image') } ## Live Button ## self.text_strings[StringContent.Live] = { u'title': translate('ImagePlugin', 'Live'), - u'tooltip': translate('ImagePlugin', 'Send the selected Image live') + u'tooltip': translate('ImagePlugin', + 'Send the selected Image live') } ## Add to service Button ## self.text_strings[StringContent.Service] = { u'title': translate('ImagePlugin', 'Service'), - u'tooltip': translate('ImagePlugin', 'Add the selected Image to the service') - } \ No newline at end of file + u'tooltip': translate('ImagePlugin', + 'Add the selected Image to the service') + } diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 474c6d18d..ff1838133 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -94,35 +94,42 @@ class MediaPlugin(Plugin): ## Load Button ## self.text_strings[StringContent.Load] = { u'title': translate('MediaPlugin', 'Load'), - u'tooltip': translate('MediaPlugin', 'Load a new Media') + u'tooltip': translate('MediaPlugin', + 'Load a new Media') } ## New Button ## self.text_strings[StringContent.New] = { u'title': translate('MediaPlugin', 'Add'), - u'tooltip': translate('MediaPlugin', 'Add a new Media') + u'tooltip': translate('MediaPlugin', + 'Add a new Media') } ## Edit Button ## self.text_strings[StringContent.Edit] = { u'title': translate('MediaPlugin', 'Edit'), - u'tooltip': translate('MediaPlugin', 'Edit the selected Media') + u'tooltip': translate('MediaPlugin', + 'Edit the selected Media') } ## Delete Button ## self.text_strings[StringContent.Delete] = { u'title': translate('MediaPlugin', 'Delete'), - u'tooltip': translate('MediaPlugin', 'Delete the selected Media') + u'tooltip': translate('MediaPlugin', + 'Delete the selected Media') } ## Preview ## self.text_strings[StringContent.Preview] = { u'title': translate('MediaPlugin', 'Preview'), - u'tooltip': translate('MediaPlugin', 'Preview the selected Media') + u'tooltip': translate('MediaPlugin', + 'Preview the selected Media') } ## Live Button ## self.text_strings[StringContent.Live] = { u'title': translate('MediaPlugin', 'Live'), - u'tooltip': translate('MediaPlugin', 'Send the selected Media live') + u'tooltip': translate('MediaPlugin', + 'Send the selected Media live') } ## Add to service Button ## self.text_strings[StringContent.Service] = { u'title': translate('MediaPlugin', 'Service'), - u'tooltip': translate('MediaPlugin', 'Add the selected Media to the service') - } \ No newline at end of file + u'tooltip': translate('MediaPlugin', + 'Add the selected Media to the service') + } diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index f80079639..ce1e0bf32 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -162,25 +162,30 @@ class PresentationPlugin(Plugin): ## Load Button ## self.text_strings[StringContent.Load] = { u'title': translate('PresentationPlugin', 'Load'), - u'tooltip': translate('PresentationPlugin', 'Load a new Presentation') + u'tooltip': translate('PresentationPlugin', + 'Load a new Presentation') } ## Delete Button ## self.text_strings[StringContent.Delete] = { u'title': translate('PresentationPlugin', 'Delete'), - u'tooltip': translate('PresentationPlugin', 'Delete the selected Presentation') + u'tooltip': translate('PresentationPlugin', + 'Delete the selected Presentation') } ## Preview ## self.text_strings[StringContent.Preview] = { u'title': translate('PresentationPlugin', 'Preview'), - u'tooltip': translate('PresentationPlugin', 'Preview the selected Presentation') + u'tooltip': translate('PresentationPlugin', + 'Preview the selected Presentation') } ## Live Button ## self.text_strings[StringContent.Live] = { u'title': translate('PresentationPlugin', 'Live'), - u'tooltip': translate('PresentationPlugin', 'Send the selected Presentation live') + u'tooltip': translate('PresentationPlugin', + 'Send the selected Presentation live') } ## Add to service Button ## self.text_strings[StringContent.Service] = { u'title': translate('PresentationPlugin', 'Service'), - u'tooltip': translate('PresentationPlugin', 'Add the selected Presentation to the service') - } \ No newline at end of file + u'tooltip': translate('PresentationPlugin', + 'Add the selected Presentation to the service') + } diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 595cc14d6..498c896d0 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -90,4 +90,4 @@ class RemotesPlugin(Plugin): ## Name for MediaDockManager, SettingsManager ## self.text_strings[StringContent.VisibleName] = { u'title': translate('RemotePlugin', 'Remotes') - } \ No newline at end of file + } diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 297be7ed8..cf1357336 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -166,30 +166,36 @@ class SongsPlugin(Plugin): ## New Button ## self.text_strings[StringContent.New] = { u'title': translate('SongsPlugin', 'Add'), - u'tooltip': translate('SongsPlugin', 'Add a new Song') + u'tooltip': translate('SongsPlugin', + 'Add a new Song') } ## Edit Button ## self.text_strings[StringContent.Edit] = { u'title': translate('SongsPlugin', 'Edit'), - u'tooltip': translate('SongsPlugin', 'Edit the selected Song') + u'tooltip': translate('SongsPlugin', + 'Edit the selected Song') } ## Delete Button ## self.text_strings[StringContent.Delete] = { u'title': translate('SongsPlugin', 'Delete'), - u'tooltip': translate('SongsPlugin', 'Delete the selected Song') + u'tooltip': translate('SongsPlugin', + 'Delete the selected Song') } ## Preview ## self.text_strings[StringContent.Preview] = { u'title': translate('SongsPlugin', 'Preview'), - u'tooltip': translate('SongsPlugin', 'Preview the selected Song') + u'tooltip': translate('SongsPlugin', + 'Preview the selected Song') } ## Live Button ## self.text_strings[StringContent.Live] = { u'title': translate('SongsPlugin', 'Live'), - u'tooltip': translate('SongsPlugin', 'Send the selected Song live') + u'tooltip': translate('SongsPlugin', + 'Send the selected Song live') } ## Add to service Button ## self.text_strings[StringContent.Service] = { u'title': translate('SongsPlugin', 'Service'), - u'tooltip': translate('SongsPlugin', 'Add the selected Song to the service') - } \ No newline at end of file + u'tooltip': translate('SongsPlugin', + 'Add the selected Song to the service') + } diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 167a00029..5863490a6 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -175,4 +175,4 @@ class SongUsagePlugin(Plugin): ## Name for MediaDockManager, SettingsManager ## self.text_strings[StringContent.VisibleName] = { u'title': translate('SongUsagePlugin', 'SongUsage') - } \ No newline at end of file + }