Path
This commit is contained in:
parent
aa7734669c
commit
eafa0a7c68
1 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
from ytdl_sub.validators.string_formatter_validators import StringFormatterValidator, OverridesStringFormatterValidator
|
||||
|
|
@ -8,11 +9,11 @@ class StringFormatterFilePathValidator(StringFormatterValidator):
|
|||
_expected_value_type_name = "filepath"
|
||||
|
||||
def apply_formatter(self, variable_dict: Dict[str, str]) -> str:
|
||||
return os.path.relpath(super().apply_formatter(variable_dict))
|
||||
return str(Path(super().apply_formatter(variable_dict)))
|
||||
|
||||
|
||||
class OverridesStringFormatterValidatorFilePathValidator(OverridesStringFormatterValidator):
|
||||
_expected_value_type_name = "static filepath"
|
||||
|
||||
def apply_formatter(self, variable_dict: Dict[str, str]) -> str:
|
||||
return os.path.relpath(super().apply_formatter(variable_dict))
|
||||
return os.path.realpath(super().apply_formatter(variable_dict))
|
||||
|
|
|
|||
Loading…
Reference in a new issue