comicbox.readinglists.sources ¶
Where reading lists are fetched from: URLs, Metron and the DieselTech catalog.
Network libraries are imported inside functions, so importing this package stays cheap; only a fetch pays for them.
FetchContext ¶
Bases: Protocol
What a source needs from the session that runs its fetch.
ReadingListSession is one. Sources name this rather than the session class, so the session can import them without a cycle.
Source code in comicbox/readinglists/sources/__init__.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
cancelled property ¶
Set once the session is cancelled.
credentials property ¶
The credentials the session was given, if any.
settings property ¶
The settings every fetch uses.
check_cancelled() ¶
Raise if the session was cancelled.
Source code in comicbox/readinglists/sources/__init__.py
53 54 55 | |
emit(event) ¶
Hand an event to the caller’s handler, if any.
Source code in comicbox/readinglists/sources/__init__.py
49 50 51 | |
http() ¶
Get the session’s HTTP client.
Source code in comicbox/readinglists/sources/__init__.py
57 58 59 | |
attach_source(reading_list, source) ¶
Record where a fetched list came from.
A file read gives its list a source of kind file; a fetched one came from source instead, so that one takes its place, keeping what it knew that source does not, such as a CBL’s curator. A list with no file source gets source first.
Source code in comicbox/readinglists/sources/__init__.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |