Homepage: https://theme.roundabout-host.com

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 themes.py

View raw Download
text/x-script.python • 795 B
Python script, ASCII text executable
        
            
1
#!/usr/bin/python3
2
3
import lxml.etree as ET
4
5
dom = ET.parse("themes.xml")
6
xslt = ET.parse("themes.xsl")
7
transform = ET.XSLT(xslt)
8
newdom = transform(dom)
9
with open("themes.html", "w") as file:
10
file.write("""<!--DO NOT EDIT THIS FILE MANUALLY.
11
This file, themes.html, is automatically generated using the Python script: themes.py.
12
13
That script uses 2 other files that you may want to edit instead: themes.xml, themes.xsl.
14
* themes.xml includes all data,
15
* themes.xsl includes instructions for the Python script on how to render that data into valid HTML.
16
17
You may also want to edit themes.css, which is the stylesheet for this specific page.
18
19
I know all these files are named exactly the same, that's literally just so that they appear next to eachother---it's so nice.
20
-->""" + str(newdom))
21