sol.printouts – PDF printouts generators — SoL 3 developers documentation

### Navigation

- index
- modules |
- next |
- previous |
- Dev's documentation »
- SoL modules »

# `sol.printouts` – PDF printouts generators

This module uses ReportLab to produce all the needed printouts.

class `sol.printouts.` `Badges`(output, tourney)

  Personal badges.

class `sol.printouts.` `BasicPrintout`(output, columns)

  Abstract base class used to implement the printouts.

  This class implements the logic used by most printouts, producing a PDF document in the output filename.

  The document has a front page with an header, a body splitted into columns frames and a footer. Succeding pages do not have the header frame.

  `bottomMargin` = 28.346456692913385

    The width of the bottom margin, by default 1cm

  `createDocument`()

    Create the base Platypus document.

  `decoratePage`(canvas, doc)

    Add standard decorations to the current page.

  `execute`()

    Create and build the document.

  classmethod `getArgumentsFromRequest`(klass, session, request)

    Extract needed arguments for the constructor from the request.

    Parameters: | session – the SQLAlchemy session request – the Pyramid request instance
    Return type: | a sequence of arguments

  `getCenterFooter`()

    The bottom center text, current page number by default.

  `getCenterHeader`()

    The top center text.

  `getElements`()

    Return a list or an iterator of all the elements.

  `getLeftFooter`()

    The bottom left text, SoL description and version by default.

  `getLeftHeader`()

    The top left text.

  `getRightFooter`()

    The bottom right text, current time by default.

  `getRightHeader`()

    The top right text.

  `getSubTitle`()

    The subtitle of the document.

  `getTitle`()

    The title of the document.

  `leftMargin` = 28.346456692913385

    The width of the left margin, by default 1cm

  `pagesize` = (595.275590551181, 841.8897637795275)

    The page size, by default A4 in portrait orientation

  `rightMargin` = 28.346456692913385

    The width of the right margin, by default 1cm

  `topMargin` = 28.346456692913385

    The width of the top margin, by default 1cm

class `sol.printouts.` `ChampionshipRanking`(output, arg)

  Championship ranking.

class `sol.printouts.` `DoublesRanking`(output, arg)

  General doubles ranking.

class `sol.printouts.` `Matches`(output, tourney)

  Next turn matches.

class `sol.printouts.` `NationalRanking`(output, tourney)

  Current ranking of a tourney by nationality.

class `sol.printouts.` `Participants`(output, tourney)

  List of partecipants of a tourney.

class `sol.printouts.` `Ranking`(output, tourney)

  Current ranking of a tourney.

class `sol.printouts.` `RatingRanking`(output, rating)

  Glicko2 rating ranking.

class `sol.printouts.` `Results`(output, tourney, turn)

  Results of the last turn.

class `sol.printouts.` `ScoreCards`(output, tourney, columns=2)

  Score cards, where match results are written by the competitors.

  `decoratePage`(canvas, doc)

    Add crop-marks to the page.

class `sol.printouts.` `SinglesRanking`(output, arg)

  General singles ranking.

class `sol.printouts.` `TourneyPrintout`(output, tourney, columns)

  Basic tourney printout, to be further specialized.

  `getCenterHeader`()

    Return location and date of the event.

  `getElements`()

    Yield basic elements for the title frame in the first page.

  `getLeftHeader`()

    Return championship description.

  `getRightHeader`()

    Return championship’s club description.

  `getTitle`()

    Return tourney description.

class `sol.printouts.` `WomenRanking`(output, arg)

  General women ranking.

`sol.printouts.` `badgename_style` = <ParagraphStyle 'Italic'>

  The style used for the player name on the badges

`sol.printouts.` `base_style` = <reportlab.lib.styles.StyleSheet1 object at 0x7f0f49e8ee90>

  The base style used to build the document

`sol.printouts.` `caption_style` = <ParagraphStyle 'Italic'>

  The style used for the caption of the table’s columns

`sol.printouts.` `cardinfo_style` = <ParagraphStyle 'Italic'>

  The style used for the additional info on the score cards

`sol.printouts.` `cardname_style` = <ParagraphStyle 'Italic'>

  The style used for the player name on the score cards

`sol.printouts.` `cardsmall_style` = <ParagraphStyle 'Normal'>

  The style used for most of the text on the score cards

`sol.printouts.` `cardtitle_style` = <ParagraphStyle 'Normal'>

  The style used for the title of the score cards

`sol.printouts.` `heading_style` = <ParagraphStyle 'Heading2'>

  The style used for the heading paragraphs the document

`sol.printouts.` `normal_style` = <ParagraphStyle 'Normal'>

  The style used for most of the paragraphs of the document

`sol.printouts.` `prizes_width` = 39.685039370078734

  The width of the prizes columns

`sol.printouts.` `rank_width` = 22.67716535433071

  The width of the rank columns

`sol.printouts.` `reduce_fontsize_to_fit_width`(text, maxwidth, *styles)

  Reduce the font size of the given styles to fit a max width.

  Parameters: | text – the string of text maxwidth – maximum width that can be used styles – the list of styles that should be adapted
  Returns: | a list of (copies of) the styles with the adapted font size

`sol.printouts.` `scores_width` = 34.01574803149606

  The width of the scores columns

`sol.printouts.` `subtitle_style` = <ParagraphStyle 'Heading1'>

  The style used for the subtitle of the document

`sol.printouts.` `title_style` = <ParagraphStyle 'Title'>

  The style used for the title of the document

### Navigation

- index
- modules |
- next |
- previous |
- Dev's documentation »
- SoL modules »