From 5f6a1245ffa9276c1af59b0835afeef67e2fb5b1 Mon Sep 17 00:00:00 2001 From: Jouke Waleson Date: Sun, 23 Nov 2014 20:41:03 +0100 Subject: PEP8 applied --- youtube_dl/postprocessor/execafterdownload.py | 1 - youtube_dl/postprocessor/ffmpeg.py | 18 +++++++++--------- youtube_dl/postprocessor/xattrpp.py | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'youtube_dl/postprocessor') diff --git a/youtube_dl/postprocessor/execafterdownload.py b/youtube_dl/postprocessor/execafterdownload.py index baf1b1945..09db43611 100644 --- a/youtube_dl/postprocessor/execafterdownload.py +++ b/youtube_dl/postprocessor/execafterdownload.py @@ -26,4 +26,3 @@ class ExecAfterDownloadPP(PostProcessor): 'Command returned error code %d' % retCode) return None, information # by default, keep file and do nothing - diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index f3f2743c0..dfae735f3 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -202,7 +202,7 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor): extension = 'wav' more_opts += ['-f', 'wav'] - prefix, sep, ext = path.rpartition(u'.') # not os.path.splitext, since the latter does not work on unicode in all setups + prefix, sep, ext = path.rpartition(u'.') # not os.path.splitext, since the latter does not work on unicode in all setups new_path = prefix + sep + extension # If we download foo.mp3 and convert it to... foo.mp3, then don't delete foo.mp3, silly. @@ -216,7 +216,7 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor): self._downloader.to_screen(u'[' + self._executable + '] Destination: ' + new_path) self.run_ffmpeg(path, new_path, acodec, more_opts) except: - etype,e,tb = sys.exc_info() + etype, e, tb = sys.exc_info() if isinstance(e, AudioConversionError): msg = u'audio conversion failed: ' + e.msg else: @@ -231,13 +231,13 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor): self._downloader.report_warning(u'Cannot update utime of audio file') information['filepath'] = new_path - return self._nopostoverwrites,information + return self._nopostoverwrites, information class FFmpegVideoConvertor(FFmpegPostProcessor): - def __init__(self, downloader=None,preferedformat=None): + def __init__(self, downloader=None, preferedformat=None): super(FFmpegVideoConvertor, self).__init__(downloader) - self._preferedformat=preferedformat + self._preferedformat = preferedformat def run(self, information): path = information['filepath'] @@ -245,13 +245,13 @@ class FFmpegVideoConvertor(FFmpegPostProcessor): outpath = prefix + sep + self._preferedformat if information['ext'] == self._preferedformat: self._downloader.to_screen(u'[ffmpeg] Not converting video file %s - already is in target format %s' % (path, self._preferedformat)) - return True,information - self._downloader.to_screen(u'['+'ffmpeg'+'] Converting video from %s to %s, Destination: ' % (information['ext'], self._preferedformat) +outpath) + return True, information + self._downloader.to_screen(u'['+'ffmpeg'+'] Converting video from %s to %s, Destination: ' % (information['ext'], self._preferedformat) + outpath) self.run_ffmpeg(path, outpath, []) information['filepath'] = outpath information['format'] = self._preferedformat information['ext'] = self._preferedformat - return False,information + return False, information class FFmpegEmbedSubtitlePP(FFmpegPostProcessor): @@ -457,7 +457,7 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor): self._downloader.to_screen(u'[ffmpeg] Subtitles can only be embedded in mp4 files') return True, information if not information.get('subtitles'): - self._downloader.to_screen(u'[ffmpeg] There aren\'t any subtitles to embed') + self._downloader.to_screen(u'[ffmpeg] There aren\'t any subtitles to embed') return True, information sub_langs = [key for key in information['subtitles']] diff --git a/youtube_dl/postprocessor/xattrpp.py b/youtube_dl/postprocessor/xattrpp.py index b5cae41c8..d1991c4f8 100644 --- a/youtube_dl/postprocessor/xattrpp.py +++ b/youtube_dl/postprocessor/xattrpp.py @@ -108,4 +108,3 @@ class XAttrMetadataPP(PostProcessor): except (subprocess.CalledProcessError, OSError): self._downloader.report_error("This filesystem doesn't support extended attributes. (You may have to enable them in your /etc/fstab)") return False, info - -- cgit v1.2.3