From 817fe854e48cf14b9dc0efc961e30930f17e207c Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 22 Apr 2014 22:42:07 +0200 Subject: [PATCH] PEP8 fixes --- openlp/core/lib/serviceitem.py | 5 ++--- openlp/core/ui/media/mediacontroller.py | 10 ++++++---- openlp/core/ui/media/vlcplayer.py | 2 +- openlp/plugins/media/forms/mediaclipselectorform.py | 9 ++++++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 7e9528503..6aba66252 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -504,7 +504,7 @@ class ServiceItem(RegistryProperties): Confirms if the ServiceItem uses a file """ return self.service_item_type == ServiceItemType.Image or \ - (self.service_item_type == ServiceItemType.Command and not self.is_capable(ItemCapabilities.IsOptical)) + (self.service_item_type == ServiceItemType.Command and not self.is_capable(ItemCapabilities.IsOptical)) def is_text(self): """ @@ -645,5 +645,4 @@ class ServiceItem(RegistryProperties): file_suffix = frame['title'].split('.')[-1] if file_suffix.lower() not in suffix_list: self.is_valid = False - break - + break \ No newline at end of file diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index c720c22d0..993172354 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -38,7 +38,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties, Settings, UiStrings, translate from openlp.core.lib import OpenLPToolbar, ItemCapabilities from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players, parse_optical_path +from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players,\ + parse_optical_path from openlp.core.ui.media.mediaplayer import MediaPlayer from openlp.core.common import AppLocation from openlp.core.ui import DisplayControllerType @@ -373,7 +374,8 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties): log.debug('video is optical and live') path = service_item.get_frame_path() (name, title, audio_track, subtitle_track, start, end) = parse_optical_path(path) - is_valid = self.media_setup_optical(name, title, audio_track, subtitle_track, start, end, display, controller) + is_valid = self.media_setup_optical(name, title, audio_track, subtitle_track, start, end, display, + controller) else: log.debug('video is not optical and live') is_valid = self._check_file_type(controller, display, service_item) @@ -391,7 +393,8 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties): log.debug('video is optical and preview') path = service_item.get_frame_path() (name, title, audio_track, subtitle_track, start, end) = parse_optical_path(path) - is_valid = self.media_setup_optical(name, title, audio_track, subtitle_track, start, end, display, controller) + is_valid = self.media_setup_optical(name, title, audio_track, subtitle_track, start, end, display, + controller) else: log.debug('video is not optical and preview') is_valid = self._check_file_type(controller, display, service_item) @@ -460,7 +463,6 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties): self.media_reset(controller) # Setup media info controller.media_info = MediaInfo() - #controller.media_info.volume = 0 controller.media_info.file_info = QtCore.QFileInfo(filename) controller.media_info.media_type = MediaType.DVD controller.media_info.start_time = start/1000 diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 8f8aa1ac1..9f060a2dc 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -212,7 +212,7 @@ class VlcPlayer(MediaPlayer): if self.state != MediaState.Paused and controller.media_info.start_time > 0: log.debug('vlc play, starttime set') start_time = controller.media_info.start_time - log.debug('mediatype: ' +str(controller.media_info.media_type)) + log.debug('mediatype: ' + str(controller.media_info.media_type)) # Set tracks for the optical device if controller.media_info.media_type == MediaType.DVD: log.debug('vlc play, playing started') diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index 653cfdae2..e9f46d9d1 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -74,9 +74,11 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector): self.close_pushbutton.clicked.connect(self.reject) # setup play/pause icon self.play_icon = QtGui.QIcon() - self.play_icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_start.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.play_icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_start.png"), QtGui.QIcon.Normal, + QtGui.QIcon.Off) self.pause_icon = QtGui.QIcon() - self.pause_icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_pause.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.pause_icon.addPixmap(QtGui.QPixmap(":/slides/media_playback_pause.png"), QtGui.QIcon.Normal, + QtGui.QIcon.Off) def reject(self): """ @@ -519,7 +521,8 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector): if device_props.Get('org.freedesktop.UDisks.Device', 'DeviceIsDrive'): drive_props = device_props.Get('org.freedesktop.UDisks.Device', 'DriveMediaCompatibility') if any('optical' in prop for prop in drive_props): - self.media_path_combobox.addItem(device_props.Get('org.freedesktop.UDisks.Device', 'DeviceFile')) + self.media_path_combobox.addItem(device_props.Get('org.freedesktop.UDisks.Device', + 'DeviceFile')) elif sys.platform.startswith('darwin'): # Look for DVD folders in devices to find optical devices volumes = os.listdir('/Volumes')