From 56327689a25a4492b68c1b02519f259c924f3da6 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Tue, 7 Jan 2014 05:49:17 +0100 Subject: [PATCH] Move postprocessor into its own package --- setup.py | 5 ++++- youtube_dl/YoutubeDL.py | 2 +- youtube_dl/__init__.py | 2 +- youtube_dl/{PostProcessor.py => postprocessor/__init__.py} | 7 +++---- 4 files changed, 9 insertions(+), 7 deletions(-) rename youtube_dl/{PostProcessor.py => postprocessor/__init__.py} (99%) diff --git a/setup.py b/setup.py index 653ca9a73..1f45159cd 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,10 @@ setup( author_email='ytdl@yt-dl.org', maintainer='Philipp Hagemeister', maintainer_email='phihag@phihag.de', - packages=['youtube_dl', 'youtube_dl.extractor', 'youtube_dl.downloader'], + packages=[ + 'youtube_dl', + 'youtube_dl.extractor', 'youtube_dl.downloader', + 'youtube_dl.postprocessor'], # Provokes warning on most systems (why?!) # test_suite = 'nose.collector', diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 5748ceaf3..e1be38a53 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -55,7 +55,7 @@ from .utils import ( ) from .extractor import get_info_extractor, gen_extractors from .downloader import get_suitable_downloader -from .PostProcessor import FFmpegMergerPP +from .postprocessor import FFmpegMergerPP from .version import __version__ diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index ba243d4d2..5b0fde4ee 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -75,7 +75,7 @@ from .FileDownloader import ( from .extractor import gen_extractors from .version import __version__ from .YoutubeDL import YoutubeDL -from .PostProcessor import ( +from .postprocessor import ( FFmpegMetadataPP, FFmpegVideoConvertor, FFmpegExtractAudioPP, diff --git a/youtube_dl/PostProcessor.py b/youtube_dl/postprocessor/__init__.py similarity index 99% rename from youtube_dl/PostProcessor.py rename to youtube_dl/postprocessor/__init__.py index 617a17ba9..282cc4d7e 100644 --- a/youtube_dl/PostProcessor.py +++ b/youtube_dl/postprocessor/__init__.py @@ -4,13 +4,14 @@ import sys import time -from .utils import ( +from ..utils import ( compat_subprocess_get_DEVNULL, encodeFilename, + hyphenate_date, PostProcessingError, + prepend_extension, shell_quote, subtitles_filename, - prepend_extension, ) @@ -540,8 +541,6 @@ class XAttrMetadataPP(PostProcessor): def run(self, info): """ Set extended attributes on downloaded file (if xattr support is found). """ - from .utils import hyphenate_date - # This mess below finds the best xattr tool for the job and creates a # "write_xattr" function. try: