lint
This commit is contained in:
parent
8698acedbe
commit
852697c2d7
2 changed files with 8 additions and 4 deletions
|
|
@ -6,7 +6,8 @@ from mergedeep import mergedeep
|
||||||
|
|
||||||
from ytdl_sub.prebuilt_presets import PREBUILT_PRESETS
|
from ytdl_sub.prebuilt_presets import PREBUILT_PRESETS
|
||||||
from ytdl_sub.utils.system import IS_WINDOWS
|
from ytdl_sub.utils.system import IS_WINDOWS
|
||||||
from ytdl_sub.validators.file_path_validators import FFmpegFileValidator, FFprobeFileValidator
|
from ytdl_sub.validators.file_path_validators import FFmpegFileValidator
|
||||||
|
from ytdl_sub.validators.file_path_validators import FFprobeFileValidator
|
||||||
from ytdl_sub.validators.strict_dict_validator import StrictDictValidator
|
from ytdl_sub.validators.strict_dict_validator import StrictDictValidator
|
||||||
from ytdl_sub.validators.validators import LiteralDictValidator
|
from ytdl_sub.validators.validators import LiteralDictValidator
|
||||||
from ytdl_sub.validators.validators import StringValidator
|
from ytdl_sub.validators.validators import StringValidator
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,15 @@ from ytdl_sub.validators.validators import StringValidator
|
||||||
|
|
||||||
class FFmpegFileValidator(StringValidator):
|
class FFmpegFileValidator(StringValidator):
|
||||||
_expected_value_type_name = "ffmpeg dependency"
|
_expected_value_type_name = "ffmpeg dependency"
|
||||||
_ffmpeg_dependency = 'ffmpeg'
|
_ffmpeg_dependency = "ffmpeg"
|
||||||
|
|
||||||
def __init__(self, name: str, value: Any):
|
def __init__(self, name: str, value: Any):
|
||||||
super().__init__(name, value)
|
super().__init__(name, value)
|
||||||
if not os.path.isfile(self.value):
|
if not os.path.isfile(self.value):
|
||||||
raise self._validation_exception(
|
raise self._validation_exception(
|
||||||
f"Expects an {self._ffmpeg_dependency} executable at '{self.value}', but does not exist. "
|
f"Expects an {self._ffmpeg_dependency} executable at '{self.value}', but "
|
||||||
f"See https://github.com/jmbannon/ytdl-sub#installation on how to install ffmpeg dependencies."
|
f"does not exist. See https://github.com/jmbannon/ytdl-sub#installation on how "
|
||||||
|
f"to install ffmpeg dependencies."
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
@ -25,9 +26,11 @@ class FFmpegFileValidator(StringValidator):
|
||||||
"""Turn into a Path, then a string, to get correct directory separators"""
|
"""Turn into a Path, then a string, to get correct directory separators"""
|
||||||
return str(Path(self._value))
|
return str(Path(self._value))
|
||||||
|
|
||||||
|
|
||||||
class FFprobeFileValidator(FFmpegFileValidator):
|
class FFprobeFileValidator(FFmpegFileValidator):
|
||||||
_ffmpeg_dependency = "ffprobe"
|
_ffmpeg_dependency = "ffprobe"
|
||||||
|
|
||||||
|
|
||||||
class StringFormatterFilePathValidator(StringFormatterValidator):
|
class StringFormatterFilePathValidator(StringFormatterValidator):
|
||||||
_expected_value_type_name = "filepath"
|
_expected_value_type_name = "filepath"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue