Skip to content

Commit 0355b9d

Browse files
committed
Remove spacer stuff, and just set spaceAfter on default paragraphStyle instead
1 parent d87f787 commit 0355b9d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pyth/plugins/pdf/writer.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pyth import document
99
from pyth.format import PythWriter
1010

11-
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
11+
from reportlab.platypus import SimpleDocTemplate, Paragraph
1212
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
1313
from reportlab.lib.pagesizes import A4
1414
from reportlab.lib.units import inch
@@ -28,8 +28,8 @@
2828
class PDFWriter(PythWriter):
2929

3030
@classmethod
31-
def write(klass, document, target=None, paragraphStyle=None, spacer=None):
32-
writer = PDFWriter(document, paragraphStyle, spacer)
31+
def write(klass, document, target=None, paragraphStyle=None):
32+
writer = PDFWriter(document, paragraphStyle)
3333
story = writer.go()
3434

3535
if target is None:
@@ -40,17 +40,14 @@ def write(klass, document, target=None, paragraphStyle=None, spacer=None):
4040
return target
4141

4242

43-
def __init__(self, doc, paragraphStyle=None, spacer=None):
43+
def __init__(self, doc, paragraphStyle=None):
4444
self.document = doc
4545

4646
if paragraphStyle is None:
4747
stylesheet = getSampleStyleSheet()
4848
paragraphStyle = stylesheet['Normal']
4949
self.paragraphStyle = paragraphStyle
50-
51-
if spacer is None:
52-
spacer = Spacer(0, DEFAULT_PARA_SPACE)
53-
self.spacer = spacer
50+
self.paragraphStyle.spaceAfter = 0.2 * inch
5451

5552
self.paragraphDispatch = {
5653
document.List: self._list,
@@ -61,7 +58,6 @@ def go(self):
6158
self.paragraphs = []
6259
for para in self.document.content:
6360
self._dispatch(para)
64-
self.paragraphs.append(self.spacer)
6561
return self.paragraphs
6662

6763

0 commit comments

Comments
 (0)