def get(self):
        form = cgi.FieldStorage() 
        jid = form.getvalue('jid')
        model_name = form.getvalue('model_name')
        results = rest_funcs.create_batchoutput_html(jid, model_name)
        iter_html=""
        for single_obj in results:

            batch_header = """
                <div class="out_">
                    <br><H3>Batch Calculation of Iteration %s:</H3>
                </div>
                """%(single_obj.iter_index+1)
            iter_html = iter_html + batch_header + przm_tables.table_all(single_obj)

        ####Finally, assemble batchout page############ 
        templatepath = os.path.dirname(__file__) + '/templates/'
        ChkCookie = self.request.cookies.get("ubercookie")
        html = uber_lib.SkinChk(ChkCookie, 'Batch')
        html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'przm','page':'output'})


        html = html + template.render (templatepath + '03ubertext_links_left.html', {})                
        html = html + template.render(templatepath + '04uberoutput_start.html', {
                'model':'przm',
                'model_attributes':'PRZM Batch Output'})
        html = html + przm_tables.timestamp("", jid)
        html = html + iter_html
        html = html + template.render(templatepath + '04uberoutput_end.html', {'sub_title': ''})
        html = html + template.render(templatepath + '06uberfooter.html', {'links': ''})


        self.response.out.write(html)
示例#2
0
    def post(self):
        form = cgi.FieldStorage() 
        # print form
        args={}
        for key in form:
            args[key] = form.getvalue(key)
        args["run_type"] = "single"

        przm_obj = przm_model.przm(args)
        # logger.info(vars(przm_obj))

        templatepath = os.path.dirname(__file__) + '/../templates/'
        ChkCookie = self.request.cookies.get("ubercookie")
        html = uber_lib.SkinChk(ChkCookie, "PRZM Output")
        html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'przm','page':'output'})
        html = html + template.render (templatepath + '03ubertext_links_left.html', {})                
        html = html + template.render(templatepath + '04uberoutput_start.html', {
                'model':'przm', 
                'model_attributes':'PRZM Output'})
        html = html + przm_tables.timestamp(przm_obj)
        html = html + przm_tables.table_all(przm_obj)
        html = html + template.render(templatepath + 'export.html', {})
        html = html + template.render(templatepath + '04uberoutput_end.html', {})
        html = html + template.render(templatepath + '06uberfooter.html', {'links': ''})
        rest_funcs.save_dic(html, przm_obj.__dict__, 'przm', 'single')
        self.response.out.write(html)
    def get(self):
        form = cgi.FieldStorage() 
        jid = form.getvalue('jid')
        model_name = form.getvalue('model_name')
        results = rest_funcs.create_batchoutput_html(jid, model_name)
        iter_html=""
        for single_obj in results:

            batch_header = """
                <div class="out_">
                    <br><H3>Batch Calculation of Iteration %s:</H3>
                </div>
                """%(single_obj.iter_index+1)
            iter_html = iter_html + batch_header + przm_tables.table_all(single_obj)

        ####Finally, assemble batchout page############ 
        templatepath = os.path.dirname(__file__) + '/templates/'
        ChkCookie = self.request.cookies.get("ubercookie")
        html = uber_lib.SkinChk(ChkCookie, 'Batch')
        html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {
                'site_skin' : os.environ['SITE_SKIN'],
                'model':'przm',
                'page':'output'})
        html = html + template.render (templatepath + '03ubertext_links_left.html', {})                
        html = html + template.render(templatepath + '04uberoutput_start.html', {
                'model':'przm',
                'model_attributes':'PRZM Batch Output'})
        html = html + przm_tables.timestamp("", jid)
        html = html + iter_html
        html = html + template.render(templatepath + '04uberoutput_end.html', {'sub_title': ''})
        html = html + template.render(templatepath + '06uberfooter.html', {'links': ''})


        self.response.out.write(html)