clean ups

This commit is contained in:
Andreas Preikschat 2013-01-11 01:35:00 +01:00
parent 91fbf037a2
commit 0f042dde6f
9 changed files with 15 additions and 18 deletions

View File

@ -36,7 +36,7 @@ import logging
from xml.dom.minidom import Document from xml.dom.minidom import Document
from lxml import etree, objectify 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__) log = logging.getLogger(__name__)
@ -380,8 +380,7 @@ class ThemeXML(object):
# Create italics name element # Create italics name element
self.child_element(background, u'italics', unicode(italics)) self.child_element(background, u'italics', unicode(italics))
# Create indentation name element # Create indentation name element
self.child_element( self.child_element(background, u'line_adjustment', unicode(line_adjustment))
background, u'line_adjustment', unicode(line_adjustment))
# Create Location element # Create Location element
element = self.theme_xml.createElement(u'location') element = self.theme_xml.createElement(u'location')
element.setAttribute(u'override', unicode(override)) element.setAttribute(u'override', unicode(override))
@ -451,8 +450,6 @@ class ThemeXML(object):
Set the header and footer size into the current primary screen. Set the header and footer size into the current primary screen.
10 px on each side is removed to allow for a border. 10 px on each side is removed to allow for a border.
""" """
#FIXME
from openlp.core.lib import ScreenList
current_screen = ScreenList().current current_screen = ScreenList().current
self.font_main_y = 0 self.font_main_y = 0
self.font_main_width = current_screen[u'size'].width() - 20 self.font_main_width = current_screen[u'size'].width() - 20

View File

@ -27,7 +27,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # 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 import logging

View File

@ -232,7 +232,7 @@ class Ui_MainWindow(object):
checked=panelLocked, triggers=self.setLockPanel) checked=panelLocked, triggers=self.setLockPanel)
action_list.add_category(UiStrings().ViewMode, action_list.add_category(UiStrings().ViewMode,
CategoryOrder.standardMenu) CategoryOrder.standardMenu)
self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem', checked=False, self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem', checked=False,
category=UiStrings().ViewMode) category=UiStrings().ViewMode)
self.modeSetupItem = create_action(mainWindow, u'modeSetupItem', 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) 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 # Read the temp file and output the user's CONF file with blanks to
# make it more readable. # make it more readable.
temp_conf = open(temp_file, u'r') 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: for file_record in temp_conf:
# Get rid of any invalid entries. # Get rid of any invalid entries.
if file_record.find(u'@Invalid()') == -1: 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) export_conf.write(file_record)
temp_conf.close() temp_conf.close()
export_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)) '- Please wait for copy to finish').replace('%s', self.newDataPath))
dir_util.copy_tree(old_data_path, self.newDataPath) dir_util.copy_tree(old_data_path, self.newDataPath)
log.info(u'Copy sucessful') log.info(u'Copy sucessful')
except (IOError, os.error, DistutilsFileError), why: except (IOError, os.error, DistutilsFileError), why:
Receiver.send_message(u'cursor_normal') Receiver.send_message(u'cursor_normal')
log.exception(u'Data copy failed %s' % unicode(why)) log.exception(u'Data copy failed %s' % unicode(why))
QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'New Data Directory Error'), QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'New Data Directory Error'),

View File

@ -253,7 +253,7 @@ VIDEO_EXT = [
, u'*.mp4' , u'*.mp4'
, u'*.ogv' , u'*.ogv'
, u'*.webm' , u'*.webm'
, u'*.mpg', u'*.wmv', u'*.mpeg', u'*.avi' , u'*.mpg', u'*.wmv', u'*.mpeg', u'*.avi'
, u'*.swf' , u'*.swf'
] ]

View File

@ -245,7 +245,7 @@ class ServiceManager(QtGui.QWidget):
self.maintainAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Reorder Item'), self.maintainAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Reorder Item'),
icon=u':/general/general_edit.png', triggers=self.onServiceItemEditForm) icon=u':/general/general_edit.png', triggers=self.onServiceItemEditForm)
self.notesAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Notes'), 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'), self.timeAction = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Start Time'),
icon=u':/media/media_time.png', triggers=self.onStartTimeForm) icon=u':/media/media_time.png', triggers=self.onStartTimeForm)
self.autoStartAction = create_widget_action(self.menu, text=u'', self.autoStartAction = create_widget_action(self.menu, text=u'',

View File

@ -72,7 +72,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
self.onGradientStartButtonClicked) self.onGradientStartButtonClicked)
QtCore.QObject.connect(self.gradientEndButton, QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked) 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.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.outlineColorButton, QtCore.SIGNAL(u'clicked()'), self.onOutlineColorButtonClicked)
QtCore.QObject.connect(self.shadowColorButton, QtCore.SIGNAL(u'clicked()'), self.onShadowColorButtonClicked) QtCore.QObject.connect(self.shadowColorButton, QtCore.SIGNAL(u'clicked()'), self.onShadowColorButtonClicked)
QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),

View File

@ -778,7 +778,7 @@ class BiblesResourcesDB(QtCore.QObject, Manager):
The source of the webbible. The source of the webbible.
""" """
log.debug(u'BiblesResourcesDB.get_webbibles("%s")', source) log.debug(u'BiblesResourcesDB.get_webbibles("%s")', source)
if not isinstance(source, unicode): if not isinstance(source, unicode):
source = unicode(source) source = unicode(source)
source = BiblesResourcesDB.get_download_source(source) source = BiblesResourcesDB.get_download_source(source)
bibles = BiblesResourcesDB.run_sql(u'SELECT id, name, abbreviation, ' bibles = BiblesResourcesDB.run_sql(u'SELECT id, name, abbreviation, '
@ -953,7 +953,7 @@ class AlternativeBookNamesDB(QtCore.QObject, Manager):
return cursor.fetchall() return cursor.fetchall()
@staticmethod @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. Return a book_reference_id if the name matches.

View File

@ -526,7 +526,7 @@ class HTTPBible(BibleDB):
books = handler.get_books_from_http(self.download_name) books = handler.get_books_from_http(self.download_name)
if not books: if not books:
log.exception(u'Importing books from %s - download name: "%s" '\ 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 return False
self.wizard.progressBar.setMaximum(len(books)+2) self.wizard.progressBar.setMaximum(len(books)+2)
self.wizard.incrementProgressBar(translate( self.wizard.incrementProgressBar(translate(
@ -552,7 +552,7 @@ class HTTPBible(BibleDB):
language_id) language_id)
if not book_ref_id: if not book_ref_id:
log.exception(u'Importing books from %s - download name: "%s" '\ 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 return False
book_details = BiblesResourcesDB.get_book_by_id(book_ref_id) book_details = BiblesResourcesDB.get_book_by_id(book_ref_id)
log.debug(u'Book details: Name:%s; id:%s; testament_id:%s', log.debug(u'Book details: Name:%s; id:%s; testament_id:%s',

View File

@ -228,7 +228,7 @@ class BibleMediaItem(MediaManagerItem):
self.addSearchFields(u'advanced', UiStrings().Advanced) self.addSearchFields(u'advanced', UiStrings().Advanced)
# Combo Boxes # Combo Boxes
QtCore.QObject.connect(self.quickVersionComboBox, QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter) 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)'), QtCore.QObject.connect(self.advancedVersionComboBox,QtCore.SIGNAL(u'activated(int)'),
self.onAdvancedVersionComboBox) self.onAdvancedVersionComboBox)
QtCore.QObject.connect(self.advancedSecondComboBox, QtCore.SIGNAL(u'activated(int)'), QtCore.QObject.connect(self.advancedSecondComboBox, QtCore.SIGNAL(u'activated(int)'),