Update app.py
Browse files
app.py
CHANGED
|
@@ -147,23 +147,28 @@ def getprjpartsfromTestAPI(jsdata):
|
|
| 147 |
@app.route('/getprojectsections/<jsdata>', methods=['GET'])
|
| 148 |
def getprjSectionsfromTestAPI(jsdata):
|
| 149 |
data = json.loads(jsdata)
|
|
|
|
| 150 |
if data[0] == 'testing':
|
| 151 |
sections = API.getprjSections()
|
|
|
|
|
|
|
| 152 |
else:
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
global cached_tables
|
| 156 |
df = pd.DataFrame({
|
| 157 |
"ProjectSection": sections,
|
| 158 |
-
"ProjectId": [
|
| 159 |
-
"ProjectPartId": [
|
| 160 |
})
|
| 161 |
cached_tables["sections"] = df
|
| 162 |
|
| 163 |
return jsonify(sections)
|
| 164 |
|
| 165 |
|
| 166 |
-
|
| 167 |
@app.route('/getmethod/<jsdata>', methods=['GET'])
|
| 168 |
def get_javascript_data(jsdata):
|
| 169 |
progress_updates = [] # Shared list to store progress
|
|
@@ -202,6 +207,12 @@ def TableDetection():
|
|
| 202 |
def TestingMeasurement():
|
| 203 |
return render_template('TestingMeasurement.html')
|
| 204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
@app.route('/legends',methods=["GET", "POST"])
|
| 206 |
def legendDirectory():
|
| 207 |
return render_template('legendDirectory.html')
|
|
|
|
| 147 |
@app.route('/getprojectsections/<jsdata>', methods=['GET'])
|
| 148 |
def getprjSectionsfromTestAPI(jsdata):
|
| 149 |
data = json.loads(jsdata)
|
| 150 |
+
|
| 151 |
if data[0] == 'testing':
|
| 152 |
sections = API.getprjSections()
|
| 153 |
+
project_id = data[0]
|
| 154 |
+
project_part_id = None # No second parameter in this case
|
| 155 |
else:
|
| 156 |
+
# Expecting 2 values
|
| 157 |
+
project_id = data[0]
|
| 158 |
+
project_part_id = data[1] if len(data) > 1 else None
|
| 159 |
+
sections = API.getprjSections(project_id, project_part_id)
|
| 160 |
|
| 161 |
global cached_tables
|
| 162 |
df = pd.DataFrame({
|
| 163 |
"ProjectSection": sections,
|
| 164 |
+
"ProjectId": [project_id] * len(sections),
|
| 165 |
+
"ProjectPartId": [project_part_id] * len(sections)
|
| 166 |
})
|
| 167 |
cached_tables["sections"] = df
|
| 168 |
|
| 169 |
return jsonify(sections)
|
| 170 |
|
| 171 |
|
|
|
|
| 172 |
@app.route('/getmethod/<jsdata>', methods=['GET'])
|
| 173 |
def get_javascript_data(jsdata):
|
| 174 |
progress_updates = [] # Shared list to store progress
|
|
|
|
| 207 |
def TestingMeasurement():
|
| 208 |
return render_template('TestingMeasurement.html')
|
| 209 |
|
| 210 |
+
|
| 211 |
+
@app.route('/FindInitialMarkups',methods=["GET", "POST"])
|
| 212 |
+
def FindInitialMarkups():
|
| 213 |
+
return render_template('FindInitialMarkups.html')
|
| 214 |
+
|
| 215 |
+
|
| 216 |
@app.route('/legends',methods=["GET", "POST"])
|
| 217 |
def legendDirectory():
|
| 218 |
return render_template('legendDirectory.html')
|