[util] Move compatibility functions out of util
utils is large enough without these compatibility functions. Everything that is present in newer versions of Python (i.e. with dev Python it's just an import) goes into compat.py . Everything else (i.e. youtube-dl-specific helpers) goes into utils.py .
This commit is contained in:
@ -6,10 +6,11 @@ import os
|
||||
import subprocess
|
||||
|
||||
from .common import PostProcessor
|
||||
|
||||
from ..compat import (
|
||||
compat_urlretrieve,
|
||||
)
|
||||
from ..utils import (
|
||||
check_executable,
|
||||
compat_urlretrieve,
|
||||
encodeFilename,
|
||||
PostProcessingError,
|
||||
prepend_extension,
|
||||
|
@ -3,10 +3,8 @@ from __future__ import unicode_literals
|
||||
import subprocess
|
||||
|
||||
from .common import PostProcessor
|
||||
from ..utils import (
|
||||
shlex_quote,
|
||||
PostProcessingError,
|
||||
)
|
||||
from ..compat import shlex_quote
|
||||
from ..utils import PostProcessingError
|
||||
|
||||
|
||||
class ExecAfterDownloadPP(PostProcessor):
|
||||
|
@ -1,5 +1,4 @@
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
@ -7,8 +6,10 @@ import time
|
||||
|
||||
from .common import AudioConversionError, PostProcessor
|
||||
|
||||
from ..utils import (
|
||||
from ..compat import (
|
||||
compat_subprocess_get_DEVNULL,
|
||||
)
|
||||
from ..utils import (
|
||||
encodeArgument,
|
||||
encodeFilename,
|
||||
get_exe_version,
|
||||
|
@ -3,10 +3,12 @@ import subprocess
|
||||
import sys
|
||||
|
||||
from .common import PostProcessor
|
||||
from ..compat import (
|
||||
subprocess_check_output
|
||||
)
|
||||
from ..utils import (
|
||||
check_executable,
|
||||
hyphenate_date,
|
||||
subprocess_check_output
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user