Strings that can contain escape sequences but can be a maximum of 1 character in length.
| 292 | |
| 293 | |
| 294 | class EscapedChar(EscapedString): |
| 295 | """Strings that can contain escape sequences but can be a maximum of 1 character in length.""" |
| 296 | |
| 297 | def __init__(self, value: str): |
| 298 | super().__init__(value, length_limit=1) |
| 299 | |
| 300 | @staticmethod |
| 301 | def from_config(config_value: str, default: "EscapedString") -> "EscapedChar": |
| 302 | try: |
| 303 | return EscapedChar(config_value) |
| 304 | except (UnicodeDecodeError, UnicodeEncodeError) as ex: |
| 305 | raise OptionParseFailure( |
| 306 | "Value must be valid UTF-8 string with escape characters." |
| 307 | ) from ex |
| 308 | |
| 309 | |
| 310 | class TimecodeFormat(Enum): |
no outgoing calls
no test coverage detected