forked from openlp/openlp
A couple of small code cleanups to raise our code score on CI.
This commit is contained in:
parent
4da8580c4f
commit
88272a3a6a
@ -26,5 +26,9 @@
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
"""
|
||||
The :mod:`~openlp.core.theme` module contains all the themeing functions used by
|
||||
OpenLP when displaying a song or a scripture.
|
||||
"""
|
||||
|
||||
from openlp.core.theme.theme import Theme
|
||||
|
4
openlp/core/ui/media/vendor/__init__.py
vendored
4
openlp/core/ui/media/vendor/__init__.py
vendored
@ -26,3 +26,7 @@
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
"""
|
||||
The :mod:`~openlp.core.ui.media.vendor` module contains any scripts or libraries
|
||||
from 3rd party vendors which are required to make certain media modules work.
|
||||
"""
|
||||
|
@ -69,7 +69,7 @@ class ScreenList(object):
|
||||
screen_list.screen_list = []
|
||||
screen_list.display_count = 0
|
||||
screen_list.screen_count_changed()
|
||||
screen_list._load_screen_settings()
|
||||
screen_list.load_screen_settings()
|
||||
QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'resized(int)'), screen_list.screen_resolution_changed)
|
||||
QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'screenCountChanged(int)'), screen_list.screen_count_changed)
|
||||
return screen_list
|
||||
@ -237,7 +237,7 @@ class ScreenList(object):
|
||||
y >= size.y() and y <= (size.y() + size.height()):
|
||||
return screen[u'number']
|
||||
|
||||
def _load_screen_settings(self):
|
||||
def load_screen_settings(self):
|
||||
"""
|
||||
Loads the screen size and the monitor number from the settings.
|
||||
"""
|
||||
|
@ -26,6 +26,10 @@
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
"""
|
||||
The :mod:`~openlp.plugins.alerts.lib.alertsmanager` module contains the part of
|
||||
the plugin which manages storing and displaying of alerts.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
|
@ -107,13 +107,13 @@ class WowImport(SongImport):
|
||||
"""
|
||||
if isinstance(self.importSource, list):
|
||||
self.importWizard.progressBar.setMaximum(len(self.importSource))
|
||||
for file in self.importSource:
|
||||
for source in self.importSource:
|
||||
if self.stopImportFlag:
|
||||
return
|
||||
self.setDefaults()
|
||||
song_data = open(file, 'rb')
|
||||
song_data = open(source, 'rb')
|
||||
if song_data.read(19) != u'WoW File\nSong Words':
|
||||
self.logError(file, unicode(translate('SongsPlugin.WordsofWorshipSongImport',
|
||||
self.logError(source, unicode(translate('SongsPlugin.WordsofWorshipSongImport',
|
||||
('Invalid Words of Worship song file. Missing "Wow File\\nSong Words" header.'))))
|
||||
continue
|
||||
# Seek to byte which stores number of blocks in the song
|
||||
@ -121,7 +121,7 @@ class WowImport(SongImport):
|
||||
no_of_blocks = ord(song_data.read(1))
|
||||
song_data.seek(66)
|
||||
if song_data.read(16) != u'CSongDoc::CBlock':
|
||||
self.logError(file, unicode(translate('SongsPlugin.WordsofWorshipSongImport',
|
||||
self.logError(source, unicode(translate('SongsPlugin.WordsofWorshipSongImport',
|
||||
('Invalid Words of Worship song file. Missing "CSongDoc::CBlock" string.'))))
|
||||
continue
|
||||
# Seek to the beginning of the first block
|
||||
@ -150,9 +150,9 @@ class WowImport(SongImport):
|
||||
copyright_length = ord(song_data.read(1))
|
||||
if copyright_length:
|
||||
self.addCopyright(unicode(song_data.read(copyright_length), u'cp1252'))
|
||||
file_name = os.path.split(file)[1]
|
||||
file_name = os.path.split(source)[1]
|
||||
# Get the song title
|
||||
self.title = file_name.rpartition(u'.')[0]
|
||||
song_data.close()
|
||||
if not self.finish():
|
||||
self.logError(file)
|
||||
self.logError(source)
|
||||
|
Loading…
Reference in New Issue
Block a user