I started building a simple Python app that behaves like BC, out of
frustration one day when BC was down, but didn't take it very far because
BC came back online. It runs a simple local web server on port 8000.
It's a 15 minutes job that merges index.html into template.html but perhaps
you can take it further:
import web
import os
urls = (
'/(.*)', 'index'
)
app = web.application(urls, globals())
class index:
def GET(self, name):
html = "No such file"
template_content = ""
if not name:
name = ''
try:
f = open(name, 'r')
html = f.read()
f.close()
except IOError:
pass
try:
template_file = open('template.html','r')
template_content = template_file.read()
template_file.close()
make sure this is a template
if "" in template_content.lower(): template_content.replace("",html)
else:
print "your template.html does not contain "
except IOError, e:
print e
pass
return template_content
if __name__ == "__main__":
app.run()
On Tue, Jun 3, 2014 at 2:30 PM, Robert Bell (Bosweb) <