Beispiel #1
0
 def post(self):
     form = cgi.FieldStorage()
     k_ow = float(form.getvalue('k_ow'))
     l_f_e = float(form.getvalue('l_f_e'))
     c_s = float(form.getvalue('c_s'))
     k_d = float(form.getvalue('k_d'))
     p_s = float(form.getvalue('p_s'))
     c_w = float(form.getvalue('c_w'))
     m_w = float(form.getvalue('m_w'))
     p_e = float(form.getvalue('p_e'))
     
     earthworm_obj = earthworm_model.earthworm(True,True,k_ow,l_f_e,c_s,k_d,p_s,c_w,m_w,p_e)
     logger.info(vars(earthworm_obj))
     
     # text_file = open('earthworm/earthworm_description.txt','r')
     # x = text_file.read()
     templatepath = os.path.dirname(__file__) + '/../templates/'
     ChkCookie = self.request.cookies.get("ubercookie")
     html = uber_lib.SkinChk(ChkCookie, "Earthworm Output")   
     html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html',  {'model':'earthworm','page':'output'})
     html = html + template.render (templatepath + '03ubertext_links_left.html', {})                               
     html = html + template.render(templatepath + '04uberoutput_start.html', {
             'model':'earthworm', 
             'model_attributes':'Earthworm Output'})
     
     html = html + earthworm_tables.timestamp()
     html = html + earthworm_tables.table_all(earthworm_obj)
     html = html + template.render(templatepath + 'export.html', {})
     html = html + template.render(templatepath + '04uberoutput_end.html', {})
     html = html + template.render(templatepath + '06uberfooter.html', {'links': ''})
     self.response.out.write(html)
 def post(self):
     text_file1 = open('earthworm/earthworm_description.txt','r')
     x = text_file1.read()
     form = cgi.FieldStorage()
     logger.info(form) 
     thefile = form['file-0']
     iter_html=loop_html(thefile)        
     templatepath = os.path.dirname(__file__) + '/../templates/'
     # ChkCookie = self.request.cookies.get("ubercookie")
     # html = uber_lib.SkinChk(ChkCookie)
     # html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'earthworm','page':'batchinput'})
     # html = html + template.render (templatepath + '03ubertext_links_left.html', {})                
     html = template.render(templatepath + '04uberbatch_start.html', {
             'model':'earthworm',
             'model_attributes':'earthworm Batch Output'})
     html = html + earthworm_tables.timestamp()
     html = html + iter_html
     # html = html + template.render(templatepath + 'earthworm-batchoutput-jqplot.html', {})
     html = html + template.render(templatepath + '04uberoutput_end.html', {'sub_title': ''})
     # html = html + template.render(templatepath + '06uberfooter.html', {'links': ''})
     self.response.out.write(html)