Ejemplo n.º 1
0
    def render(self, filename, context):
        # print "xxx TvizREnderer: " + filename

        try:
            templatetxt = open(template_file(filename), 'r').read()
        except Exception as e:
            logging.error("HtmlRenderer: Error reading: " + filename)
            raise e
        
                    
        try:
            outputhtml = template.render(content= templatetxt, context = context)
            
        except Exception as e:
            logging.error("HtmlRenderer: Error rendering: " + filename)
            raise e

        outfile = html_file('tanda.html')
        
        try:
            out = codecs.open(outfile, 'w')
            out.write(outputhtml)
            out.close()
        except:
            logging.error("HtmlRenderer: Error writing to file: " + outfile)
Ejemplo n.º 2
0
 def open_browser(self):
     webbrowser.open(html_file('index.html'), new=0, autoraise=True)
Ejemplo n.º 3
0
 def __init__(self):
     copy(template_file('main.css'), html_file('main.css'))
     copy(template_file('index.html'), html_file('index.html'))