Minor tidy ups

This commit is contained in:
Philip Ridout 2019-03-17 10:36:12 +00:00
parent eb115a0ad4
commit 573f31fd45
4 changed files with 7 additions and 9 deletions

View File

@ -6,7 +6,7 @@
<style type="text/css">
body {
background: transparent !important;
color: #fff !important;
color: rgb(255, 255, 255) !important;
}
sup {
vertical-align: super !important;

View File

@ -150,7 +150,7 @@ def handle_db_error(plugin_name, db_file_path):
Log and report to the user that a database cannot be loaded
:param plugin_name: Name of plugin
:param openlp.core.common.path.Path db_file_path: File name of database
:param openlp.core.common.path.Path db_file_path: File name of database
:return: None
"""
db_path = get_db_path(plugin_name, db_file_path)

View File

@ -454,14 +454,13 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties):
"""
pass
def generate_slide_data(self, service_item, *, item=None, xml_version=False, remote=False,
context=ServiceItemContext.Live, file_path=None):
def generate_slide_data(self, service_item, *, item=None, remote=False, context=ServiceItemContext.Live,
file_path=None):
"""
Generate the slide data. Needs to be implemented by the plugin.
:param service_item: The service Item to be processed
:param item: The database item to be used to build the service item
:param xml_version:
:param remote: Was this remote triggered (False)
:param context: The service context
:param openlp.core.common.path.Path file_path:
@ -626,17 +625,16 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties):
'You must select a {title} '
'service item.').format(title=self.title))
def build_service_item(self, item=None, xml_version=False, remote=False, context=ServiceItemContext.Live):
def build_service_item(self, item=None, remote=False, context=ServiceItemContext.Live):
"""
Common method for generating a service item
:param item: Service Item to be built.
:param xml_version: version of XML (False)
:param remote: Remote triggered (False)
:param context: The context on which this is called
"""
service_item = ServiceItem(self.plugin)
service_item.add_icon()
if self.generate_slide_data(service_item, item=item, xml_version=xml_version, remote=remote, context=context):
if self.generate_slide_data(service_item, item=item, remote=remote, context=context):
return service_item
else:
return None

View File

@ -263,7 +263,7 @@ class ServiceItem(RegistryProperties):
file_location = os.path.join(path, file_name)
file_location_hash = md5_hash(file_location.encode('utf-8'))
image = os.path.join(str(AppLocation.get_section_data_path(self.name)), 'thumbnails',
file_location_hash, ntpath.basename(image)) #TODO: Pathlib
file_location_hash, ntpath.basename(image)) # TODO: Pathlib
self.slides.append({'title': file_name, 'image': image, 'path': path, 'display_title': display_title,
'notes': notes, 'thumbnail': image})
# if self.is_capable(ItemCapabilities.HasThumbnails):