示例#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 html_table(row_inp,iter):
    Kow_temp=float(row_inp[0])
    Kow.append(Kow_temp)
    L_temp=float(row_inp[1])
    L.append(L_temp)
    Cs_temp=float(row_inp[2])
    Cs.append(Cs_temp)
    Kd_temp=float(row_inp[3])
    Kd.append(Kd_temp)
    Ps_temp=float(row_inp[4])
    Ps.append(Ps_temp)
    Cw_temp=float(row_inp[5])        
    Cw.append(Cw_temp)
    MW_temp=float(row_inp[6])   
    MW.append(MW_temp)
    Pe_temp=float(row_inp[7])
    Pe.append(Pe_temp)
    
    earth = earthworm_model.earthworm(True,True,Kow_temp,L_temp,Cs_temp,Kd_temp,Ps_temp,Cw_temp,MW_temp,Pe_temp)
    Ce_temp=earth.earthworm_fugacity_out
    Ce_out.append(Ce_temp)

    html = earthworm_tables.table_all_batch(earthworm_tables.pvuheadings,earthworm_tables.sumheadings,earthworm_tables.tmpl, earth)
    
    return html