2 # Modified from mako-render by gdb.
3 # TODO: set the lookup path dynamically.
6 from mako.template import Template
7 from mako.lookup import TemplateLookup
9 lookup = TemplateLookup(['.', '/etc/apache2/conf.invirt'])
10 return Template(data, lookup=lookup).render()
13 from os.path import isfile
20 from optparse import OptionParser
22 parser = OptionParser("usage: %prog [FILENAME]")
24 opts, args = parser.parse_args(argv[1:])
25 if len(args) not in (0, 1):
26 parser.error("wrong number of arguments") # Will exit
28 if (len(args) == 0) or (args[0] == "-"):
32 if not isfile(filename):
33 raise SystemExit("error: can't find %s" % filename)
39 if __name__ == "__main__":