Skip to content

Commit ee56ebf

Browse files
authored
Merge pull request #205 from Geode-solutions/geode-objects-redesign
Geode objects redesign
2 parents 63a9f11 + c0b3880 commit ee56ebf

File tree

70 files changed

+3297
-1609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3297
-1609
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"--config-file=mypy.ini"
99
],
1010
"mypy-type-checker.interpreter": [
11-
"${workspaceFolder}/venv/bin/python"
11+
"${workspaceFolder}/../../.venv/bin/python"
1212
]
1313
}

opengeodeweb_back_schemas.json

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
],
214214
"type": "object",
215215
"properties": {
216-
"input_geode_object": {
216+
"geode_object_type": {
217217
"type": "string",
218218
"minLength": 1
219219
},
@@ -223,7 +223,7 @@
223223
}
224224
},
225225
"required": [
226-
"input_geode_object",
226+
"geode_object_type",
227227
"filename"
228228
],
229229
"additionalProperties": false
@@ -283,7 +283,7 @@
283283
],
284284
"type": "object",
285285
"properties": {
286-
"input_geode_object": {
286+
"geode_object_type": {
287287
"type": "string",
288288
"minLength": 1
289289
},
@@ -293,7 +293,7 @@
293293
}
294294
},
295295
"required": [
296-
"input_geode_object",
296+
"geode_object_type",
297297
"filename"
298298
],
299299
"additionalProperties": false
@@ -321,14 +321,14 @@
321321
"type": "string",
322322
"minLength": 1
323323
},
324-
"input_geode_object": {
324+
"geode_object_type": {
325325
"type": "string",
326326
"minLength": 1
327327
}
328328
},
329329
"required": [
330330
"filename",
331-
"input_geode_object"
331+
"geode_object_type"
332332
],
333333
"additionalProperties": false
334334
},
@@ -351,13 +351,13 @@
351351
],
352352
"type": "object",
353353
"properties": {
354-
"input_geode_object": {
354+
"geode_object_type": {
355355
"type": "string",
356356
"minLength": 1
357357
}
358358
},
359359
"required": [
360-
"input_geode_object"
360+
"geode_object_type"
361361
],
362362
"additionalProperties": false
363363
},
@@ -369,7 +369,7 @@
369369
],
370370
"type": "object",
371371
"properties": {
372-
"input_geode_object": {
372+
"geode_object_type": {
373373
"type": "string",
374374
"minLength": 1
375375
},
@@ -379,7 +379,7 @@
379379
}
380380
},
381381
"required": [
382-
"input_geode_object",
382+
"geode_object_type",
383383
"filename"
384384
],
385385
"additionalProperties": false
@@ -406,6 +406,24 @@
406406
],
407407
"additionalProperties": false
408408
},
409+
"cell_attribute_names": {
410+
"$id": "opengeodeweb_back/cell_attribute_names",
411+
"route": "/cell_attribute_names",
412+
"methods": [
413+
"POST"
414+
],
415+
"type": "object",
416+
"properties": {
417+
"id": {
418+
"type": "string",
419+
"minLength": 1
420+
}
421+
},
422+
"required": [
423+
"id"
424+
],
425+
"additionalProperties": false
426+
},
409427
"allowed_objects": {
410428
"$id": "opengeodeweb_back/allowed_objects",
411429
"route": "/allowed_objects",
@@ -417,17 +435,10 @@
417435
"filename": {
418436
"type": "string",
419437
"minLength": 1
420-
},
421-
"supported_feature": {
422-
"type": [
423-
"string",
424-
"null"
425-
]
426438
}
427439
},
428440
"required": [
429-
"filename",
430-
"supported_feature"
441+
"filename"
431442
],
432443
"additionalProperties": false
433444
},
@@ -438,17 +449,8 @@
438449
"POST"
439450
],
440451
"type": "object",
441-
"properties": {
442-
"supported_feature": {
443-
"type": [
444-
"string",
445-
"null"
446-
]
447-
}
448-
},
449-
"required": [
450-
"supported_feature"
451-
],
452+
"properties": {},
453+
"required": [],
452454
"additionalProperties": false
453455
}
454456
}

requirements.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
opengeode-core==15.30.2
1+
opengeode-core==15.30.4
22
opengeode-io==7.4.6
33
opengeode-inspector==6.8.6
4-
opengeode-geosciences==9.5.4
4+
opengeode-geosciences==9.5.5
55
opengeode-geosciencesio==5.8.6
66
geode-common==33.11.3
77
geode-viewables==3.3.2

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ markupsafe>=3
3131
# flask
3232
# jinja2
3333
# werkzeug
34-
opengeode-core==15.30.2
34+
opengeode-core==15.30.4
3535
# via
3636
# -r requirements.in
3737
# geode-common
@@ -40,7 +40,7 @@ opengeode-core==15.30.2
4040
# opengeode-geosciencesio
4141
# opengeode-inspector
4242
# opengeode-io
43-
opengeode-geosciences==9.5.4
43+
opengeode-geosciences==9.5.5
4444
# via
4545
# -r requirements.in
4646
# geode-viewables
@@ -60,4 +60,3 @@ werkzeug==3.1.2
6060
# flask
6161
# flask-cors
6262

63-
opengeodeweb-microservice==1.*,>=1.0.9

src/opengeodeweb_back/app.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import argparse
44
import os
5-
import time
65
from typing import Any
76
import flask
87
import flask_cors # type: ignore
@@ -36,8 +35,13 @@
3635

3736

3837
@app.before_request
39-
def before_request() -> None:
38+
def before_request() -> flask.Response | None:
39+
if flask.request.method == "OPTIONS":
40+
response = flask.make_response()
41+
response.headers["Access-Control-Allow-Methods"] = "GET,POST,PUT,DELETE,OPTIONS"
42+
return response
4043
utils_functions.before_request(flask.current_app)
44+
return None
4145

4246

4347
@app.teardown_request
@@ -68,13 +72,14 @@ def teardown_request(exception: BaseException | None) -> None:
6872

6973

7074
@app.errorhandler(HTTPException)
71-
def errorhandler(e: HTTPException) -> tuple[dict[str, Any], int] | Response:
72-
return utils_functions.handle_exception(e)
75+
def errorhandler(exception: HTTPException) -> tuple[dict[str, Any], int] | Response:
76+
return utils_functions.handle_exception(exception)
7377

7478

7579
@app.errorhandler(Exception)
76-
def handle_generic_exception(e: Exception) -> Response:
77-
return flask.make_response({"error": str(e)}, 500)
80+
def handle_generic_exception(exception: Exception) -> Response:
81+
print("\033[91mError:\033[0m \033[91m" + str(exception) + "\033[0m", flush=True)
82+
return flask.make_response({"description": str(exception)}, 500)
7883

7984

8085
@app.route(

0 commit comments

Comments
 (0)