MCPcopy
hub / github.com/eudicots/Cactus / preBuild

Function preBuild

cactus/tests/data/skeleton/plugins/haml.disabled.py:15–36  ·  view source on GitHub ↗
(site)

Source from the content-addressed store, hash-verified

13CLEANUP = []
14
15def preBuild(site):
16 for path in fileList(site.paths['pages']):
17
18 #only file ends with haml
19 if not path.endswith('.haml'):
20 continue
21
22 #read the lines
23 haml_lines = codecs.open(path, 'r', encoding='utf-8').read().splitlines()
24
25 #compile haml to html
26 compiler = Compiler()
27 output = compiler.process_lines(haml_lines)
28
29 #replace path
30 outPath = path.replace('.haml', '.html')
31
32 #write the html file
33 with open(outPath,'w') as f:
34 f.write(output)
35
36 CLEANUP.append(outPath)
37
38
39def postBuild(site):

Callers

nothing calls this directly

Calls 4

fileListFunction · 0.90
readMethod · 0.80
openMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected