|
| 1 | +from __future__ import annotations |
| 2 | + |
| 3 | +import datetime |
| 4 | +import enum |
| 5 | +import pathlib |
| 6 | +import types |
| 7 | +from collections.abc import Callable, Generator |
| 8 | +from typing import Self |
| 9 | + |
| 10 | +class Compression(enum.Enum): |
| 11 | + none: Self |
| 12 | + zstd: Self |
| 13 | + |
| 14 | +class Hint(enum.Enum): |
| 15 | + COMPRESS: Self |
| 16 | + FRONT_ARTICLE: Self |
| 17 | + |
| 18 | +class Blob: |
| 19 | + def __init__(self, content: str | bytes) -> None: ... |
| 20 | + def size(self) -> int: ... |
| 21 | + ref_content: bytes |
| 22 | + |
| 23 | +class ContentProvider: |
| 24 | + def feed(self) -> Blob: ... |
| 25 | + def get_size(self) -> int: ... |
| 26 | + def gen_blob(self) -> Generator[Blob, None, None]: ... |
| 27 | + |
| 28 | + generator: Generator[Blob, None, None] |
| 29 | + |
| 30 | +class StringProvider(ContentProvider): |
| 31 | + def __init__(self, content: str | bytes) -> None: ... |
| 32 | + |
| 33 | +class FileProvider(ContentProvider): |
| 34 | + def __init__(self, filepath: pathlib.Path | str) -> None: ... |
| 35 | + |
| 36 | +class Item: |
| 37 | + def get_path(self) -> str: ... |
| 38 | + def get_title(self) -> str: ... |
| 39 | + def get_mimetype(self) -> str: ... |
| 40 | + def get_contentprovider(self) -> ContentProvider: ... |
| 41 | + def get_hints(self) -> dict[Hint, int]: ... |
| 42 | + def __repr__(self) -> str: ... |
| 43 | + |
| 44 | + get_indexdata: Callable[[], IndexData | None] | None |
| 45 | + _blob: Blob |
| 46 | + |
| 47 | +class IndexData: |
| 48 | + def has_indexdata(self) -> bool: ... |
| 49 | + def get_title(self) -> str: ... |
| 50 | + def get_content(self) -> str: ... |
| 51 | + def get_keywords(self) -> str: ... |
| 52 | + def get_wordcount(self) -> int: ... |
| 53 | + def get_geoposition(self) -> tuple[float, float] | None: ... |
| 54 | + |
| 55 | +class Creator: |
| 56 | + def __init__(self, filename: pathlib.Path) -> None: ... |
| 57 | + def config_verbose(self, verbose: bool) -> Self: ... |
| 58 | + def config_compression(self, compression: Compression | str) -> Self: ... |
| 59 | + def config_clustersize(self, size: int) -> Self: ... |
| 60 | + def config_indexing(self, indexing: bool, language: str) -> Self: ... |
| 61 | + def config_nbworkers(self, nbWorkers: int) -> Self: ... # noqa: N803 |
| 62 | + def set_mainpath(self, mainPath: str) -> Self: ... # noqa: N803 |
| 63 | + def add_illustration(self, size: int, content: bytes) -> None: ... |
| 64 | + def add_item(self, writer_item: Item) -> None: ... |
| 65 | + def add_metadata( |
| 66 | + self, |
| 67 | + name: str, |
| 68 | + content: str | bytes | datetime.date | datetime.datetime, |
| 69 | + mimetype: str = "text/plain;charset=UTF-8", |
| 70 | + ) -> None: ... |
| 71 | + def add_redirection( |
| 72 | + self, |
| 73 | + path: str, |
| 74 | + title: str, |
| 75 | + targetPath: str, # noqa: N803 |
| 76 | + hints: dict[Hint, int], |
| 77 | + ) -> None: ... |
| 78 | + def add_alias( |
| 79 | + self, |
| 80 | + path: str, |
| 81 | + title: str, |
| 82 | + targetPath: str, # noqa: N803 |
| 83 | + hints: dict[Hint, int], |
| 84 | + ) -> None: ... |
| 85 | + def __enter__(self) -> Self: ... |
| 86 | + def __exit__( |
| 87 | + self, |
| 88 | + exc_type: type[BaseException] | None, |
| 89 | + exc_val: BaseException | None, |
| 90 | + exc_tb: types.TracebackType | None, |
| 91 | + ) -> None: ... |
| 92 | + @property |
| 93 | + def filename(self) -> pathlib.Path: ... |
| 94 | + def __repr__(self) -> str: ... |
| 95 | + |
| 96 | + _filename: pathlib.Path |
| 97 | + _started: bool |
0 commit comments