Migrate from Poetry and pyenv to uv
This commit is contained in:
@@ -4,8 +4,8 @@ Applied when building a folder name from a tag value — the tag keeps its exact
|
||||
value (e.g. rating 87 → tag "Hodnocení/87"), while the folder groups it
|
||||
(→ "…/80–89 %"). Config-driven and extensible via ``TAG_TRANSFORMS``.
|
||||
"""
|
||||
|
||||
import re
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def rating_band(rating: int) -> str:
|
||||
@@ -32,10 +32,10 @@ TAG_TRANSFORMS = {
|
||||
}
|
||||
|
||||
|
||||
def apply_transform(value: str, transform: Optional[str]) -> str:
|
||||
def apply_transform(value: str, transform: str | None) -> str:
|
||||
"""Apply a named tag-schema transform to a value, returning a string."""
|
||||
fn = TAG_TRANSFORMS.get(transform, str)
|
||||
try:
|
||||
return str(fn(value))
|
||||
except (ValueError, TypeError, AttributeError):
|
||||
except ValueError, TypeError, AttributeError:
|
||||
return str(value)
|
||||
|
||||
Reference in New Issue
Block a user