Browse Source

add space before credits

fix whitespace stripping bug
master
Ivan Holmes 5 years ago
parent
commit
c9c45f66d5
  1. 2
      chordsheet/parsers.py
  2. 3
      chordsheet/render.py
  3. 2
      test.py

2
chordsheet/parsers.py

@ -10,7 +10,7 @@ def parseFingering(fingering, instrument):
if len(fingering) == numStrings: # if the fingering is entered in concise format e.g. xx4455 if len(fingering) == numStrings: # if the fingering is entered in concise format e.g. xx4455
output = list(fingering) output = list(fingering)
else: # if entered in long format e.g. x,x,10,10,11,11 else: # if entered in long format e.g. x,x,10,10,11,11
output = fingering.split(",").strip()
output = [f.strip() for f in fingering.split(",")]
if len(output) == numStrings: if len(output) == numStrings:
return output return output
else: else:

3
chordsheet/render.py

@ -517,6 +517,9 @@ class Renderer:
rlDocList.append( rlDocList.append(
Paragraph(self.document.subtitle, styles['Subtitle'])) Paragraph(self.document.subtitle, styles['Subtitle']))
if self.document.composer or self.document.arranger:
rlDocList.append(Spacer(0, 2*mm))
if self.document.composer: if self.document.composer:
rlDocList.append(Paragraph("Composer: {c}".format( rlDocList.append(Paragraph("Composer: {c}".format(
c=self.document.composer), styles['Credits'])) c=self.document.composer), styles['Credits']))

2
test.py

@ -12,4 +12,4 @@ doc = Document.newFromXML('examples/test.xml')
style = Style(unitWidth=10) style = Style(unitWidth=10)
ren = Renderer(doc, style) ren = Renderer(doc, style)
ren.savePDF('test.pdf')
ren.savePDF('/Users/ivan/Desktop/test.pdf')
Loading…
Cancel
Save