election_day.utils.svg_generator

Module Contents

Classes

SvgGenerator

class election_day.utils.svg_generator.SvgGenerator(app: onegov.election_day.app.ElectionDayApp, renderer: onegov.election_day.utils.d3_renderer.D3Renderer | None = None)[source]
remove(directory: str, files: Collection[str]) None[source]

Safely removes the given files from the directory.

generate_svg(item: onegov.ballot.Election | onegov.ballot.ElectionCompound | onegov.ballot.ElectionCompoundPart | onegov.ballot.Ballot, type_: str, filename: str, locale: str) int[source]

Creates the requested SVG.

Returns the number of created files.

create_svgs() tuple[int, int][source]

Generates all SVGs for the given application.

Only generates SVGs if not already generated since the last change of the election, election compound or vote.

Cleans up unused SVGs.