コード例 #1
0
#!/usr/bin/env python
from jinja2 import Template
from pcgen import find_all_pathfinder_spells

spells = find_all_pathfinder_spells()

with open("templates/spells.html") as tmplfh:
    template = tmplfh.read()
    template = Template(template)

sortedspells = sorted(spells, key=lambda s: s.name)

html = template.render(spells=sortedspells)

with open("spells.html", "w") as htmlfh:
    htmlfh.write(html)
コード例 #2
0
    def test_parse_all_spells(self):
        spells = find_all_pathfinder_spells()

        for spell in spells:
            self.assertIsNotNone(spell.sourcelong, "SOURCELONG for %s is None" % spell)