/usr/share/doc/python-templayer/examples/lawn6c.py is in python-templayer 1.5.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import templayer
import time
import sys
sys.stdout.write("Content-type: text/html\r\n\r\n")
reports = [
('Sunday', ["We've got a groundhog. I will have to stay alert.",
"I lost half a tomato plant to that furry guy."]),
('Monday', ["The grass grew - I saw it."]),
]
tmpl = templayer.HTMLTemplate("lawn6.html")
file_writer = tmpl.start_file()
main_layer = file_writer.open(title="Gordon's Lawn Happenings",
date=time.asctime())
for d, h in reports:
report_layer = main_layer.open_layer('report', day=d)
for happening in h:
happening_layer = report_layer.open_layer('happening')
happening_layer.write(happening)
main_layer.close_child()
file_writer.flush()
file_writer.close()
|