5 This scripts reads the table of footnote qualifiers from Redmine
6 and produces contents of fn_qualifiers.py – a list of valid qualifiers.
8 from __future__ import print_function, unicode_literals
10 from lxml import etree
11 from six.moves.urllib.request import urlopen
13 url = 'http://redmine.nowoczesnapolska.org.pl/projects/wl-publikacje/wiki/Lista_skr%C3%B3t%C3%B3w'
15 parser = etree.HTMLParser()
16 tree = etree.parse(urlopen(url), parser)
21 List of standard footnote qualifiers.
22 This file is generated by scripts/fn_qualifiers_list_from_wiki.py,
25 from __future__ import unicode_literals
30 for td in tree.findall('//td'):
31 print((" '%s': '%s'," % (
32 td[0].text.replace('\\', '\\\\').replace("'", "\\'"),
33 td[0].tail.strip(' -').replace('\\', '\\\\').replace("'", "\\'")