/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pyserver/pcilib_html_server.py

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-04 18:30:43 UTC
  • mfrom: (346.1.39 pcitool)
  • Revision ID: csa@suren.me-20160304183043-mjf6xvyermjh5olg
Integrate last part of Python code from Vasiliy Chernov

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from multiprocessing import Process
5
5
 
6
6
import requests
7
 
from api_server import ApiServer
 
7
from pcilib_api_server import ApiServer
8
8
 
9
9
#import flask elements
10
10
from flask import render_template
160
160
   return render_template('property_info.html',
161
161
                          value = value,
162
162
                          branch = branch,
163
 
                          properties = prop_info,
164
 
                          json = json
 
163
                          properties = prop_info
 
164
                         )
 
165
                         
 
166
@app.route("/scripts_info")
 
167
def get_scripts_list():
 
168
   #get properties info
 
169
   prop_info = 0  
 
170
   try:
 
171
      r = requests.get(url_for('process_json_command', 
 
172
                               command = 'get_scripts_list', 
 
173
                               _external = True))
 
174
                               
 
175
      if(r.json().get('status') == 'error'):
 
176
         return 'Error: ' + r.json()['description']
 
177
         
 
178
      scripts_info = r.json()['scripts']
 
179
      
 
180
   except Exception as e:
 
181
      return str(e)
 
182
 
 
183
   return render_template('scripts_info.html',
 
184
                          scripts = scripts_info
165
185
                         )
166
186
                         
167
187
@app.route("/")