fixed pep8 in pdf.py
This commit is contained in:
parent
a0e4519b62
commit
bdfb714013
@ -9,4 +9,4 @@ install:
|
|||||||
- python extras/scripts/create_local_settings.py
|
- python extras/scripts/create_local_settings.py
|
||||||
script:
|
script:
|
||||||
- coverage run ./manage.py test tests && coverage report -m
|
- coverage run ./manage.py test tests && coverage report -m
|
||||||
- pep8 --max-line-length=150 --exclude="urls.py,motion/,pdf.py" --statistics openslides
|
- pep8 --max-line-length=150 --exclude="urls.py,motion/" --statistics openslides
|
||||||
|
@ -116,93 +116,93 @@ stylesheet.add(ParagraphStyle(
|
|||||||
name='Tablecell',
|
name='Tablecell',
|
||||||
parent=stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize=9))
|
fontSize=9))
|
||||||
stylesheet.add(ParagraphStyle(name = 'Signaturefield',
|
stylesheet.add(ParagraphStyle(name='Signaturefield',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
spaceBefore = 15)
|
spaceBefore=15)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ballot stylesheets
|
# Ballot stylesheets
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_title',
|
stylesheet.add(ParagraphStyle(name='Ballot_title',
|
||||||
parent = stylesheet['Bold'],
|
parent=stylesheet['Bold'],
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leading = 14,
|
leading=14,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_subtitle',
|
stylesheet.add(ParagraphStyle(name='Ballot_subtitle',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 10,
|
fontSize=10,
|
||||||
leading = 12,
|
leading=12,
|
||||||
leftIndent = 30,
|
leftIndent=30,
|
||||||
rightIndent = 20,
|
rightIndent=20,
|
||||||
spaceAfter = 5),
|
spaceAfter=5),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_description',
|
stylesheet.add(ParagraphStyle(name='Ballot_description',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 7,
|
fontSize=7,
|
||||||
leading = 10,
|
leading=10,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_option',
|
stylesheet.add(ParagraphStyle(name='Ballot_option',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leading = 24,
|
leading=24,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Monotype',
|
stylesheet.add(ParagraphStyle(name='Monotype',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontName = 'Courier',
|
fontName='Courier',
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leading = 24,
|
leading=24,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_option_name',
|
stylesheet.add(ParagraphStyle(name='Ballot_option_name',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leading = 15,
|
leading=15,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_option_group',
|
stylesheet.add(ParagraphStyle(name='Ballot_option_group',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 8,
|
fontSize=8,
|
||||||
leading = 15,
|
leading=15,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_option_YNA',
|
stylesheet.add(ParagraphStyle(name='Ballot_option_YNA',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leading = 15,
|
leading=15,
|
||||||
leftIndent = 49,
|
leftIndent=49,
|
||||||
spaceAfter = 18),
|
spaceAfter=18),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Ballot_option_group_right',
|
stylesheet.add(ParagraphStyle(name='Ballot_option_group_right',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 8,
|
fontSize=8,
|
||||||
leading = 16,
|
leading=16,
|
||||||
leftIndent = 49),
|
leftIndent=49),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Badge_title',
|
stylesheet.add(ParagraphStyle(name='Badge_title',
|
||||||
parent = stylesheet['Bold'],
|
parent=stylesheet['Bold'],
|
||||||
fontSize = 16,
|
fontSize=16,
|
||||||
leading = 22,
|
leading=22,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(name = 'Badge_subtitle',
|
stylesheet.add(ParagraphStyle(name='Badge_subtitle',
|
||||||
parent = stylesheet['Normal'],
|
parent=stylesheet['Normal'],
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leading = 24,
|
leading=24,
|
||||||
leftIndent = 30),
|
leftIndent=30),
|
||||||
)
|
)
|
||||||
stylesheet.add(ParagraphStyle(
|
stylesheet.add(ParagraphStyle(
|
||||||
name = 'Badge_italic',
|
name='Badge_italic',
|
||||||
parent = stylesheet['Italic'],
|
parent=stylesheet['Italic'],
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leading = 24,
|
leading=24,
|
||||||
leftIndent = 30,
|
leftIndent=30,
|
||||||
))
|
))
|
||||||
stylesheet.add(ParagraphStyle(
|
stylesheet.add(ParagraphStyle(
|
||||||
name = 'Badge_qrcode',
|
name='Badge_qrcode',
|
||||||
fontSize = 12,
|
fontSize=12,
|
||||||
leftIndent = 190,
|
leftIndent=190,
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
@ -213,13 +213,13 @@ def firstPage(canvas, doc):
|
|||||||
canvas.setFillGray(0.4)
|
canvas.setFillGray(0.4)
|
||||||
|
|
||||||
title_line = u"%s | %s" % (config["event_name"],
|
title_line = u"%s | %s" % (config["event_name"],
|
||||||
config["event_description"])
|
config["event_description"])
|
||||||
if len(title_line) > 75:
|
if len(title_line) > 75:
|
||||||
title_line = "%s ..." % title_line[:70]
|
title_line = "%s ..." % title_line[:70]
|
||||||
canvas.drawString(2.75 * cm, 28 * cm, title_line)
|
canvas.drawString(2.75 * cm, 28 * cm, title_line)
|
||||||
if config["event_date"] and config["event_location"]:
|
if config["event_date"] and config["event_location"]:
|
||||||
canvas.drawString(2.75 * cm, 27.6 * cm, u"%s, %s"
|
canvas.drawString(2.75 * cm, 27.6 * cm, u"%s, %s"
|
||||||
% (config["event_date"], config["event_location"]))
|
% (config["event_date"], config["event_location"]))
|
||||||
|
|
||||||
# time
|
# time
|
||||||
canvas.setFont('Ubuntu', 7)
|
canvas.setFont('Ubuntu', 7)
|
||||||
|
Loading…
Reference in New Issue
Block a user