Rendering pipeline: Generator, Scheduler, Storage

Generator

Parses a config’s YAML and knows how to render any of its screens by name.

class todays_paper_web.generator.Generator(name: str, storage: Storage)[source]

Bases: object

property timezone: ZoneInfo
property debugging: bool
getCurrentScreen() tuple[datetime, str, datetime][source]
getNextScreen(skip: int = 0) tuple[datetime, str][source]
renderScreen(screenName: str) Image[source]
setTimestamp(timestamp: datetime) None[source]

Scheduler

Turns a config’s scheduler: list into a repeating weekly timeline of screen changes.

class todays_paper_web.scheduler.Scheduler(data: Dict, tzinfo: timezone)[source]

Bases: object

getCurrentScreen() tuple[datetime, str, datetime][source]
getNextScreen(skip: int = 0) tuple[datetime, str][source]

Storage

Abstracts config/file access over the local/s3 backends (TP_STORAGE).

class todays_paper_web.storage.storage.Storage[source]

Bases: ABC

instance = None
abstract listConfigs() Iterator[str][source]
abstract getConfig(name: str) str[source]
abstract getFileBytes(config: str, name: str) bytes[source]
abstract getFileObject(config: str, name: str) BinaryIO[source]
static getInstance() Storage[source]