sol.printouts
– PDF printouts generators¶
This module uses ReportLab to produce all the needed printouts.
-
class
sol.printouts.
Badges
(output, tourney)¶ Personal badges.
-
cache_max_age
¶ Cache for one year prized tourneys, no cache otherwise.
-
-
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
-
cache_max_age
¶ Compute the cache control max age, in seconds.
-
createDocument
()¶ Create the base Platypus document.
-
decoratePage
(canvas, doc)¶ Add standard decorations to the current page.
-
execute
(request)¶ Create and build the document.
Parameters: request – the Pyramid request instance
-
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
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.
The bottom left text, SoL description and version by default.
-
getLeftHeader
()¶ The top left text.
-
getLitURL
(request)¶ Compute the Lit URL for this printout, if any.
Parameters: request – the Pyramid request instance
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.
-
cache_max_age
¶ Cache for one year closed championships, no cache otherwise.
-
-
class
sol.printouts.
DoublesRanking
(output, arg)¶ General doubles ranking.
-
class
sol.printouts.
Matches
(output, tourney)¶ Next turn matches.
-
class
sol.printouts.
NationalRanking
(output, tourney, turn=None)¶ 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, locale, turn=None)¶ Current ranking of a tourney.
-
class
sol.printouts.
RatingRanking
(output, rating, locale)¶ Glicko2 rating ranking.
-
cache_max_age
¶ No cache.
-
-
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.
-
cache_max_age
¶ Cache for one year blank score cards, no cache otherwise.
-
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.
-
cache_max_age
¶ Cache for one year prized tourneys, no cache otherwise.
-
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 0x7fa6daaf2eb8>¶ 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 of the document
-
sol.printouts.
normal_style
= <ParagraphStyle 'Normal'>¶ The style used for most of the paragraphs of the document
-
sol.printouts.
prizes_width
= 56.69291338582677¶ 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
= 36.8503937007874¶ 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