예제 #1
0
 def get(self):
     text_file1 = open('przm5/przm5_algorithm.txt', 'r')
     x = text_file1.read()
     templatepath = os.path.dirname(__file__) + '/../templates/'
     ChkCookie = self.request.cookies.get("ubercookie")
     html = uber_lib.SkinChk(ChkCookie, "PRZM 5 Algorithms")
     html = html + template.render(
         templatepath + '02uberintroblock_wmodellinks.html', {
             'model': 'przm5',
             'page': 'algorithm'
         })
     html = html + template.render(
         templatepath + '03ubertext_links_left.html', {})
     html = html + template.render(
         templatepath + '04ubertext_start.html', {
             'model': 'przm5',
             'model_attributes': 'PRZM 5 Algorithms',
             'text_paragraph': x
         })
     html = html + template.render(templatepath + '04ubertext_end.html', {})
     html = html + template.render(
         templatepath + '05ubertext_links_right.html', {})
     html = html + template.render(templatepath + '06uberfooter.html',
                                   {'links': ''})
     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)
예제 #3
0
 def post(self):
     data_all = json.load(sys.stdin)
     data_html = data_all["data_html"]
     jid = str(data_all["jid"])
     logger.info(data_all)
     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':'przm5','page':'output'})
     html = html + template.render (templatepath + '03ubertext_links_left.html', {})                               
     html = html + template.render(templatepath + '04uberoutput_start.html', {})
     html = html + data_html
     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.update_html(html, jid, 'przm5')
     self.response.out.write(html)
예제 #4
0
 def get(self):
     templatepath = os.path.dirname(__file__) + '/../templates/'
     ChkCookie = self.request.cookies.get("ubercookie")
     html = uber_lib.SkinChk(ChkCookie, "PRZM 5 Batch")
     html = html + template.render(
         templatepath + '02uberintroblock_wmodellinks.html', {
             'model': 'przm5',
             'page': 'batchinput'
         })
     html = html + template.render(
         templatepath + '03ubertext_links_left.html', {})
     html = html + template.render(
         templatepath + '04uberbatchinput.html', {
             'model': 'przm5',
             'model_attributes': 'Surface Water Calculator Batch Input'
         })
     html = html + template.render(
         templatepath + '04uberbatchinput_jquery.html', {})
     html = html + template.render(
         templatepath + '05ubertext_links_right.html', {})
     html = html + template.render(templatepath + '06uberfooter.html',
                                   {'links': ''})
     self.response.out.write(html)
예제 #5
0
 def get(self):
     templatepath = os.path.dirname(__file__) + '/../templates/'
     ChkCookie = self.request.cookies.get("ubercookie")
     html = uber_lib.SkinChk(ChkCookie, "PRZM 5 User history")
     html = html + template.render(
         templatepath + '02uberintroblock_wmodellinks.html', {
             'model': 'przm5',
             'page': 'history'
         })
     html = html + template.render(
         templatepath + '03ubertext_links_left.html', {})
     html = html + template.render(
         templatepath + '04uberalgorithm_start.html', {
             'model': 'przm5',
             'model_attributes': 'PRZM5 User History'
         })
     html = html + template.render(templatepath + 'history_pagination.html',
                                   {})
     hist_obj = rest_funcs.user_hist('admin', 'przm5')
     html = html + history_tables.table_all(hist_obj)
     html = html + template.render(templatepath + '04ubertext_end.html', {})
     html = html + template.render(templatepath + '06uberfooter.html',
                                   {'links': ''})
     self.response.out.write(html)