5 This scripts reads the table of footnote qualifiers from Redmine
6 and produces contents of fn_qualifiers.py – a list of valid qualifiers.
10 from urllib2 import urlopen
12 url = 'http://redmine.nowoczesnapolska.org.pl/projects/wl-publikacje/wiki/Lista_skr%C3%B3t%C3%B3w'
14 parser = etree.HTMLParser()
15 tree = etree.parse(urlopen(url), parser)
20 List of standard footnote qualifiers.
21 This file is generated by scripts/fn_qualifiers_list_from_wiki.py,
24 from __future__ import unicode_literals
27 FN_QUALIFIERS = {""".encode('utf-8')
29 for td in tree.findall('//td'):
30 print (" '%s': '%s'," % (
31 td[0].text.replace('\\', '\\\\').replace("'", "\\'"),
32 td[0].tail.strip(' -').replace('\\', '\\\\').replace("'", "\\'")
35 print """ }""".encode('utf-8')