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.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.validators import LiteralDictValidator
|
||||
from ytdl_sub.validators.validators import StringValidator
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ from ytdl_sub.validators.validators import StringValidator
|
|||
|
||||
class FFmpegFileValidator(StringValidator):
|
||||
_expected_value_type_name = "ffmpeg dependency"
|
||||
_ffmpeg_dependency = 'ffmpeg'
|
||||
_ffmpeg_dependency = "ffmpeg"
|
||||
|
||||
def __init__(self, name: str, value: Any):
|
||||
super().__init__(name, value)
|
||||
if not os.path.isfile(self.value):
|
||||
raise self._validation_exception(
|
||||
f"Expects an {self._ffmpeg_dependency} executable at '{self.value}', but does not exist. "
|
||||
f"See https://github.com/jmbannon/ytdl-sub#installation on how to install ffmpeg dependencies."
|
||||
f"Expects an {self._ffmpeg_dependency} executable at '{self.value}', but "
|
||||
f"does not exist. See https://github.com/jmbannon/ytdl-sub#installation on how "
|
||||
f"to install ffmpeg dependencies."
|
||||
)
|
||||
|
||||
@property
|
||||
|
|
@ -25,9 +26,11 @@ class FFmpegFileValidator(StringValidator):
|
|||
"""Turn into a Path, then a string, to get correct directory separators"""
|
||||
return str(Path(self._value))
|
||||
|
||||
|
||||
class FFprobeFileValidator(FFmpegFileValidator):
|
||||
_ffmpeg_dependency = "ffprobe"
|
||||
|
||||
|
||||
class StringFormatterFilePathValidator(StringFormatterValidator):
|
||||
_expected_value_type_name = "filepath"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue