gazette.pdf
Classes
A PDF document. |
|
A PDF document. |
|
A PDF document. |
|
A PDF containing all the notices of a single issue. |
|
A PDF containing all the print only notices of a single issue. |
Module Contents
- class gazette.pdf.Pdf(*args: Any, toc_levels: int = 3, created: str = '', logo: str | None = None, link_color: str | None = None, underline_links: bool = False, underline_width: float | str = 0.5, **kwargs: Any)[source]
Bases:
onegov.pdf.Pdf
A PDF document.
- class gazette.pdf.IndexPdf(*args: Any, toc_levels: int = 3, created: str = '', logo: str | None = None, link_color: str | None = None, underline_links: bool = False, underline_width: float | str = 0.5, **kwargs: Any)[source]
Bases:
Pdf
A PDF document.
- category_index(notices: onegov.gazette.collections.GazetteNoticeCollection) None [source]
Adds a category index.
- class gazette.pdf.NoticesPdf(*args: Any, toc_levels: int = 3, created: str = '', logo: str | None = None, link_color: str | None = None, underline_links: bool = False, underline_width: float | str = 0.5, **kwargs: Any)[source]
Bases:
Pdf
A PDF document.
- notice(notice: onegov.gazette.models.GazetteNotice, layout: onegov.gazette.layout.Layout, publication_number: int | str = 'xxx') None [source]
Adds an official notice.
- class gazette.pdf.IssuePdf(*args: Any, toc_levels: int = 3, created: str = '', logo: str | None = None, link_color: str | None = None, underline_links: bool = False, underline_width: float | str = 0.5, **kwargs: Any)[source]
Bases:
NoticesPdf
A PDF containing all the notices of a single issue.
Allows to automatically assign publication numbers when generating the PDF.
- notice(notice: onegov.gazette.models.GazetteNotice, layout: onegov.gazette.layout.Layout, publication_number: int | str = 'xxx') None [source]
Adds an official notice. Hides the content if it is print only.
- excluded_notices_note(number: int, request: onegov.gazette.request.GazetteRequest) None [source]
Adds a paragraph with the number of excluded (print only) notices.
- unfold_data(session: sqlalchemy.orm.Session, layout: onegov.gazette.layout.Layout, issue: str, data: list[dict[str, Any]], publication_number: int | None, level: int = 1) int | None [source]
Take a nested list of dicts and add it.
- static query_notices(session: sqlalchemy.orm.Session, issue: str, organization: str, category: str) list[uuid.UUID] [source]
Queries all notices with the given values, ordered by publication number.
- classmethod query_used_categories(session: sqlalchemy.orm.Session, issue: onegov.gazette.models.Issue) set[str] [source]
- classmethod query_used_organizations(session: sqlalchemy.orm.Session, issue: onegov.gazette.models.Issue) set[str] [source]
- classmethod query_excluded_notices_count(session: sqlalchemy.orm.Session, issue: onegov.gazette.models.Issue) int [source]
- classmethod from_issue(issue: onegov.gazette.models.Issue, request: onegov.gazette.request.GazetteRequest, first_publication_number: int | None, links: dict[str, str] | None = None) io.BytesIO [source]
Generate a PDF for one issue.
Uses first_publication_number as a starting point for assigning publication numbers. Uses the existing numbers of the notices if None.
- class gazette.pdf.IssuePrintOnlyPdf(*args: Any, toc_levels: int = 3, created: str = '', logo: str | None = None, link_color: str | None = None, underline_links: bool = False, underline_width: float | str = 0.5, **kwargs: Any)[source]
Bases:
IssuePdf
A PDF containing all the print only notices of a single issue.
Generating this PDF does NOT assigns publication numbers!
- notice(notice: onegov.gazette.models.GazetteNotice, layout: onegov.gazette.layout.Layout, publication_number: str | int = 'xxx') None [source]
Adds an official notice.
- excluded_notices_note(number: int, request: onegov.gazette.request.GazetteRequest) None [source]
Adds a paragraph with the number of excluded (print only) notices.
- static query_notices(session: sqlalchemy.orm.Session, issue: str, organization: str, category: str) list[uuid.UUID] [source]
Queries all notices with the given values, ordered by publication number.
- classmethod query_used_categories(session: sqlalchemy.orm.Session, issue: onegov.gazette.models.Issue) set[str] [source]