comparison abcfield.py @ 588:afc031477784

Replace sed substitution with Python templating for HTML and LaTeX output.
author Jim Hague <jim.hague@acm.org>
date Wed, 02 Nov 2016 00:21:18 +0000
parents daa3b76bd11f
children 2face6618bf3
comparison
equal deleted inserted replaced
587:1b79867b4f35 588:afc031477784
154 return letter + accidental + ' ' + abckeys.get(mode, "Major") 154 return letter + accidental + ' ' + abckeys.get(mode, "Major")
155 155
156 # Return the raw text for a given field. Optionally the nth field is taken, 156 # Return the raw text for a given field. Optionally the nth field is taken,
157 # or the field data must start with a designated string to be recognised. 157 # or the field data must start with a designated string to be recognised.
158 def getFieldText(inf, field, n = 1, starts = None): 158 def getFieldText(inf, field, n = 1, starts = None):
159 res = None 159 res = ""
160 for line in inf: 160 for line in inf:
161 line = line.strip() 161 line = line.strip()
162 if len(line) > 2 and line[1] == ':': 162 if len(line) > 2 and line[1] == ':':
163 if line[0] == "+" or (line[0] == field and line[2] == "+"): 163 if line[0] == "+" or (line[0] == field and line[2] == "+"):
164 if not res: 164 if not res: