Browse Source

strip whitespace off entered fingering notes

master
Ivan Holmes 5 years ago
parent
commit
1d526d3a09
  1. 4
      chordsheet/parsers.py

4
chordsheet/parsers.py

@ -10,13 +10,13 @@ def parseFingering(fingering, instrument):
if len(fingering) == numStrings: # if the fingering is entered in concise format e.g. xx4455
output = list(fingering)
else: # if entered in long format e.g. x,x,10,10,11,11
output = fingering.split(",")
output = fingering.split(",").strip()
if len(output) == numStrings:
return output
else:
raise Exception("Voicing <{}> is malformed.".format(fingering))
elif instrument == 'piano':
return [parseName(note).upper() for note in fingering.split(",")]
return [parseName(note).upper().strip() for note in fingering.split(",")]
else:
return [fingering]

Loading…
Cancel
Save