org.pdf.ticket ============== .. py:module:: org.pdf.ticket Classes ------- .. autoapisummary:: org.pdf.ticket.TicketQrCode org.pdf.ticket.TicketPdf Module Contents --------------- .. py:class:: TicketQrCode(payload: str | bytes, border: int | None = None, box_size: int | None = None, fill_color: str | None = None, back_color: str | None = None, img_format: str | None = None, encoding: Literal['base64'] | None = None) Bases: :py:obj:`onegov.qrcode.QrCode` Generates QR Codes .. py:attribute:: _border :value: 0 .. py:class:: TicketPdf(*args: Any, **kwargs: Any) Bases: :py:obj:`onegov.pdf.Pdf` A PDF document. .. py:attribute:: ticket :type: onegov.ticket.Ticket .. py:attribute:: locale :type: str | None .. py:attribute:: translations :type: dict[str, gettext.GNUTranslations] .. py:attribute:: layout :type: onegov.org.layout.DefaultLayout .. py:method:: translate(text: str) -> str Translates the given string. .. py:method:: h1(title: str) -> None Translated H1. .. py:method:: h2(title: str) -> None Translated H2. .. py:method:: h3(title: str) -> None Translated H3. .. py:method:: page_fn_header_and_footer(canvas: reportlab.pdfgen.canvas.Canvas, doc: onegov.pdf.templates.Template) -> None :staticmethod: .. py:method:: page_fn_header_and_footer_qr(canvas: reportlab.pdfgen.canvas.Canvas, doc: onegov.pdf.templates.Template) -> None :staticmethod: .. py:property:: page_fn :type: collections.abc.Callable[[reportlab.pdfgen.canvas.Canvas, onegov.pdf.templates.Template], None] First page the same as later except Qr-Code ... .. py:property:: page_fn_later :type: collections.abc.Callable[[reportlab.pdfgen.canvas.Canvas, onegov.pdf.templates.Template], None] .. py:method:: table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | collections.abc.Sequence[float | None] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None = None, ratios: Literal[False] = False, border: bool = True, first_bold: bool = True) -> None table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | list[float] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None = None, *, ratios: Literal[True], border: bool = True, first_bold: bool = True) -> None table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | list[float] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None, ratios: Literal[True], border: bool = True, first_bold: bool = True) -> None table(data: collections.abc.Sequence[collections.abc.Sequence[str | reportlab.platypus.Paragraph]], columns: Literal['even'] | collections.abc.Sequence[float | None] | None, style: reportlab.platypus.tables.TableStyle | collections.abc.Iterable[reportlab.platypus.tables._TableCommand] | None = None, ratios: bool = False, border: bool = True, first_bold: bool = True) -> None Adds a table where every cell is wrapped in a paragraph so that the cells are wrappable. .. py:method:: ticket_summary(html: str | None, linkify: bool = True) -> None A copy of the mini_html adapted for ticket summary. We have to guarantee some backwards compatibility here whenever we change the templates and thereby the snapshot of tickets. Must work for templates: - directory_entry_submission - display_event - display_form - reservations .. py:method:: ticket_metadata() -> None .. py:method:: ticket_payment() -> None .. py:method:: p_markup(text: str, style: reportlab.lib.styles.PropertySet | None = None) -> None .. py:method:: ticket_timeline(msg_feed: collections.abc.Mapping[str, Any] | None) -> None Will parse the timeline from view_messages_feed .. py:method:: extract_feed_info(html: str) -> list[str | None] | None :staticmethod: Must be able to parse templates message_{message.type}.pt and return the useful data in cleaned form. .. py:method:: from_ticket(request: onegov.org.request.OrgRequest, ticket: onegov.ticket.Ticket) -> io.BytesIO :classmethod: Creates a PDF representation of the ticket. It is sensible to the templates used to render the message feed and the summary of the ticket coming from ticket handler. With this approach, snapshotted summaries are supported.