PEP8 fixes

This commit is contained in:
Tomas Groth 2014-04-22 22:42:07 +02:00
parent c6d85ff523
commit 817fe854e4
4 changed files with 15 additions and 11 deletions

View File

@ -646,4 +646,3 @@ class ServiceItem(RegistryProperties):
if file_suffix.lower() not in suffix_list: if file_suffix.lower() not in suffix_list:
self.is_valid = False self.is_valid = False
break break

View File

@ -38,7 +38,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties, Settings, UiStrings, translate from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties, Settings, UiStrings, translate
from openlp.core.lib import OpenLPToolbar, ItemCapabilities from openlp.core.lib import OpenLPToolbar, ItemCapabilities
from openlp.core.lib.ui import critical_error_message_box 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.ui.media.mediaplayer import MediaPlayer
from openlp.core.common import AppLocation from openlp.core.common import AppLocation
from openlp.core.ui import DisplayControllerType from openlp.core.ui import DisplayControllerType
@ -373,7 +374,8 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties):
log.debug('video is optical and live') log.debug('video is optical and live')
path = service_item.get_frame_path() path = service_item.get_frame_path()
(name, title, audio_track, subtitle_track, start, end) = parse_optical_path(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: else:
log.debug('video is not optical and live') log.debug('video is not optical and live')
is_valid = self._check_file_type(controller, display, service_item) 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') log.debug('video is optical and preview')
path = service_item.get_frame_path() path = service_item.get_frame_path()
(name, title, audio_track, subtitle_track, start, end) = parse_optical_path(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: else:
log.debug('video is not optical and preview') log.debug('video is not optical and preview')
is_valid = self._check_file_type(controller, display, service_item) is_valid = self._check_file_type(controller, display, service_item)
@ -460,7 +463,6 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties):
self.media_reset(controller) self.media_reset(controller)
# Setup media info # Setup media info
controller.media_info = MediaInfo() controller.media_info = MediaInfo()
#controller.media_info.volume = 0
controller.media_info.file_info = QtCore.QFileInfo(filename) controller.media_info.file_info = QtCore.QFileInfo(filename)
controller.media_info.media_type = MediaType.DVD controller.media_info.media_type = MediaType.DVD
controller.media_info.start_time = start/1000 controller.media_info.start_time = start/1000

View File

@ -74,9 +74,11 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector):
self.close_pushbutton.clicked.connect(self.reject) self.close_pushbutton.clicked.connect(self.reject)
# setup play/pause icon # setup play/pause icon
self.play_icon = QtGui.QIcon() 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 = 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): def reject(self):
""" """
@ -519,7 +521,8 @@ class MediaClipSelectorForm(QtGui.QDialog, Ui_MediaClipSelector):
if device_props.Get('org.freedesktop.UDisks.Device', 'DeviceIsDrive'): if device_props.Get('org.freedesktop.UDisks.Device', 'DeviceIsDrive'):
drive_props = device_props.Get('org.freedesktop.UDisks.Device', 'DriveMediaCompatibility') drive_props = device_props.Get('org.freedesktop.UDisks.Device', 'DriveMediaCompatibility')
if any('optical' in prop for prop in drive_props): 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'): elif sys.platform.startswith('darwin'):
# Look for DVD folders in devices to find optical devices # Look for DVD folders in devices to find optical devices
volumes = os.listdir('/Volumes') volumes = os.listdir('/Volumes')