Ejemplo n.º 1
0
 def __setattr__(self, key: str, value: Any):
     converter = {
         "date": parse_date,
         "episode": int,
         "season": int,
         "series": fn_pipe(str_replace_slashes, str_title_case),
         "title": fn_pipe(str_replace_slashes, str_title_case),
     }.get(key)
     if value is not None and converter:
         value = converter(value)
     super().__setattr__(key, value)
Ejemplo n.º 2
0
 def __setattr__(self, key: str, value: Any):
     converter = {
         "name": fn_pipe(str_replace_slashes, str_title_case),
         "year": year_parse,
     }.get(key)
     if value is not None and converter:
         value = converter(value)
     super().__setattr__(key, value)
Ejemplo n.º 3
0
 def __setattr__(self, key: str, value: Any):
     converter_map: Dict[str, Callable] = {
         "name": fn_pipe(str_replace_slashes, str_title_case),
         "year": year_parse,
     }
     converter: Optional[Callable] = converter_map.get(key)
     if value is not None and converter:
         value = converter(value)
     super().__setattr__(key, value)