예제 #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)
예제 #2
0
파일: tkui.py 프로젝트: tangoshot/Tviz
 def open_browser(self):
     webbrowser.open(html_file('index.html'), new=0, autoraise=True)
예제 #3
0
 def __init__(self):
     copy(template_file('main.css'), html_file('main.css'))
     copy(template_file('index.html'), html_file('index.html'))