Formatting of HTML_posttitle in deffile.py

matrixdef

#1

Here are all the original mentions of HTML_posttitle in deffile.py:

line 49: HTML_posttitle = ‘’’<script type=“text/javascript” src=“web/matrix.js”>
line676: print HTML_posttitle % (’’, ‘’, ‘’)
lines1264-68: print HTML_posttitle %
(j_array4(choices.features()),
js_array([c for c in choices.patterns() if not c[2]]),
js_array([n for n in choices.numbers()]))
line 1403: print HTML_posttitle
line 1834: print HTML_posttitle % (’’, ‘’, ‘’)
line 1862: print HTML_posttitle % (’’, ‘’, ‘’)

Here’s how I modified it (the function choices.forms() exists):

line 49: HTML_posttitle = ‘’’<script type=“text/javascript” src=“web/matrix.js”>
line676: print HTML_posttitle % (’’, ‘’, ‘’, ‘’)
lines1264-68: print HTML_posttitle %
(j_array4(choices.features()),
js_array([c for c in choices.patterns() if not c[2]]),
js_array([n for n in choices.numbers()]),
js_array([n for n in choices.forms()]))
line 1403: print HTML_posttitle
line 1834: print HTML_posttitle % (’’, ‘’, ‘’, ‘’)
line 1862: print HTML_posttitle % (’’, ‘’, ‘’, ‘’)

This gives me a python error:

TypeError: not all arguments converted during string formatting

I know that this is a string formatting error but don’t understand where I am introducing it. Does anyone see?


#2

I think that adding a call to choices.forms() but leaving print HTML_posttitle % (’’, ‘’, ‘’) elsewhere with just three items in parentheses, whatever they are, works… I don’t understand it though :slight_smile: so if someone has an explanation, it’ll be appreciated and marked as the solution :slight_smile:.