]> git.scottworley.com Git - paperdoorknob/blob - spec.py
c4975b507e64bf6a3e3622d3e0dbf7fb32901260
[paperdoorknob] / spec.py
1 # paperdoorknob: Print glowfic
2 #
3 # This program is free software: you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License as published by the
5 # Free Software Foundation, version 3.
6
7
8 from dataclasses import dataclass
9
10 from typing import Callable, IO
11
12 from bs4.element import Tag
13
14 from fetch import Fetcher
15 from glowfic import Layout
16 from images import ImageStore
17
18
19 # pylint: disable=too-many-instance-attributes
20 @dataclass(frozen=True)
21 class Spec:
22 url: str
23 fetcher: Fetcher
24 images: ImageStore
25 htmlfilter: Callable[[bytes], bytes]
26 domfilter: Callable[[Tag], None]
27 texfilter: Callable[[bytes], bytes]
28 icon_size: float
29 layout: Layout
30 geometry: str | None
31 texout: IO[bytes]
32 log: Callable[[str], None]