Subversion Repositories LCARS

Rev

View as "text/plain" | Blame | Last modification | View Log | RSS feed

1
#!/usr/bin/env python3

from sys import argv
from lxml import etree
from os.path import dirname

if __name__ == "__main__":
    with open(argv[1]) as scorefile:
        scorefile_tree = etree.parse(scorefile)
        with open(dirname(argv[0]) + '/scorefile2filters.xsl') as stylesheet:
            stylesheet_tree = etree.parse(stylesheet)
            transform = etree.XSLT(stylesheet_tree)
            filterfile_text = transform(scorefile_tree)
            print(filterfile_text)