aboutsummaryrefslogtreecommitdiffstats
path: root/src/epy_reader/ebooks/base.py
blob: 0869db95a877acb72b749f700cfa611c0a1fc7c5 (plain) (blame)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import xml.etree.ElementTree as ET
from typing import Tuple, Union

from epy_reader.models import BookMetadata, TocEntry


class Ebook:
    def __init__(self, fileepub: str):
        raise NotImplementedError("Ebook.__init__() not implemented")

    @property
    def path(self) -> str:
        return self._path

    @path.setter
    def path(self, value: str) -> None:
        self._path = value

    @property
    def contents(self) -> Union[Tuple[str, ...], Tuple[ET.Element, ...]]:
        return self._contents

    @contents.setter
    def contents(self, value: Union[Tuple[str, ...], Tuple[ET.Element, ...]]) -> None:
        self._contents = value

    @property
    def toc_entries(self) -> Tuple[TocEntry, ...]:
        return self._toc_entries

    @toc_entries.setter
    def toc_entries(self, value: Tuple[TocEntry, ...]) -> None:
        self._toc_entries = value

    def get_meta(self) -> BookMetadata:
        raise NotImplementedError("Ebook.get_meta() not implemented")

    def initialize(self) -> None:
        raise NotImplementedError("Ebook.initialize() not implemented")

    def get_raw_text(self, content: Union[str, ET.Element]) -> str:
        raise NotImplementedError("Ebook.get_raw_text() not implemented")

    def get_img_bytestr(self, impath: str) -> Tuple[str, bytes]:
        raise NotImplementedError("Ebook.get_img_bytestr() not implemented")

    def cleanup(self) -> None:
        raise NotImplementedError("Ebook.cleanup() not implemented")