File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -155,3 +155,38 @@ def remotes():
155
155
print (f"Query for remotes: { str (t2 - t1 )} " )
156
156
157
157
return rows
158
+
159
+
160
+ @app .route ('/stability' )
161
+ def stability ():
162
+ # auto = query only tests which NIPA ignores based on stability
163
+ auto = request .args .get ('auto' )
164
+
165
+ where = ""
166
+ if auto == "y" or auto == '1' or auto == 't' :
167
+ where = "WHERE autoignore = true" ;
168
+ elif auto == "n" or auto == '0' or auto == 'f' :
169
+ where = "WHERE autoignore = false" ;
170
+
171
+ with psql .cursor () as cur :
172
+ cur .execute (f"SELECT * FROM stability { where } " )
173
+
174
+ columns = [desc [0 ] for desc in cur .description ]
175
+ rows = cur .fetchall ()
176
+ # Convert each row to a dictionary with column names as keys
177
+ data = [{columns [i ]: value for i , value in enumerate (row )} for row in rows ]
178
+
179
+ return data
180
+
181
+
182
+ @app .route ('/device-info' )
183
+ def dev_info ():
184
+ with psql .cursor () as cur :
185
+ cur .execute (f"SELECT * FROM devices_info" )
186
+
187
+ columns = [desc [0 ] for desc in cur .description ]
188
+ rows = cur .fetchall ()
189
+ # Convert each row to a dictionary with column names as keys
190
+ data = [{columns [i ]: value for i , value in enumerate (row )} for row in rows ]
191
+
192
+ return data
You can’t perform that action at this time.
0 commit comments