[docs] module comicbox.validate.base
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
"""Base validator.""" from pathlib import Path SCHEMA_PATH = Path(__file__).parent.parent / "schemas" class BaseValidator:[docs] """Base validator.""" def __init__(self, schema_path: Path | str) -> None: """Set the full schema path.""" self.schema_path = SCHEMA_PATH / schema_path def validate(self, data: str | bytes | Path) -> None:[docs] """Validate the data against this validator's schema.""" raise NotImplementedError @staticmethod def get_data_str(data: str | bytes | Path) -> str:[docs] """Get data string from bytes or a path.""" if isinstance(data, bytes): data = data.decode() elif isinstance(data, Path): data = data.read_text() return data
From here you can search these documents. Enter your search terms below.