Exemplo n.º 1
0
    def get(self):
        templatepath = os.path.dirname(__file__) + '/../templates/'
        ChkCookie = self.request.cookies.get("ubercookie")
        html = uber_lib.SkinChk(ChkCookie, "STIR QA/QC")
        html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'stir','page':'qaqc'})
        html = html + template.render (templatepath + '03ubertext_links_left.html', {})                
        html = html + template.render(templatepath + '04uberoutput_start.html', {
                'model':'stir',
                'model_attributes':'STIR QAQC'})

        pvuheadings = stir_tables.getheaderpvu()
        pvuheadingsqaqc = stir_tables.getheaderpvuqaqc()
        pvrheadings = stir_tables.getheaderpvr()
        pvrheadingsqaqc = stir_tables.getheaderpvrqaqc()
        djtemplate = stir_tables.getdjtemplate()
        tmpl = Template(djtemplate)
        
        #instantiate stir model object
        # sm = stir_model.StirModel(True,True,chemical_name,application_rate,column_height,spray_drift_fraction,direct_spray_duration, 
        #     molecular_weight,vapor_pressure,avian_oral_ld50, body_weight_assessed_bird, body_weight_tested_bird, mineau_scaling_factor, 
        #     mammal_inhalation_lc50,duration_mammal_inhalation_study,body_weight_assessed_mammal, body_weight_tested_mammal, 
        #     mammal_oral_ld50)

        html = html + stir_tables.timestamp()
        html = html + stir_tables.table_1qaqc(pvuheadings,tmpl,stir_obj)
        html = html + stir_tables.table_2(pvuheadings,tmpl,stir_obj)
        html = html + stir_tables.table_3qaqc(pvuheadingsqaqc,tmpl,stir_obj)
        html = html + stir_tables.table_4qaqc(pvuheadingsqaqc,tmpl,stir_obj)
        html = html + stir_tables.table_5qaqc(pvrheadingsqaqc,tmpl,stir_obj)

        html = html + template.render(templatepath + 'export.html', {})
        html = html + template.render(templatepath + '04uberoutput_end.html', {'sub_title': ''})
        html = html + template.render(templatepath + '06uberfooter.html', {'links': ''})
        self.response.out.write(html)
Exemplo n.º 2
0
    def post(self):
        form = cgi.FieldStorage() 
        chemical_name = form.getvalue('chemical_name')
        application_rate = form.getvalue('application_rate')
        column_height = form.getvalue('column_height')
        spray_drift_fraction = form.getvalue('spray_drift_fraction')
        direct_spray_duration = form.getvalue('direct_spray_duration')
        molecular_weight = form.getvalue('molecular_weight')
        vapor_pressure = form.getvalue('vapor_pressure')
        avian_oral_ld50 = form.getvalue('avian_oral_ld50')
        body_weight_assessed_bird = form.getvalue('body_weight_assessed_bird')
        body_weight_tested_bird = form.getvalue('body_weight_tested_bird')
        mineau_scaling_factor = form.getvalue('mineau_scaling_factor')
        mammal_inhalation_lc50 = form.getvalue('mammal_inhalation_lc50')
        duration_mammal_inhalation_study = form.getvalue('duration_mammal_inhalation_study')
        body_weight_assessed_mammal = form.getvalue('body_weight_assessed_mammal')
        body_weight_tested_mammal = form.getvalue('body_weight_tested_mammal')
        mammal_oral_ld50 = form.getvalue('mammal_oral_ld50')
        
        text_file = open('stir/stir_description.txt','r')
        x = text_file.read()
        templatepath = os.path.dirname(__file__) + '/../templates/'
        ChkCookie = self.request.cookies.get("ubercookie")
        html = uber_lib.SkinChk(ChkCookie, "STIR Output")
        html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'stir','page':'output'})
        html = html + template.render (templatepath + '03ubertext_links_left.html', {})                
        html = html + template.render(templatepath + '04uberoutput_start.html', {
                'model':'stir', 
                'model_attributes':'STIR Output'})   
              
        pvuheadings = stir_tables.getheaderpvu()
        pvrheadings = stir_tables.getheaderpvr()
        djtemplate = stir_tables.getdjtemplate()
        tmpl = Template(djtemplate)
        
        #instantiate stir model object
        sm = stir_model.StirModel(True,True,chemical_name,application_rate,column_height,spray_drift_fraction,direct_spray_duration, 
            molecular_weight,vapor_pressure,avian_oral_ld50, body_weight_assessed_bird, body_weight_tested_bird, mineau_scaling_factor, 
            mammal_inhalation_lc50,duration_mammal_inhalation_study,body_weight_assessed_mammal, body_weight_tested_mammal, 
            mammal_oral_ld50)

        html = html + stir_tables.timestamp()
        html = html + stir_tables.table_1(pvuheadings,tmpl,sm)
        html = html + stir_tables.table_2(pvuheadings,tmpl,sm)
        html = html + stir_tables.table_3(pvuheadings,tmpl,sm)['html']
        html = html + stir_tables.table_4(pvuheadings,tmpl,sm)['html']
        html = html + stir_tables.table_5(pvrheadings,tmpl,sm)['html']
        
        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)