fix: lambda
This commit is contained in:
@@ -60,11 +60,11 @@ class GenericTTSBackend:
|
||||
".ogg": "ogg",
|
||||
}
|
||||
|
||||
_INPUT_FLAG_MAP = lambda x: [
|
||||
"--input-dir", x] if x else ["--input-file", x]
|
||||
_INPUT_FLAG_MAP = lambda self, is_dir, path: [
|
||||
"--input-dir", path] if is_dir else ["--input-file", path]
|
||||
|
||||
_OUTPUT_FLAG_MAP = lambda x: [
|
||||
"--output-dir", x] if x else ["--output-file", x]
|
||||
_OUTPUT_FLAG_MAP = lambda self, is_dir, path: [
|
||||
"--output-dir", path] if is_dir else ["--output-file", path]
|
||||
|
||||
def __init__(self,**kwargs):
|
||||
for k,v in kwargs.items():
|
||||
@@ -79,11 +79,13 @@ class GenericTTSBackend:
|
||||
|
||||
|
||||
def gen_input_flag(self, input_path: Path) -> str:
|
||||
return self._INPUT_FLAG_MAP(self._normalize_path(input_path).is_dir())
|
||||
return self._INPUT_FLAG_MAP(
|
||||
self._normalize_path(input_path).is_dir(), input_path)
|
||||
|
||||
|
||||
def gen_output_flag(self, output_path: Path) -> str:
|
||||
return self._OUTPUT_FLAG_MAP(self._normalize_path(output_path).is_dir())
|
||||
return self._OUTPUT_FLAG_MAP(
|
||||
self._normalize_path(output_path).is_dir(), output_path)
|
||||
|
||||
|
||||
def _build_command(self, input_source: PathLike, output_dest: PathLike) -> list[str]:
|
||||
|
||||
Reference in New Issue
Block a user