openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #32742
Re: [Merge] lp:~trb143/openlp/cleanups02182 into lp:openlp
Review: Needs Fixing
Been coding a lot in C recently? ;-)
Diff comments:
>
> === modified file 'openlp/core/ui/slidecontroller.py'
> --- openlp/core/ui/slidecontroller.py 2018-02-03 11:32:49 +0000
> +++ openlp/core/ui/slidecontroller.py 2018-03-09 21:16:28 +0000
> @@ -1381,6 +1387,14 @@
> if new_item:
> self.add_service_item(new_item)
>
> + def on_clear(self):
> + """
> + Clear the preview bar.
> + """
> + self.preview_widget.clear_list()
> + self.toolbar.set_widget_visible("editSong", False)
Single quotes
> + self.toolbar.set_widget_visible("clear", False)
Single quotes
> +
> def on_preview_add_to_service(self):
> """
> From the preview display request the Item to be added to service
>
> === modified file 'openlp/plugins/songs/lib/mediaitem.py'
> --- openlp/plugins/songs/lib/mediaitem.py 2018-01-19 21:31:36 +0000
> +++ openlp/plugins/songs/lib/mediaitem.py 2018-03-09 21:16:28 +0000
> @@ -572,10 +572,19 @@
> service_item.add_capability(ItemCapabilities.OnLoadUpdate)
> service_item.add_capability(ItemCapabilities.AddIfNewItem)
> service_item.add_capability(ItemCapabilities.CanSoftBreak)
> + service_item.add_capability(ItemCapabilities.HasMetaData)
> song = self.plugin.manager.get_object(Song, item_id)
> service_item.theme = song.theme_name
> service_item.edit_id = item_id
> verse_list = SongXML().get_verses(song.lyrics)
> + if Settings().value('songs/add songbook slide') and song.songbook_entries:
> + first_slide = "\n"
Single quotes
> + for songbook_entry in song.songbook_entries:
> + first_slide = first_slide + "{book}/{num}/{pub}\n\n".format(book=songbook_entry.songbook.name,
Single quotes
> + num=songbook_entry.entry,
> + pub=songbook_entry.songbook.publisher)
> +
> + service_item.add_from_text(first_slide, "O1")
Single quotes
> # no verse list or only 1 space (in error)
> verse_tags_translated = False
> if VerseType.from_translated_string(str(verse_list[0][0]['type'])) is not None:
> @@ -622,6 +631,9 @@
> if song.media_files:
> service_item.add_capability(ItemCapabilities.HasBackgroundAudio)
> service_item.background_audio = [m.file_path for m in song.media_files]
> + item.metadata.append("<em>{label}:</em> {media}".
Single quotes
> + format(label=translate('SongsPlugin.MediaItem', 'Media'),
> + media=service_item.background_audio))
> return True
>
> def generate_footer(self, item, song):
> @@ -685,6 +697,23 @@
> if Settings().value('core/ccli number'):
> item.raw_footer.append(translate('SongsPlugin.MediaItem',
> 'CCLI License: ') + Settings().value('core/ccli number'))
> + item.metadata.append("<em>{label}:</em> {title}".format(label=translate('SongsPlugin.MediaItem', 'Title'),
Single quotes
> + title=song.title))
> + if song.alternate_title:
> + item.metadata.append("<em>{label}:</em> {title}".
Single quotes
> + format(label=translate('SongsPlugin.MediaItem', 'Alt Title'),
> + title=song.alternate_title))
> + if song.songbook_entries:
> + for songbook_entry in song.songbook_entries:
> + item.metadata.append("<em>{label}:</em> {book}/{num}/{pub}".
Single quotes
> + format(label=translate('SongsPlugin.MediaItem', 'Songbook'),
> + book=songbook_entry.songbook.name,
> + num=songbook_entry.entry,
> + pub=songbook_entry.songbook.publisher))
> + if song.topics:
> + for topics in song.topics:
> + item.metadata.append("<em>{label}:</em> {topic}".
Single quotes
> + format(label=translate('SongsPlugin.MediaItem', 'Topic'), topic=topics.name))
> return authors_all
>
> def service_load(self, item):
>
> === modified file 'tests/functional/openlp_core/api/endpoint/test_controller.py'
> --- tests/functional/openlp_core/api/endpoint/test_controller.py 2018-02-03 14:41:18 +0000
> +++ tests/functional/openlp_core/api/endpoint/test_controller.py 2018-03-09 21:16:28 +0000
> @@ -52,3 +52,25 @@
> results = ret['results']
> assert isinstance(results['item'], MagicMock)
> assert len(results['slides']) == 0
> +
> + def test_controller_direction_next(self):
> + """
> + Text the live next method is triggered
> + """
> + # GIVEN: A mocked service with a dummy service item
> + self.mocked_live_controller.service_item = MagicMock()
> + # WHEN: I trigger the method
> + controller_direction(None, "live", "next")
Single quotes
> + # THEN: The correct method is called
> + self.mocked_live_controller.slidecontroller_live_next.emit.assert_called_once_with()
> +
> + def test_controller_direction_previous(self):
> + """
> + Text the live next method is triggered
> + """
> + # GIVEN: A mocked service with a dummy service item
> + self.mocked_live_controller.service_item = MagicMock()
> + # WHEN: I trigger the method
> + controller_direction(None, "live", "previous")
Single quotes
> + # THEN: The correct method is called
> + self.mocked_live_controller.slidecontroller_live_previous.emit.assert_called_once_with()
>
> === modified file 'tests/functional/openlp_plugins/songs/test_mediaitem.py'
> --- tests/functional/openlp_plugins/songs/test_mediaitem.py 2017-12-29 09:15:48 +0000
> +++ tests/functional/openlp_plugins/songs/test_mediaitem.py 2018-03-09 21:16:28 +0000
> @@ -431,10 +431,12 @@
> # GIVEN: A Song and a Service Item
> song = Song()
> song.title = 'My Song'
> + song.alternate_title = ""
Single quotes
> song.copyright = 'My copyright'
> song.authors_songs = []
> song.songbook_entries = []
> song.ccli_number = ''
> + song.topics = None
> book1 = MagicMock()
> book1.name = "My songbook"
Single quotes
> book2 = MagicMock()
--
https://code.launchpad.net/~trb143/openlp/cleanups02182/+merge/341268
Your team OpenLP Core is subscribed to branch lp:openlp.
References