forked from openlp/openlp
PEP8 fixes
This commit is contained in:
parent
648e0b2290
commit
7dc1b8b759
@ -143,7 +143,7 @@ class EasyWorshipSongImport(SongImport):
|
||||
# Offset Field Data type Length Details
|
||||
# ------------------------------------------------------------------------------------------------
|
||||
# 0 Title cstring 50
|
||||
# 307 Author cstring 50
|
||||
# 307 Author cstring 50
|
||||
# 358 Copyright cstring 100
|
||||
# 459 Administrator cstring 50
|
||||
# 800 Content pointer int32le 4 Position of the content for this entry.
|
||||
@ -166,7 +166,7 @@ class EasyWorshipSongImport(SongImport):
|
||||
# Load song content
|
||||
# Offset Field Data type Length Details
|
||||
# ------------------------------------------------------------------------------------------------
|
||||
# 0 Length int32le 4 Length (L) of the content, including the compressed content
|
||||
# 0 Length int32le 4 Length (L) of content, including the compressed content
|
||||
# and the following fields (14 bytes total).
|
||||
# 4 Content string L-14 Content compressed with deflate.
|
||||
# Checksum int32be 4 Alder-32 checksum.
|
||||
@ -319,7 +319,7 @@ class EasyWorshipSongImport(SongImport):
|
||||
def set_song_import_object(self, authors, words):
|
||||
"""
|
||||
Set the SongImport object members.
|
||||
|
||||
|
||||
:param authors: String with authons
|
||||
:param words: Bytes with rtf-encoding
|
||||
:return:
|
||||
@ -459,7 +459,7 @@ class EasyWorshipSongImport(SongImport):
|
||||
def get_bytes(self, pos, length):
|
||||
"""
|
||||
Get bytes from ews_file
|
||||
|
||||
|
||||
:param pos: Position to read from
|
||||
:param length: Bytes to read
|
||||
:return: Bytes read
|
||||
@ -470,7 +470,7 @@ class EasyWorshipSongImport(SongImport):
|
||||
def get_string(self, pos, length):
|
||||
"""
|
||||
Get string from ews_file
|
||||
|
||||
|
||||
:param pos: Position to read from
|
||||
:param length: Characters to read
|
||||
:return: String read
|
||||
@ -483,7 +483,7 @@ class EasyWorshipSongImport(SongImport):
|
||||
def get_i16(self, pos):
|
||||
"""
|
||||
Get short int from ews_file
|
||||
|
||||
|
||||
:param pos: Position to read from
|
||||
:return: Short integer read
|
||||
"""
|
||||
@ -496,7 +496,7 @@ class EasyWorshipSongImport(SongImport):
|
||||
def get_i32(self, pos):
|
||||
"""
|
||||
Get long int from ews_file
|
||||
|
||||
|
||||
:param pos: Position to read from
|
||||
:return: Long integer read
|
||||
"""
|
||||
|
@ -70,19 +70,18 @@ SONG_TEST_DATA = [
|
||||
'verse_order_list': []}]
|
||||
|
||||
EWS_SONG_TEST_DATA =\
|
||||
{ 'title' : 'Vi pløjed og vi så\'de',
|
||||
'authors' : ['Matthias Claudius'],
|
||||
'verses' :
|
||||
{'title': 'Vi pløjed og vi så\'de',
|
||||
'authors': ['Matthias Claudius'],
|
||||
'verses':
|
||||
[('Vi pløjed og vi så\'de\nvor sæd i sorten jord,\nså bad vi ham os hjælpe,\nsom højt i Himlen bor,\n'
|
||||
'og han lod snefald hegne\nmod frosten barsk og hård,\nhan lod det tø og regne\nog varme mildt i vår.',
|
||||
'og han lod snefald hegne\nmod frosten barsk og hård,\nhan lod det tø og regne\nog varme mildt i vår.',
|
||||
'v1'),
|
||||
('Alle gode gaver\nde kommer ovenned,\nså tak da Gud, ja, pris dog Gud\nfor al hans kærlighed!', 'c1'),
|
||||
('Han er jo den, hvis vilje\nopholder alle ting,\nhan klæder markens lilje\nog runder himlens ring,\n'
|
||||
'ham lyder vind og vove,\nham rører ravnes nød,\nhvi skulle ej hans småbørn\nda og få dagligt brød?', 'v2'),
|
||||
('Ja, tak, du kære Fader,\nså mild, så rig, så rund,\nfor korn i hæs og lader,\nfor godt i allen stund!\n'
|
||||
'Vi kan jo intet give,\nsom nogen ting er værd,\nmen tag vort stakkels hjerte,\nså ringe som det er!',
|
||||
'v3')],
|
||||
}
|
||||
'v3')]}
|
||||
|
||||
|
||||
class EasyWorshipSongImportLogger(EasyWorshipSongImport):
|
||||
@ -435,7 +434,8 @@ class TestEasyWorshipSongImport(TestCase):
|
||||
# GIVEN: Test files with a mocked out SongImport class, a mocked out "manager", a mocked out "import_wizard",
|
||||
# and mocked out "author", "add_copyright", "add_verse", "finish" methods.
|
||||
with patch('openlp.plugins.songs.lib.ewimport.SongImport'), \
|
||||
patch('openlp.plugins.songs.lib.ewimport.retrieve_windows_encoding') as mocked_retrieve_windows_encoding:
|
||||
patch('openlp.plugins.songs.lib.ewimport.retrieve_windows_encoding') \
|
||||
as mocked_retrieve_windows_encoding:
|
||||
mocked_retrieve_windows_encoding.return_value = 'cp1252'
|
||||
mocked_manager = MagicMock()
|
||||
mocked_import_wizard = MagicMock()
|
||||
|
Loading…
Reference in New Issue
Block a user