From 0f042dde6f9c0b5ffeaa32ac120c3756f26db88e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 11 Jan 2013 01:35:00 +0100 Subject: [PATCH] clean ups --- openlp/core/lib/theme.py | 7 ++----- openlp/core/lib/uistrings.py | 2 +- openlp/core/ui/mainwindow.py | 8 ++++---- openlp/core/ui/media/webkitplayer.py | 2 +- openlp/core/ui/servicemanager.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/plugins/bibles/lib/db.py | 4 ++-- openlp/plugins/bibles/lib/http.py | 4 ++-- openlp/plugins/bibles/lib/mediaitem.py | 2 +- 9 files changed, 15 insertions(+), 18 deletions(-) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index eb96be5cd..8a85c0d86 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -36,7 +36,7 @@ import logging from xml.dom.minidom import Document from lxml import etree, objectify -from openlp.core.lib import str_to_bool +from openlp.core.lib import str_to_bool, ScreenList log = logging.getLogger(__name__) @@ -380,8 +380,7 @@ class ThemeXML(object): # Create italics name element self.child_element(background, u'italics', unicode(italics)) # Create indentation name element - self.child_element( - background, u'line_adjustment', unicode(line_adjustment)) + self.child_element(background, u'line_adjustment', unicode(line_adjustment)) # Create Location element element = self.theme_xml.createElement(u'location') element.setAttribute(u'override', unicode(override)) @@ -451,8 +450,6 @@ class ThemeXML(object): Set the header and footer size into the current primary screen. 10 px on each side is removed to allow for a border. """ - #FIXME - from openlp.core.lib import ScreenList current_screen = ScreenList().current self.font_main_y = 0 self.font_main_width = current_screen[u'size'].width() - 20 diff --git a/openlp/core/lib/uistrings.py b/openlp/core/lib/uistrings.py index 6fef6514a..740f3ef7a 100644 --- a/openlp/core/lib/uistrings.py +++ b/openlp/core/lib/uistrings.py @@ -27,7 +27,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ -The :mod:`ui` module provides standard UI components for OpenLP. +The :mod:`uistrings` module provides standard strings for OpenLP. """ import logging diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c01edf083..7883bff7b 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -232,7 +232,7 @@ class Ui_MainWindow(object): checked=panelLocked, triggers=self.setLockPanel) action_list.add_category(UiStrings().ViewMode, CategoryOrder.standardMenu) - self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem', checked=False, + self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem', checked=False, category=UiStrings().ViewMode) self.modeSetupItem = create_action(mainWindow, u'modeSetupItem', checked=False, category=UiStrings().ViewMode) self.modeLiveItem = create_action(mainWindow, u'modeLiveItem', checked=True, category=UiStrings().ViewMode) @@ -937,11 +937,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # Read the temp file and output the user's CONF file with blanks to # make it more readable. temp_conf = open(temp_file, u'r') - export_conf = open(export_file_name, u'w') + export_conf = open(export_file_name, u'w') for file_record in temp_conf: # Get rid of any invalid entries. if file_record.find(u'@Invalid()') == -1: - file_record = file_record.replace(u'%20', u' ') + file_record = file_record.replace(u'%20', u' ') export_conf.write(file_record) temp_conf.close() export_conf.close() @@ -1329,7 +1329,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): '- Please wait for copy to finish').replace('%s', self.newDataPath)) dir_util.copy_tree(old_data_path, self.newDataPath) log.info(u'Copy sucessful') - except (IOError, os.error, DistutilsFileError), why: + except (IOError, os.error, DistutilsFileError), why: Receiver.send_message(u'cursor_normal') log.exception(u'Data copy failed %s' % unicode(why)) QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'New Data Directory Error'), diff --git a/openlp/core/ui/media/webkitplayer.py b/openlp/core/ui/media/webkitplayer.py index 49f3edeec..0b055f0db 100644 --- a/openlp/core/ui/media/webkitplayer.py +++ b/openlp/core/ui/media/webkitplayer.py @@ -253,7 +253,7 @@ VIDEO_EXT = [ , u'*.mp4' , u'*.ogv' , u'*.webm' - , u'*.mpg', u'*.wmv', u'*.mpeg', u'*.avi' + , u'*.mpg', u'*.wmv', u'*.mpeg', u'*.avi' , u'*.swf' ] diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 99536e4f3..5f0bb86b0 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -245,7 +245,7 @@ class ServiceManager(QtGui.QWidget): self.maintainAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Reorder Item'), icon=u':/general/general_edit.png', triggers=self.onServiceItemEditForm) self.notesAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Notes'), - icon=u':/services/service_notes.png', triggers=self.onServiceItemNoteForm) + icon=u':/services/service_notes.png', triggers=self.onServiceItemNoteForm) self.timeAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Start Time'), icon=u':/media/media_time.png', triggers=self.onStartTimeForm) self.autoStartAction = create_widget_action(self.menu, text=u'', diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 68efc352c..37af3b7b9 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -72,7 +72,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.onGradientStartButtonClicked) QtCore.QObject.connect(self.gradientEndButton, QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked) QtCore.QObject.connect(self.imageBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onImageBrowseButtonClicked) - QtCore.QObject.connect(self.mainColorButton, QtCore.SIGNAL(u'clicked()'), self.onMainColorButtonClicked) + QtCore.QObject.connect(self.mainColorButton, QtCore.SIGNAL(u'clicked()'), self.onMainColorButtonClicked) QtCore.QObject.connect(self.outlineColorButton, QtCore.SIGNAL(u'clicked()'), self.onOutlineColorButtonClicked) QtCore.QObject.connect(self.shadowColorButton, QtCore.SIGNAL(u'clicked()'), self.onShadowColorButtonClicked) QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 69a3a663f..11bdd09e7 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -778,7 +778,7 @@ class BiblesResourcesDB(QtCore.QObject, Manager): The source of the webbible. """ log.debug(u'BiblesResourcesDB.get_webbibles("%s")', source) - if not isinstance(source, unicode): + if not isinstance(source, unicode): source = unicode(source) source = BiblesResourcesDB.get_download_source(source) bibles = BiblesResourcesDB.run_sql(u'SELECT id, name, abbreviation, ' @@ -953,7 +953,7 @@ class AlternativeBookNamesDB(QtCore.QObject, Manager): return cursor.fetchall() @staticmethod - def get_book_reference_id(name, language_id=None): + def get_book_reference_id(name, language_id=None): """ Return a book_reference_id if the name matches. diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index ee48945e5..327f03565 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -526,7 +526,7 @@ class HTTPBible(BibleDB): books = handler.get_books_from_http(self.download_name) if not books: log.exception(u'Importing books from %s - download name: "%s" '\ - 'failed' % (self.download_source, self.download_name)) + 'failed' % (self.download_source, self.download_name)) return False self.wizard.progressBar.setMaximum(len(books)+2) self.wizard.incrementProgressBar(translate( @@ -552,7 +552,7 @@ class HTTPBible(BibleDB): language_id) if not book_ref_id: log.exception(u'Importing books from %s - download name: "%s" '\ - 'failed' % (self.download_source, self.download_name)) + 'failed' % (self.download_source, self.download_name)) return False book_details = BiblesResourcesDB.get_book_by_id(book_ref_id) log.debug(u'Book details: Name:%s; id:%s; testament_id:%s', diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 078d2fbd9..0393081f0 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -228,7 +228,7 @@ class BibleMediaItem(MediaManagerItem): self.addSearchFields(u'advanced', UiStrings().Advanced) # Combo Boxes QtCore.QObject.connect(self.quickVersionComboBox, QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter) - QtCore.QObject.connect(self.quickSecondComboBox, QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter) + QtCore.QObject.connect(self.quickSecondComboBox, QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter) QtCore.QObject.connect(self.advancedVersionComboBox,QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox) QtCore.QObject.connect(self.advancedSecondComboBox, QtCore.SIGNAL(u'activated(int)'),