Browse Source

mocked data and improved gitignore

Alessia 2 years ago
parent
commit
51c8e576cc

+ 1 - 1
.gitignore

@@ -2,4 +2,4 @@
 TIgrO
 */.DS_Store
 .vscode/*
-flask_be/.vscode/*
+flask_be/engine/__pycache__/*

+ 0 - 24
.vscode/launch.json

@@ -1,24 +0,0 @@
-{
-    // Use IntelliSense to learn about possible attributes.
-    // Hover to view descriptions of existing attributes.
-    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
-    "version": "0.2.0",
-    "configurations": [
-        {
-            "name": "Python: Flask",
-            "type": "python",
-            "request": "launch",
-            "module": "flask",
-            "env": {
-                "FLASK_APP": "flask_be/app.py",
-                "FLASK_DEBUG": "1"
-            },
-            "args": [
-                "run"
-            ],
-            "jinja": true,
-            "justMyCode": true,
-            "python": "/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/TIgrO/bin/python3"
-        }
-    ]
-}

+ 3 - 2
flask_be/app.py

@@ -25,11 +25,12 @@ def simpleQuery():
 
         # Il motore: classe funzionale, che sta nel pacchetto 'engine'
         #output = doSimpleQuery(data, tipo, espansa, raddoppiata, formeLemmi, appath)
-        output = json.load('engine/mock_data/result_example_1.json')
+        with open(appath + '/engine/mock_data/result_example_1.json', 'r') as mock_file:
+            output = json.load(mock_file)
 
         return output, 200
 
-    except:
+    except Exception as err:
         emptyOut = {}
         return emptyOut, 500
 # fino a qui

BIN
flask_be/engine/__pycache__/__init__.cpython-310.pyc


BIN
flask_be/engine/__pycache__/__init__.cpython-39.pyc


BIN
flask_be/engine/__pycache__/query_generator.cpython-310.pyc


BIN
flask_be/engine/__pycache__/query_generator.cpython-39.pyc


BIN
flask_be/engine/__pycache__/simple_query.cpython-310.pyc


BIN
flask_be/engine/__pycache__/simple_query_test.cpython-39.pyc


BIN
flask_be/engine/__pycache__/simple_query_test_pandas.cpython-310.pyc


BIN
flask_be/engine/__pycache__/simple_query_test_pandas.cpython-39.pyc


BIN
flask_be/engine/__pycache__/test_occorrenzario_pandas.cpython-310.pyc


BIN
flask_be/engine/__pycache__/test_occorrenzario_pandas.cpython-39.pyc