Fix quotes

This commit is contained in:
Tim Bentley 2018-03-09 21:58:45 +00:00
parent 0130e7fc09
commit 2531e56910
4 changed files with 15 additions and 15 deletions

View File

@ -1392,8 +1392,8 @@ class SlideController(DisplayController, LogMixin, RegistryProperties):
Clear the preview bar. Clear the preview bar.
""" """
self.preview_widget.clear_list() self.preview_widget.clear_list()
self.toolbar.set_widget_visible("editSong", False) self.toolbar.set_widget_visible('editSong', False)
self.toolbar.set_widget_visible("clear", False) self.toolbar.set_widget_visible('"clear', False)
def on_preview_add_to_service(self): def on_preview_add_to_service(self):
""" """

View File

@ -578,13 +578,13 @@ class SongMediaItem(MediaManagerItem):
service_item.edit_id = item_id service_item.edit_id = item_id
verse_list = SongXML().get_verses(song.lyrics) verse_list = SongXML().get_verses(song.lyrics)
if Settings().value('songs/add songbook slide') and song.songbook_entries: if Settings().value('songs/add songbook slide') and song.songbook_entries:
first_slide = "\n" first_slide = '\n'
for songbook_entry in song.songbook_entries: for songbook_entry in song.songbook_entries:
first_slide = first_slide + "{book}/{num}/{pub}\n\n".format(book=songbook_entry.songbook.name, first_slide = first_slide + '{book}/{num}/{pub}\n\n'.format(book=songbook_entry.songbook.name,
num=songbook_entry.entry, num=songbook_entry.entry,
pub=songbook_entry.songbook.publisher) pub=songbook_entry.songbook.publisher)
service_item.add_from_text(first_slide, "O1") service_item.add_from_text(first_slide, 'O1')
# no verse list or only 1 space (in error) # no verse list or only 1 space (in error)
verse_tags_translated = False verse_tags_translated = False
if VerseType.from_translated_string(str(verse_list[0][0]['type'])) is not None: if VerseType.from_translated_string(str(verse_list[0][0]['type'])) is not None:
@ -631,7 +631,7 @@ class SongMediaItem(MediaManagerItem):
if song.media_files: if song.media_files:
service_item.add_capability(ItemCapabilities.HasBackgroundAudio) service_item.add_capability(ItemCapabilities.HasBackgroundAudio)
service_item.background_audio = [m.file_path for m in song.media_files] service_item.background_audio = [m.file_path for m in song.media_files]
item.metadata.append("<em>{label}:</em> {media}". item.metadata.append('<em>{label}:</em> {media}'.
format(label=translate('SongsPlugin.MediaItem', 'Media'), format(label=translate('SongsPlugin.MediaItem', 'Media'),
media=service_item.background_audio)) media=service_item.background_audio))
return True return True
@ -697,22 +697,22 @@ class SongMediaItem(MediaManagerItem):
if Settings().value('core/ccli number'): if Settings().value('core/ccli number'):
item.raw_footer.append(translate('SongsPlugin.MediaItem', item.raw_footer.append(translate('SongsPlugin.MediaItem',
'CCLI License: ') + Settings().value('core/ccli number')) 'CCLI License: ') + Settings().value('core/ccli number'))
item.metadata.append("<em>{label}:</em> {title}".format(label=translate('SongsPlugin.MediaItem', 'Title'), item.metadata.append('<em>{label}:</em> {title}'.format(label=translate('SongsPlugin.MediaItem', 'Title'),
title=song.title)) title=song.title))
if song.alternate_title: if song.alternate_title:
item.metadata.append("<em>{label}:</em> {title}". item.metadata.append('<em>{label}:</em> {title}'.
format(label=translate('SongsPlugin.MediaItem', 'Alt Title'), format(label=translate('SongsPlugin.MediaItem', 'Alt Title'),
title=song.alternate_title)) title=song.alternate_title))
if song.songbook_entries: if song.songbook_entries:
for songbook_entry in song.songbook_entries: for songbook_entry in song.songbook_entries:
item.metadata.append("<em>{label}:</em> {book}/{num}/{pub}". item.metadata.append('<em>{label}:</em> {book}/{num}/{pub}'.
format(label=translate('SongsPlugin.MediaItem', 'Songbook'), format(label=translate('SongsPlugin.MediaItem', 'Songbook'),
book=songbook_entry.songbook.name, book=songbook_entry.songbook.name,
num=songbook_entry.entry, num=songbook_entry.entry,
pub=songbook_entry.songbook.publisher)) pub=songbook_entry.songbook.publisher))
if song.topics: if song.topics:
for topics in song.topics: for topics in song.topics:
item.metadata.append("<em>{label}:</em> {topic}". item.metadata.append('<em>{label}:</em> {topic}'.
format(label=translate('SongsPlugin.MediaItem', 'Topic'), topic=topics.name)) format(label=translate('SongsPlugin.MediaItem', 'Topic'), topic=topics.name))
return authors_all return authors_all

View File

@ -60,7 +60,7 @@ class TestController(TestCase):
# GIVEN: A mocked service with a dummy service item # GIVEN: A mocked service with a dummy service item
self.mocked_live_controller.service_item = MagicMock() self.mocked_live_controller.service_item = MagicMock()
# WHEN: I trigger the method # WHEN: I trigger the method
controller_direction(None, "live", "next") controller_direction(None, 'live', 'next')
# THEN: The correct method is called # THEN: The correct method is called
self.mocked_live_controller.slidecontroller_live_next.emit.assert_called_once_with() self.mocked_live_controller.slidecontroller_live_next.emit.assert_called_once_with()
@ -71,6 +71,6 @@ class TestController(TestCase):
# GIVEN: A mocked service with a dummy service item # GIVEN: A mocked service with a dummy service item
self.mocked_live_controller.service_item = MagicMock() self.mocked_live_controller.service_item = MagicMock()
# WHEN: I trigger the method # WHEN: I trigger the method
controller_direction(None, "live", "previous") controller_direction(None, 'live', 'previous')
# THEN: The correct method is called # THEN: The correct method is called
self.mocked_live_controller.slidecontroller_live_previous.emit.assert_called_once_with() self.mocked_live_controller.slidecontroller_live_previous.emit.assert_called_once_with()

View File

@ -431,16 +431,16 @@ class TestMediaItem(TestCase, TestMixin):
# GIVEN: A Song and a Service Item # GIVEN: A Song and a Service Item
song = Song() song = Song()
song.title = 'My Song' song.title = 'My Song'
song.alternate_title = "" song.alternate_title = ''
song.copyright = 'My copyright' song.copyright = 'My copyright'
song.authors_songs = [] song.authors_songs = []
song.songbook_entries = [] song.songbook_entries = []
song.ccli_number = '' song.ccli_number = ''
song.topics = None song.topics = None
book1 = MagicMock() book1 = MagicMock()
book1.name = "My songbook" book1.name = 'My songbook'
book2 = MagicMock() book2 = MagicMock()
book2.name = "Thy songbook" book2.name = 'Thy songbook'
song.songbookentries = [] song.songbookentries = []
song.add_songbook_entry(book1, '12') song.add_songbook_entry(book1, '12')
song.add_songbook_entry(book2, '502A') song.add_songbook_entry(book2, '502A')