Skip to content

Commit

Permalink
refactor: fix linter errors about too long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
sectasy0 committed Jun 15, 2023
1 parent 3ec859b commit d868db7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pyi18n/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def load_file(file_path: str, ser_mod: Type, l_type: str) -> Dict:
if not l_type:
raise ValueError('l_type must be valid loader type')

loader_params: dict[str, Any] = {'Loader': FullLoader} if l_type == 'yaml' else {}
yaml_type: bool = l_type == 'yaml'
loader_params: dict[str, Any] = {'Loader': FullLoader} if yaml_type else {}
with open(file_path, "r", encoding="utf-8") as file:
return ser_mod.load(file, **loader_params)

Expand Down
7 changes: 5 additions & 2 deletions pyi18n/tasks/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ def get_locales(locale_path: str, namespaced: bool, ext: str) -> tuple:
tuple: locales found in the directory.
"""
target_func: dict = {
True: lambda: [p.name for p in Path(locale_path).iterdir() if p.is_dir()],
True: lambda: [
p.name for p
in Path(locale_path).iterdir() if p.is_dir()],
False: lambda: [
Path(file).stem for file in listdir(locale_path) if file.endswith(ext)
Path(file).stem for file
in listdir(locale_path)if file.endswith(ext)
],
}
return tuple(target_func[namespaced]())
Expand Down

0 comments on commit d868db7

Please sign in to comment.