OpenGeodeWeb-Back 6.3.2rc1__tar.gz → 6.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {opengeodeweb_back-6.3.2rc1/src/OpenGeodeWeb_Back.egg-info → opengeodeweb_back-6.3.3}/PKG-INFO +2 -2
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/pyproject.toml +1 -1
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/requirements.txt +1 -1
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3/src/OpenGeodeWeb_Back.egg-info}/PKG-INFO +2 -2
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/OpenGeodeWeb_Back.egg-info/SOURCES.txt +0 -5
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/OpenGeodeWeb_Back.egg-info/requires.txt +1 -1
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/app.py +0 -6
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/blueprint_routes.py +0 -8
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/utils_functions.py +68 -4
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/tests/test_routes.py +172 -0
- opengeodeweb_back-6.3.2rc1/src/opengeodeweb_back/routes/models/blueprint_models.py +0 -83
- opengeodeweb_back-6.3.2rc1/src/opengeodeweb_back/routes/models/schemas/__init__.py +0 -1
- opengeodeweb_back-6.3.2rc1/src/opengeodeweb_back/routes/models/schemas/model_components.json +0 -17
- opengeodeweb_back-6.3.2rc1/src/opengeodeweb_back/routes/models/schemas/model_components.py +0 -10
- opengeodeweb_back-6.3.2rc1/tests/test_models_routes.py +0 -276
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/LICENSE +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/README.md +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/setup.cfg +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/OpenGeodeWeb_Back.egg-info/dependency_links.txt +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/OpenGeodeWeb_Back.egg-info/entry_points.txt +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/OpenGeodeWeb_Back.egg-info/top_level.txt +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/__init__.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/app_config.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_functions.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/__init__.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_brep.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_cross_section.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_edged_curve2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_edged_curve3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_graph.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_grid2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_grid3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_hybrid_solid3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_implicit_cross_section.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_implicit_structural_model.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_light_regular_grid2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_light_regular_grid3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_mesh.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_model.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_object.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_point_set2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_point_set3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_polygonal_surface2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_polygonal_surface3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_polyhedral_solid3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_raster_image2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_raster_image3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_regular_grid2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_regular_grid3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_section.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_solid_mesh3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_structural_model.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_surface_mesh2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_surface_mesh3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_tetrahedral_solid3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_triangulated_surface2d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_triangulated_surface3d.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_objects/geode_vertex_set.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/py.typed +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/create/blueprint_create.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/create/schemas/__init__.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/create/schemas/point.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/create/schemas/point.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/__init__.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/allowed_files.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/allowed_files.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/allowed_objects.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/allowed_objects.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/cell_attribute_names.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/edge_attribute_names.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/export_project.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/export_project.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/geographic_coordinate_systems.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/geographic_coordinate_systems.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/import_extension.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/import_extension.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/import_project.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/import_project.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/inspect_file.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/inspect_file.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/kill.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/kill.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/missing_files.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/missing_files.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/ping.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/ping.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/save_viewable_file.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/save_viewable_file.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/texture_coordinates.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/texture_coordinates.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/upload_file.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/upload_file.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/test_utils.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/tests/test_create_routes.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/tests/test_geode_functions.py +0 -0
- {opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/tests/test_utils_functions.py +0 -0
{opengeodeweb_back-6.3.2rc1/src/OpenGeodeWeb_Back.egg-info → opengeodeweb_back-6.3.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: OpenGeodeWeb-Back
|
|
3
|
-
Version: 6.3.
|
|
3
|
+
Version: 6.3.3
|
|
4
4
|
Summary: OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem
|
|
5
5
|
Author-email: Geode-solutions <team-web@geode-solutions.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/Geode-solutions/OpenGeodeWeb-Back
|
|
@@ -27,7 +27,7 @@ Requires-Dist: opengeode-geosciencesio==5.8.11
|
|
|
27
27
|
Requires-Dist: opengeode-inspector==6.8.18
|
|
28
28
|
Requires-Dist: opengeode-io==7.4.9
|
|
29
29
|
Requires-Dist: werkzeug==3.1.2
|
|
30
|
-
Requires-Dist: opengeodeweb-microservice==1.*,>=1.0.
|
|
30
|
+
Requires-Dist: opengeodeweb-microservice==1.*,>=1.0.16
|
|
31
31
|
Dynamic: license-file
|
|
32
32
|
|
|
33
33
|
<h1 align="center">OpenGeodeWeb-Back<sup><i>by Geode-solutions</i></sup></h1>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "OpenGeodeWeb-Back"
|
|
7
|
-
version = "6.3.
|
|
7
|
+
version = "6.3.3"
|
|
8
8
|
dynamic = ["dependencies"]
|
|
9
9
|
authors = [{ name = "Geode-solutions", email = "team-web@geode-solutions.com" }]
|
|
10
10
|
description = "OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem"
|
{opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3/src/OpenGeodeWeb_Back.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: OpenGeodeWeb-Back
|
|
3
|
-
Version: 6.3.
|
|
3
|
+
Version: 6.3.3
|
|
4
4
|
Summary: OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem
|
|
5
5
|
Author-email: Geode-solutions <team-web@geode-solutions.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/Geode-solutions/OpenGeodeWeb-Back
|
|
@@ -27,7 +27,7 @@ Requires-Dist: opengeode-geosciencesio==5.8.11
|
|
|
27
27
|
Requires-Dist: opengeode-inspector==6.8.18
|
|
28
28
|
Requires-Dist: opengeode-io==7.4.9
|
|
29
29
|
Requires-Dist: werkzeug==3.1.2
|
|
30
|
-
Requires-Dist: opengeodeweb-microservice==1.*,>=1.0.
|
|
30
|
+
Requires-Dist: opengeodeweb-microservice==1.*,>=1.0.16
|
|
31
31
|
Dynamic: license-file
|
|
32
32
|
|
|
33
33
|
<h1 align="center">OpenGeodeWeb-Back<sup><i>by Geode-solutions</i></sup></h1>
|
{opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/OpenGeodeWeb_Back.egg-info/SOURCES.txt
RENAMED
|
@@ -54,10 +54,6 @@ src/opengeodeweb_back/routes/create/blueprint_create.py
|
|
|
54
54
|
src/opengeodeweb_back/routes/create/schemas/__init__.py
|
|
55
55
|
src/opengeodeweb_back/routes/create/schemas/point.json
|
|
56
56
|
src/opengeodeweb_back/routes/create/schemas/point.py
|
|
57
|
-
src/opengeodeweb_back/routes/models/blueprint_models.py
|
|
58
|
-
src/opengeodeweb_back/routes/models/schemas/__init__.py
|
|
59
|
-
src/opengeodeweb_back/routes/models/schemas/model_components.json
|
|
60
|
-
src/opengeodeweb_back/routes/models/schemas/model_components.py
|
|
61
57
|
src/opengeodeweb_back/routes/schemas/__init__.py
|
|
62
58
|
src/opengeodeweb_back/routes/schemas/allowed_files.json
|
|
63
59
|
src/opengeodeweb_back/routes/schemas/allowed_files.py
|
|
@@ -101,6 +97,5 @@ src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json
|
|
|
101
97
|
src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py
|
|
102
98
|
tests/test_create_routes.py
|
|
103
99
|
tests/test_geode_functions.py
|
|
104
|
-
tests/test_models_routes.py
|
|
105
100
|
tests/test_routes.py
|
|
106
101
|
tests/test_utils_functions.py
|
|
@@ -10,7 +10,6 @@ from flask_cors import cross_origin
|
|
|
10
10
|
from werkzeug.exceptions import HTTPException
|
|
11
11
|
from opengeodeweb_back import utils_functions, app_config
|
|
12
12
|
from opengeodeweb_back.routes import blueprint_routes
|
|
13
|
-
from opengeodeweb_back.routes.models import blueprint_models
|
|
14
13
|
from opengeodeweb_back.routes.create import blueprint_create
|
|
15
14
|
from opengeodeweb_microservice.database import connection
|
|
16
15
|
|
|
@@ -85,11 +84,6 @@ def register_ogw_back_blueprints(app: flask.Flask) -> None:
|
|
|
85
84
|
url_prefix="/opengeodeweb_back",
|
|
86
85
|
name="opengeodeweb_back",
|
|
87
86
|
)
|
|
88
|
-
app.register_blueprint(
|
|
89
|
-
blueprint_models.routes,
|
|
90
|
-
url_prefix="/opengeodeweb_back/models",
|
|
91
|
-
name="opengeodeweb_models",
|
|
92
|
-
)
|
|
93
87
|
app.register_blueprint(
|
|
94
88
|
blueprint_create.routes,
|
|
95
89
|
url_prefix="/opengeodeweb_back/create",
|
|
@@ -22,7 +22,6 @@ from opengeodeweb_microservice.database.data_types import geode_object_type
|
|
|
22
22
|
# Local application imports
|
|
23
23
|
from opengeodeweb_back import geode_functions, utils_functions
|
|
24
24
|
from opengeodeweb_back.routes import schemas
|
|
25
|
-
from opengeodeweb_back.routes.models import blueprint_models
|
|
26
25
|
from opengeodeweb_back.geode_objects import geode_objects
|
|
27
26
|
from opengeodeweb_back.geode_objects.geode_mesh import GeodeMesh
|
|
28
27
|
from opengeodeweb_back.geode_objects.geode_graph import GeodeGraph
|
|
@@ -34,13 +33,6 @@ from opengeodeweb_back.geode_objects.geode_solid_mesh3d import GeodeSolidMesh3D
|
|
|
34
33
|
|
|
35
34
|
routes = flask.Blueprint("routes", __name__, url_prefix="/opengeodeweb_back")
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
routes.register_blueprint(
|
|
39
|
-
blueprint_models.routes,
|
|
40
|
-
url_prefix=blueprint_models.routes.url_prefix,
|
|
41
|
-
name=blueprint_models.routes.name,
|
|
42
|
-
)
|
|
43
|
-
|
|
44
36
|
schemas_dict = get_schemas_dict(os.path.join(os.path.dirname(__file__), "schemas"))
|
|
45
37
|
|
|
46
38
|
|
{opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/utils_functions.py
RENAMED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import os
|
|
3
3
|
import threading
|
|
4
4
|
import time
|
|
5
|
+
import xml.etree.ElementTree as ET
|
|
5
6
|
import zipfile
|
|
6
7
|
from collections.abc import Callable
|
|
7
8
|
from concurrent.futures import ThreadPoolExecutor
|
|
@@ -22,6 +23,7 @@ from opengeodeweb_microservice.database.data_types import GeodeObjectType
|
|
|
22
23
|
# Local application imports
|
|
23
24
|
from . import geode_functions
|
|
24
25
|
from .geode_objects import geode_objects
|
|
26
|
+
from .geode_objects.geode_model import GeodeModel
|
|
25
27
|
from .geode_objects.geode_object import GeodeObject
|
|
26
28
|
|
|
27
29
|
|
|
@@ -191,11 +193,69 @@ def create_data_folder_from_id(data_id: str) -> str:
|
|
|
191
193
|
return data_path
|
|
192
194
|
|
|
193
195
|
|
|
196
|
+
def model_components(
|
|
197
|
+
data_id: str, model: GeodeModel, viewable_file: str
|
|
198
|
+
) -> dict[str, Any]:
|
|
199
|
+
vtm_file_path = geode_functions.data_file_path(data_id, viewable_file)
|
|
200
|
+
tree = ET.parse(vtm_file_path)
|
|
201
|
+
root = tree.find("vtkMultiBlockDataSet")
|
|
202
|
+
if root is None:
|
|
203
|
+
flask.abort(500, "Failed to read viewable file")
|
|
204
|
+
uuid_to_flat_index = {}
|
|
205
|
+
current_index = 0
|
|
206
|
+
assert root is not None
|
|
207
|
+
for elem in root.iter():
|
|
208
|
+
if "uuid" in elem.attrib and elem.tag == "DataSet":
|
|
209
|
+
uuid_to_flat_index[elem.attrib["uuid"]] = current_index
|
|
210
|
+
current_index += 1
|
|
211
|
+
model_mesh_components = model.mesh_components()
|
|
212
|
+
mesh_components = []
|
|
213
|
+
for mesh_component, ids in model_mesh_components.items():
|
|
214
|
+
component_type = mesh_component.get()
|
|
215
|
+
for id in ids:
|
|
216
|
+
geode_id = id.string()
|
|
217
|
+
component_name = geode_id
|
|
218
|
+
viewer_id = uuid_to_flat_index[geode_id]
|
|
219
|
+
boundaries = model.boundaries(id)
|
|
220
|
+
boundaries_uuid = [boundary.id().string() for boundary in boundaries]
|
|
221
|
+
internals = model.internals(id)
|
|
222
|
+
internals_uuid = [internal.id().string() for internal in internals]
|
|
223
|
+
mesh_component_object = {
|
|
224
|
+
"viewer_id": viewer_id,
|
|
225
|
+
"geode_id": geode_id,
|
|
226
|
+
"name": component_name,
|
|
227
|
+
"type": component_type,
|
|
228
|
+
"boundaries": boundaries_uuid,
|
|
229
|
+
"internals": internals_uuid,
|
|
230
|
+
}
|
|
231
|
+
mesh_components.append(mesh_component_object)
|
|
232
|
+
|
|
233
|
+
model_collection_components = model.collection_components()
|
|
234
|
+
collection_components = []
|
|
235
|
+
for collection_component, ids in model_collection_components.items():
|
|
236
|
+
component_type = collection_component.get()
|
|
237
|
+
for id in ids:
|
|
238
|
+
geode_id = id.string()
|
|
239
|
+
items = model.items(id)
|
|
240
|
+
items_uuid = [item.id().string() for item in items]
|
|
241
|
+
collection_component_object = {
|
|
242
|
+
"geode_id": geode_id,
|
|
243
|
+
"name": geode_id,
|
|
244
|
+
"type": component_type,
|
|
245
|
+
"items": items_uuid,
|
|
246
|
+
}
|
|
247
|
+
collection_components.append(collection_component_object)
|
|
248
|
+
return {
|
|
249
|
+
"mesh_components": mesh_components,
|
|
250
|
+
"collection_components": collection_components,
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
|
|
194
254
|
def save_all_viewables_and_return_info(
|
|
195
255
|
geode_object: GeodeObject,
|
|
196
256
|
data: Data,
|
|
197
257
|
data_path: str,
|
|
198
|
-
) -> dict[str,
|
|
258
|
+
) -> dict[str, Any]:
|
|
199
259
|
with ThreadPoolExecutor() as executor:
|
|
200
260
|
native_files, viewable_path, light_path = executor.map(
|
|
201
261
|
lambda args: args[0](args[1]),
|
|
@@ -225,7 +285,8 @@ def save_all_viewables_and_return_info(
|
|
|
225
285
|
name = geode_object.identifier.name()
|
|
226
286
|
if not name:
|
|
227
287
|
flask.abort(400, "Geode object has no name defined.")
|
|
228
|
-
|
|
288
|
+
|
|
289
|
+
response: dict[str, Any] = {
|
|
229
290
|
"native_file": data.native_file,
|
|
230
291
|
"viewable_file": data.viewable_file,
|
|
231
292
|
"id": data.id,
|
|
@@ -234,11 +295,14 @@ def save_all_viewables_and_return_info(
|
|
|
234
295
|
"binary_light_viewable": binary_light_viewable.decode("utf-8"),
|
|
235
296
|
"geode_object_type": data.geode_object,
|
|
236
297
|
}
|
|
298
|
+
if isinstance(geode_object, GeodeModel):
|
|
299
|
+
response |= model_components(data.id, geode_object, data.viewable_file)
|
|
300
|
+
return response
|
|
237
301
|
|
|
238
302
|
|
|
239
303
|
def generate_native_viewable_and_light_viewable_from_object(
|
|
240
304
|
geode_object: GeodeObject,
|
|
241
|
-
) -> dict[str,
|
|
305
|
+
) -> dict[str, Any]:
|
|
242
306
|
data = Data.create(
|
|
243
307
|
geode_object=geode_object.geode_object_type(),
|
|
244
308
|
viewer_object=geode_object.viewer_type(),
|
|
@@ -250,7 +314,7 @@ def generate_native_viewable_and_light_viewable_from_object(
|
|
|
250
314
|
|
|
251
315
|
def generate_native_viewable_and_light_viewable_from_file(
|
|
252
316
|
geode_object_type: GeodeObjectType, input_file: str
|
|
253
|
-
) -> dict[str,
|
|
317
|
+
) -> dict[str, Any]:
|
|
254
318
|
generic_geode_object = geode_objects[geode_object_type]
|
|
255
319
|
data = Data.create(
|
|
256
320
|
geode_object=geode_object_type,
|
|
@@ -5,6 +5,9 @@ import os
|
|
|
5
5
|
from werkzeug.datastructures import FileStorage
|
|
6
6
|
from flask.testing import FlaskClient
|
|
7
7
|
from werkzeug.test import TestResponse
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
import json
|
|
10
|
+
import zipfile
|
|
8
11
|
|
|
9
12
|
# Local application imports
|
|
10
13
|
from opengeodeweb_microservice.database.data import Data
|
|
@@ -424,3 +427,172 @@ def test_geode_object_inheritance(client: FlaskClient) -> None:
|
|
|
424
427
|
return {"geode_object_type": "BRep"}
|
|
425
428
|
|
|
426
429
|
test_utils.test_route_wrong_params(client, route, get_full_data)
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
def test_model_components(client: FlaskClient) -> None:
|
|
433
|
+
geode_object_type = "BRep"
|
|
434
|
+
filename = "cube.og_brep"
|
|
435
|
+
response = test_save_viewable_file(client, geode_object_type, filename)
|
|
436
|
+
assert response.status_code == 200
|
|
437
|
+
assert "mesh_components" in response.get_json()
|
|
438
|
+
mesh_components = response.get_json()["mesh_components"]
|
|
439
|
+
assert isinstance(mesh_components, list)
|
|
440
|
+
assert len(mesh_components) > 0
|
|
441
|
+
for mesh_component in mesh_components:
|
|
442
|
+
assert isinstance(mesh_component, object)
|
|
443
|
+
assert isinstance(mesh_component["geode_id"], str)
|
|
444
|
+
assert isinstance(mesh_component["viewer_id"], int)
|
|
445
|
+
assert isinstance(mesh_component["name"], str)
|
|
446
|
+
assert isinstance(mesh_component["type"], str)
|
|
447
|
+
assert isinstance(mesh_component["boundaries"], list)
|
|
448
|
+
for boundary_uuid in mesh_component["boundaries"]:
|
|
449
|
+
assert isinstance(boundary_uuid, str)
|
|
450
|
+
assert isinstance(mesh_component["internals"], list)
|
|
451
|
+
for internal_uuid in mesh_component["internals"]:
|
|
452
|
+
assert isinstance(internal_uuid, str)
|
|
453
|
+
assert "collection_components" in response.get_json()
|
|
454
|
+
collection_components = response.get_json()["collection_components"]
|
|
455
|
+
assert isinstance(collection_components, list)
|
|
456
|
+
for collection_component in collection_components:
|
|
457
|
+
assert isinstance(collection_component, object)
|
|
458
|
+
assert isinstance(collection_component["geode_id"], str)
|
|
459
|
+
assert isinstance(collection_component["name"], str)
|
|
460
|
+
assert isinstance(collection_component["items"], list)
|
|
461
|
+
for item_uuid in collection_component["items"]:
|
|
462
|
+
assert isinstance(item_uuid, str)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
def test_export_project_route(client: FlaskClient, tmp_path: Path) -> None:
|
|
466
|
+
route = "/opengeodeweb_back/export_project"
|
|
467
|
+
snapshot = {
|
|
468
|
+
"styles": {"1": {"visibility": True, "opacity": 1.0, "color": [0.2, 0.6, 0.9]}}
|
|
469
|
+
}
|
|
470
|
+
filename = "export_project_test.vease"
|
|
471
|
+
project_folder = client.application.config["DATA_FOLDER_PATH"]
|
|
472
|
+
os.makedirs(project_folder, exist_ok=True)
|
|
473
|
+
database_root_path = os.path.join(project_folder, "project.db")
|
|
474
|
+
with open(database_root_path, "wb") as f:
|
|
475
|
+
f.write(b"test_project_db")
|
|
476
|
+
|
|
477
|
+
with get_session() as session:
|
|
478
|
+
session.query(Data).delete()
|
|
479
|
+
session.commit()
|
|
480
|
+
|
|
481
|
+
data1 = Data(
|
|
482
|
+
id="test_data_1",
|
|
483
|
+
geode_object="BRep",
|
|
484
|
+
viewer_object="BRep",
|
|
485
|
+
viewer_elements_type="default",
|
|
486
|
+
native_file="native.txt",
|
|
487
|
+
)
|
|
488
|
+
data2 = Data(
|
|
489
|
+
id="test_data_2",
|
|
490
|
+
geode_object="Section",
|
|
491
|
+
viewer_object="Section",
|
|
492
|
+
viewer_elements_type="default",
|
|
493
|
+
native_file="native.txt",
|
|
494
|
+
)
|
|
495
|
+
session.add(data1)
|
|
496
|
+
session.add(data2)
|
|
497
|
+
session.commit()
|
|
498
|
+
|
|
499
|
+
data1_dir = os.path.join(project_folder, "test_data_1")
|
|
500
|
+
os.makedirs(data1_dir, exist_ok=True)
|
|
501
|
+
with open(os.path.join(data1_dir, "native.txt"), "w") as f:
|
|
502
|
+
f.write("native file content")
|
|
503
|
+
|
|
504
|
+
data2_dir = os.path.join(project_folder, "test_data_2")
|
|
505
|
+
os.makedirs(data2_dir, exist_ok=True)
|
|
506
|
+
with open(os.path.join(data2_dir, "native.txt"), "w") as f:
|
|
507
|
+
f.write("native file content")
|
|
508
|
+
|
|
509
|
+
response = client.post(route, json={"snapshot": snapshot, "filename": filename})
|
|
510
|
+
assert response.status_code == 200
|
|
511
|
+
assert response.headers.get("new-file-name") == filename
|
|
512
|
+
assert response.mimetype == "application/octet-binary"
|
|
513
|
+
response.direct_passthrough = False
|
|
514
|
+
zip_bytes = response.get_data()
|
|
515
|
+
tmp_zip_path = tmp_path / filename
|
|
516
|
+
tmp_zip_path.write_bytes(zip_bytes)
|
|
517
|
+
|
|
518
|
+
with zipfile.ZipFile(tmp_zip_path, "r") as zip_file:
|
|
519
|
+
names = zip_file.namelist()
|
|
520
|
+
assert "snapshot.json" in names
|
|
521
|
+
parsed = json.loads(zip_file.read("snapshot.json").decode("utf-8"))
|
|
522
|
+
assert parsed == snapshot
|
|
523
|
+
assert "project.db" in names
|
|
524
|
+
assert "test_data_1/native.txt" in names
|
|
525
|
+
assert "test_data_2/native.txt" in names
|
|
526
|
+
|
|
527
|
+
response.close()
|
|
528
|
+
|
|
529
|
+
export_path = os.path.join(project_folder, filename)
|
|
530
|
+
if os.path.exists(export_path):
|
|
531
|
+
os.remove(export_path)
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
def test_import_project_route(client: FlaskClient, tmp_path: Path) -> None:
|
|
535
|
+
route = "/opengeodeweb_back/import_project"
|
|
536
|
+
snapshot = {
|
|
537
|
+
"styles": {"1": {"visibility": True, "opacity": 1.0, "color": [0.2, 0.6, 0.9]}}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
original_data_folder = client.application.config["DATA_FOLDER_PATH"]
|
|
541
|
+
client.application.config["DATA_FOLDER_PATH"] = os.path.join(
|
|
542
|
+
str(tmp_path), "project_data"
|
|
543
|
+
)
|
|
544
|
+
db_path = os.path.join(client.application.config["DATA_FOLDER_PATH"], "project.db")
|
|
545
|
+
|
|
546
|
+
import sqlite3, zipfile, json
|
|
547
|
+
|
|
548
|
+
temp_db = tmp_path / "temp_project.db"
|
|
549
|
+
conn = sqlite3.connect(str(temp_db))
|
|
550
|
+
conn.execute(
|
|
551
|
+
"CREATE TABLE datas (id TEXT PRIMARY KEY, geode_object TEXT, viewer_object TEXT, viewer_elements_type TEXT, native_file TEXT, "
|
|
552
|
+
"viewable_file TEXT, light_viewable_file TEXT)"
|
|
553
|
+
)
|
|
554
|
+
conn.commit()
|
|
555
|
+
conn.close()
|
|
556
|
+
|
|
557
|
+
z = tmp_path / "import_project_test.vease"
|
|
558
|
+
with zipfile.ZipFile(z, "w", compression=zipfile.ZIP_DEFLATED) as zipf:
|
|
559
|
+
zipf.writestr("snapshot.json", json.dumps(snapshot))
|
|
560
|
+
zipf.write(str(temp_db), "project.db")
|
|
561
|
+
|
|
562
|
+
with open(z, "rb") as f:
|
|
563
|
+
resp = client.post(
|
|
564
|
+
route,
|
|
565
|
+
data={"file": (f, "import_project_test.vease")},
|
|
566
|
+
content_type="multipart/form-data",
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
assert resp.status_code == 200
|
|
570
|
+
assert resp.get_json().get("snapshot") == snapshot
|
|
571
|
+
assert os.path.exists(db_path)
|
|
572
|
+
|
|
573
|
+
from opengeodeweb_microservice.database import connection
|
|
574
|
+
|
|
575
|
+
client.application.config["DATA_FOLDER_PATH"] = original_data_folder
|
|
576
|
+
test_db_path = os.environ.get("TEST_DB_PATH")
|
|
577
|
+
if test_db_path:
|
|
578
|
+
connection.init_database(test_db_path, create_tables=True)
|
|
579
|
+
|
|
580
|
+
client.application.config["DATA_FOLDER_PATH"] = original_data_folder
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
def test_save_viewable_workflow_from_object(client: FlaskClient) -> None:
|
|
584
|
+
route = "/opengeodeweb_back/create/point"
|
|
585
|
+
point_data = {
|
|
586
|
+
"name": "workflow_point_3d",
|
|
587
|
+
"x": 0.0,
|
|
588
|
+
"y": 0.0,
|
|
589
|
+
"z": 0.0,
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
response = client.post(route, json=point_data)
|
|
593
|
+
assert response.status_code == 200
|
|
594
|
+
|
|
595
|
+
data_id = response.get_json()["id"]
|
|
596
|
+
assert isinstance(data_id, str) and len(data_id) > 0
|
|
597
|
+
assert response.get_json()["geode_object_type"] == "PointSet3D"
|
|
598
|
+
assert response.get_json()["viewable_file"].endswith(".vtp")
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import xml.etree.ElementTree as ET
|
|
3
|
-
import flask
|
|
4
|
-
from opengeodeweb_microservice.schemas import get_schemas_dict
|
|
5
|
-
|
|
6
|
-
from opengeodeweb_back import geode_functions, utils_functions
|
|
7
|
-
from opengeodeweb_back.geode_objects.geode_model import GeodeModel
|
|
8
|
-
from . import schemas
|
|
9
|
-
|
|
10
|
-
routes = flask.Blueprint("models", __name__, url_prefix="/models")
|
|
11
|
-
schemas_dict = get_schemas_dict(os.path.join(os.path.dirname(__file__), "schemas"))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@routes.route(
|
|
15
|
-
schemas_dict["model_components"]["route"],
|
|
16
|
-
methods=schemas_dict["model_components"]["methods"],
|
|
17
|
-
)
|
|
18
|
-
def model_components() -> flask.Response:
|
|
19
|
-
json_data = utils_functions.validate_request(
|
|
20
|
-
flask.request, schemas_dict["model_components"]
|
|
21
|
-
)
|
|
22
|
-
params = schemas.ModelComponents.from_dict(json_data)
|
|
23
|
-
model = geode_functions.load_geode_object(params.id)
|
|
24
|
-
if not isinstance(model, GeodeModel):
|
|
25
|
-
flask.abort(400, f"{params.id} is not a GeodeModel")
|
|
26
|
-
|
|
27
|
-
vtm_file_path = geode_functions.data_file_path(params.id, "viewable.vtm")
|
|
28
|
-
tree = ET.parse(vtm_file_path)
|
|
29
|
-
root = tree.find("vtkMultiBlockDataSet")
|
|
30
|
-
if root is None:
|
|
31
|
-
flask.abort(500, "Failed to read viewable file")
|
|
32
|
-
uuid_to_flat_index = {}
|
|
33
|
-
current_index = 0
|
|
34
|
-
assert root is not None
|
|
35
|
-
for elem in root.iter():
|
|
36
|
-
if "uuid" in elem.attrib and elem.tag == "DataSet":
|
|
37
|
-
uuid_to_flat_index[elem.attrib["uuid"]] = current_index
|
|
38
|
-
current_index += 1
|
|
39
|
-
model_mesh_components = model.mesh_components()
|
|
40
|
-
mesh_components = []
|
|
41
|
-
for mesh_component, ids in model_mesh_components.items():
|
|
42
|
-
component_type = mesh_component.get()
|
|
43
|
-
for id in ids:
|
|
44
|
-
geode_id = id.string()
|
|
45
|
-
component_name = geode_id
|
|
46
|
-
viewer_id = uuid_to_flat_index[geode_id]
|
|
47
|
-
boundaries = model.boundaries(id)
|
|
48
|
-
boundaries_uuid = [boundary.id().string() for boundary in boundaries]
|
|
49
|
-
internals = model.internals(id)
|
|
50
|
-
internals_uuid = [internal.id().string() for internal in internals]
|
|
51
|
-
mesh_component_object = {
|
|
52
|
-
"viewer_id": viewer_id,
|
|
53
|
-
"geode_id": geode_id,
|
|
54
|
-
"name": component_name,
|
|
55
|
-
"type": component_type,
|
|
56
|
-
"boundaries": boundaries_uuid,
|
|
57
|
-
"internals": internals_uuid,
|
|
58
|
-
}
|
|
59
|
-
mesh_components.append(mesh_component_object)
|
|
60
|
-
|
|
61
|
-
model_collection_components = model.collection_components()
|
|
62
|
-
collection_components = []
|
|
63
|
-
for collection_component, ids in model_collection_components.items():
|
|
64
|
-
component_type = collection_component.get()
|
|
65
|
-
for id in ids:
|
|
66
|
-
geode_id = id.string()
|
|
67
|
-
items = model.items(id)
|
|
68
|
-
items_uuid = [item.id().string() for item in items]
|
|
69
|
-
collection_component_object = {
|
|
70
|
-
"geode_id": geode_id,
|
|
71
|
-
"name": geode_id,
|
|
72
|
-
"type": component_type,
|
|
73
|
-
"items": items_uuid,
|
|
74
|
-
}
|
|
75
|
-
collection_components.append(collection_component_object)
|
|
76
|
-
|
|
77
|
-
return flask.make_response(
|
|
78
|
-
{
|
|
79
|
-
"mesh_components": mesh_components,
|
|
80
|
-
"collection_components": collection_components,
|
|
81
|
-
},
|
|
82
|
-
200,
|
|
83
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .model_components import *
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import shutil
|
|
3
|
-
import zipfile
|
|
4
|
-
import json
|
|
5
|
-
from flask.testing import FlaskClient
|
|
6
|
-
from werkzeug.datastructures import FileStorage
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
from opengeodeweb_microservice.database.data import Data
|
|
10
|
-
from opengeodeweb_microservice.database.connection import get_session
|
|
11
|
-
from opengeodeweb_back import geode_functions
|
|
12
|
-
from opengeodeweb_back.geode_objects.geode_brep import GeodeBRep
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from .test_routes import test_save_viewable_file
|
|
16
|
-
|
|
17
|
-
base_dir = os.path.abspath(os.path.dirname(__file__))
|
|
18
|
-
data_dir = os.path.join(base_dir, "data")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def test_model_components(client: FlaskClient) -> None:
|
|
22
|
-
geode_object_type = "BRep"
|
|
23
|
-
filename = "cube.og_brep"
|
|
24
|
-
response = test_save_viewable_file(client, geode_object_type, filename)
|
|
25
|
-
|
|
26
|
-
route = "/opengeodeweb_back/models/model_components"
|
|
27
|
-
brep_filename = os.path.join(data_dir, "cube.og_brep")
|
|
28
|
-
|
|
29
|
-
response = client.post(route, json={"id": response.get_json()["id"]})
|
|
30
|
-
assert response.status_code == 200
|
|
31
|
-
assert "mesh_components" in response.get_json()
|
|
32
|
-
mesh_components = response.get_json()["mesh_components"]
|
|
33
|
-
assert isinstance(mesh_components, list)
|
|
34
|
-
assert len(mesh_components) > 0
|
|
35
|
-
for mesh_component in mesh_components:
|
|
36
|
-
assert isinstance(mesh_component, object)
|
|
37
|
-
assert isinstance(mesh_component["geode_id"], str)
|
|
38
|
-
assert isinstance(mesh_component["viewer_id"], int)
|
|
39
|
-
assert isinstance(mesh_component["name"], str)
|
|
40
|
-
assert isinstance(mesh_component["type"], str)
|
|
41
|
-
assert isinstance(mesh_component["boundaries"], list)
|
|
42
|
-
for boundary_uuid in mesh_component["boundaries"]:
|
|
43
|
-
assert isinstance(boundary_uuid, str)
|
|
44
|
-
assert isinstance(mesh_component["internals"], list)
|
|
45
|
-
for internal_uuid in mesh_component["internals"]:
|
|
46
|
-
assert isinstance(internal_uuid, str)
|
|
47
|
-
assert "collection_components" in response.get_json()
|
|
48
|
-
collection_components = response.get_json()["collection_components"]
|
|
49
|
-
assert isinstance(collection_components, list)
|
|
50
|
-
for collection_component in collection_components:
|
|
51
|
-
assert isinstance(collection_component, object)
|
|
52
|
-
assert isinstance(collection_component["geode_id"], str)
|
|
53
|
-
assert isinstance(collection_component["name"], str)
|
|
54
|
-
assert isinstance(collection_component["items"], list)
|
|
55
|
-
for item_uuid in collection_component["items"]:
|
|
56
|
-
assert isinstance(item_uuid, str)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def test_export_project_route(client: FlaskClient, tmp_path: Path) -> None:
|
|
60
|
-
route = "/opengeodeweb_back/export_project"
|
|
61
|
-
snapshot = {
|
|
62
|
-
"styles": {"1": {"visibility": True, "opacity": 1.0, "color": [0.2, 0.6, 0.9]}}
|
|
63
|
-
}
|
|
64
|
-
filename = "export_project_test.vease"
|
|
65
|
-
project_folder = client.application.config["DATA_FOLDER_PATH"]
|
|
66
|
-
os.makedirs(project_folder, exist_ok=True)
|
|
67
|
-
database_root_path = os.path.join(project_folder, "project.db")
|
|
68
|
-
with open(database_root_path, "wb") as f:
|
|
69
|
-
f.write(b"test_project_db")
|
|
70
|
-
|
|
71
|
-
with get_session() as session:
|
|
72
|
-
session.query(Data).delete()
|
|
73
|
-
session.commit()
|
|
74
|
-
|
|
75
|
-
data1 = Data(
|
|
76
|
-
id="test_data_1",
|
|
77
|
-
geode_object="BRep",
|
|
78
|
-
viewer_object="BRep",
|
|
79
|
-
viewer_elements_type="default",
|
|
80
|
-
native_file="native.txt",
|
|
81
|
-
)
|
|
82
|
-
data2 = Data(
|
|
83
|
-
id="test_data_2",
|
|
84
|
-
geode_object="Section",
|
|
85
|
-
viewer_object="Section",
|
|
86
|
-
viewer_elements_type="default",
|
|
87
|
-
native_file="native.txt",
|
|
88
|
-
)
|
|
89
|
-
session.add(data1)
|
|
90
|
-
session.add(data2)
|
|
91
|
-
session.commit()
|
|
92
|
-
|
|
93
|
-
data1_dir = os.path.join(project_folder, "test_data_1")
|
|
94
|
-
os.makedirs(data1_dir, exist_ok=True)
|
|
95
|
-
with open(os.path.join(data1_dir, "native.txt"), "w") as f:
|
|
96
|
-
f.write("native file content")
|
|
97
|
-
|
|
98
|
-
data2_dir = os.path.join(project_folder, "test_data_2")
|
|
99
|
-
os.makedirs(data2_dir, exist_ok=True)
|
|
100
|
-
with open(os.path.join(data2_dir, "native.txt"), "w") as f:
|
|
101
|
-
f.write("native file content")
|
|
102
|
-
|
|
103
|
-
response = client.post(route, json={"snapshot": snapshot, "filename": filename})
|
|
104
|
-
assert response.status_code == 200
|
|
105
|
-
assert response.headers.get("new-file-name") == filename
|
|
106
|
-
assert response.mimetype == "application/octet-binary"
|
|
107
|
-
response.direct_passthrough = False
|
|
108
|
-
zip_bytes = response.get_data()
|
|
109
|
-
tmp_zip_path = tmp_path / filename
|
|
110
|
-
tmp_zip_path.write_bytes(zip_bytes)
|
|
111
|
-
|
|
112
|
-
with zipfile.ZipFile(tmp_zip_path, "r") as zip_file:
|
|
113
|
-
names = zip_file.namelist()
|
|
114
|
-
assert "snapshot.json" in names
|
|
115
|
-
parsed = json.loads(zip_file.read("snapshot.json").decode("utf-8"))
|
|
116
|
-
assert parsed == snapshot
|
|
117
|
-
assert "project.db" in names
|
|
118
|
-
assert "test_data_1/native.txt" in names
|
|
119
|
-
assert "test_data_2/native.txt" in names
|
|
120
|
-
|
|
121
|
-
response.close()
|
|
122
|
-
|
|
123
|
-
export_path = os.path.join(project_folder, filename)
|
|
124
|
-
if os.path.exists(export_path):
|
|
125
|
-
os.remove(export_path)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def test_import_project_route(client: FlaskClient, tmp_path: Path) -> None:
|
|
129
|
-
route = "/opengeodeweb_back/import_project"
|
|
130
|
-
snapshot = {
|
|
131
|
-
"styles": {"1": {"visibility": True, "opacity": 1.0, "color": [0.2, 0.6, 0.9]}}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
original_data_folder = client.application.config["DATA_FOLDER_PATH"]
|
|
135
|
-
client.application.config["DATA_FOLDER_PATH"] = os.path.join(
|
|
136
|
-
str(tmp_path), "project_data"
|
|
137
|
-
)
|
|
138
|
-
db_path = os.path.join(client.application.config["DATA_FOLDER_PATH"], "project.db")
|
|
139
|
-
|
|
140
|
-
import sqlite3, zipfile, json
|
|
141
|
-
|
|
142
|
-
temp_db = tmp_path / "temp_project.db"
|
|
143
|
-
conn = sqlite3.connect(str(temp_db))
|
|
144
|
-
conn.execute(
|
|
145
|
-
"CREATE TABLE datas (id TEXT PRIMARY KEY, geode_object TEXT, viewer_object TEXT, viewer_elements_type TEXT, native_file TEXT, "
|
|
146
|
-
"viewable_file TEXT, light_viewable_file TEXT)"
|
|
147
|
-
)
|
|
148
|
-
conn.commit()
|
|
149
|
-
conn.close()
|
|
150
|
-
|
|
151
|
-
z = tmp_path / "import_project_test.vease"
|
|
152
|
-
with zipfile.ZipFile(z, "w", compression=zipfile.ZIP_DEFLATED) as zipf:
|
|
153
|
-
zipf.writestr("snapshot.json", json.dumps(snapshot))
|
|
154
|
-
zipf.write(str(temp_db), "project.db")
|
|
155
|
-
|
|
156
|
-
with open(z, "rb") as f:
|
|
157
|
-
resp = client.post(
|
|
158
|
-
route,
|
|
159
|
-
data={"file": (f, "import_project_test.vease")},
|
|
160
|
-
content_type="multipart/form-data",
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
assert resp.status_code == 200
|
|
164
|
-
assert resp.get_json().get("snapshot") == snapshot
|
|
165
|
-
assert os.path.exists(db_path)
|
|
166
|
-
|
|
167
|
-
from opengeodeweb_microservice.database import connection
|
|
168
|
-
|
|
169
|
-
client.application.config["DATA_FOLDER_PATH"] = original_data_folder
|
|
170
|
-
test_db_path = os.environ.get("TEST_DB_PATH")
|
|
171
|
-
if test_db_path:
|
|
172
|
-
connection.init_database(test_db_path, create_tables=True)
|
|
173
|
-
|
|
174
|
-
client.application.config["DATA_FOLDER_PATH"] = original_data_folder
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
def test_save_viewable_workflow_from_object(client: FlaskClient) -> None:
|
|
178
|
-
route = "/opengeodeweb_back/create/point"
|
|
179
|
-
point_data = {
|
|
180
|
-
"name": "workflow_point_3d",
|
|
181
|
-
"x": 0.0,
|
|
182
|
-
"y": 0.0,
|
|
183
|
-
"z": 0.0,
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
response = client.post(route, json=point_data)
|
|
187
|
-
assert response.status_code == 200
|
|
188
|
-
|
|
189
|
-
data_id = response.get_json()["id"]
|
|
190
|
-
assert isinstance(data_id, str) and len(data_id) > 0
|
|
191
|
-
assert response.get_json()["geode_object_type"] == "PointSet3D"
|
|
192
|
-
assert response.get_json()["viewable_file"].endswith(".vtp")
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
def test_import_extension_route(client: FlaskClient, tmp_path: Path) -> None:
|
|
196
|
-
"""Test importing a .vext extension file."""
|
|
197
|
-
route = "/opengeodeweb_back/import_extension"
|
|
198
|
-
original_data_folder = client.application.config["DATA_FOLDER_PATH"]
|
|
199
|
-
new_data_folder = os.path.join(str(tmp_path), "extension_test_data")
|
|
200
|
-
client.application.config["DATA_FOLDER_PATH"] = new_data_folder
|
|
201
|
-
client.application.config["EXTENSIONS_FOLDER_PATH"] = os.path.join(
|
|
202
|
-
new_data_folder, "extensions"
|
|
203
|
-
)
|
|
204
|
-
vext_path = tmp_path / "test-extension-1.0.0.vext"
|
|
205
|
-
with zipfile.ZipFile(vext_path, "w", compression=zipfile.ZIP_DEFLATED) as zipf:
|
|
206
|
-
zipf.writestr(
|
|
207
|
-
"test-extension-extension.es.js",
|
|
208
|
-
"export const metadata = { id: 'test-extension', name: 'Test Extension' };",
|
|
209
|
-
)
|
|
210
|
-
zipf.writestr("test-extension-back", "#!/bin/bash\necho 'mock backend'")
|
|
211
|
-
zipf.writestr("test-extension.css", ".test { color: red; }")
|
|
212
|
-
with open(vext_path, "rb") as f:
|
|
213
|
-
response = client.post(
|
|
214
|
-
route,
|
|
215
|
-
data={"file": (f, "test-extension-1.0.0.vext")},
|
|
216
|
-
content_type="multipart/form-data",
|
|
217
|
-
)
|
|
218
|
-
assert response.status_code == 200
|
|
219
|
-
json_data = response.get_json()
|
|
220
|
-
assert "extension_name" in json_data
|
|
221
|
-
assert "frontend_content" in json_data
|
|
222
|
-
assert "backend_path" in json_data
|
|
223
|
-
assert json_data["extension_name"] == "test-extension"
|
|
224
|
-
extensions_folder = os.path.join(
|
|
225
|
-
client.application.config["DATA_FOLDER_PATH"], "extensions"
|
|
226
|
-
)
|
|
227
|
-
extension_path = os.path.join(extensions_folder, "test-extension")
|
|
228
|
-
assert os.path.exists(extension_path)
|
|
229
|
-
|
|
230
|
-
# Verify frontend content is returned
|
|
231
|
-
frontend_content = json_data["frontend_content"]
|
|
232
|
-
assert isinstance(frontend_content, str)
|
|
233
|
-
assert len(frontend_content) > 0
|
|
234
|
-
assert "export const metadata" in frontend_content
|
|
235
|
-
|
|
236
|
-
backend_exec = json_data["backend_path"]
|
|
237
|
-
assert os.path.exists(backend_exec)
|
|
238
|
-
assert os.access(backend_exec, os.X_OK)
|
|
239
|
-
client.application.config["DATA_FOLDER_PATH"] = original_data_folder
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
def test_import_extension_invalid_file(client: FlaskClient, tmp_path: Path) -> None:
|
|
243
|
-
"""Test importing an invalid .vext file (missing dist folder)."""
|
|
244
|
-
route = "/opengeodeweb_back/import_extension"
|
|
245
|
-
original_data_folder = client.application.config["DATA_FOLDER_PATH"]
|
|
246
|
-
new_data_folder = os.path.join(str(tmp_path), "extension_invalid_test")
|
|
247
|
-
client.application.config["DATA_FOLDER_PATH"] = new_data_folder
|
|
248
|
-
client.application.config["EXTENSIONS_FOLDER_PATH"] = os.path.join(
|
|
249
|
-
new_data_folder, "extensions"
|
|
250
|
-
)
|
|
251
|
-
vext_path = tmp_path / "invalid-extension.vext"
|
|
252
|
-
with zipfile.ZipFile(vext_path, "w") as zipf:
|
|
253
|
-
zipf.writestr("README.md", "This is invalid")
|
|
254
|
-
with open(vext_path, "rb") as f:
|
|
255
|
-
response = client.post(
|
|
256
|
-
route,
|
|
257
|
-
data={"file": (f, "invalid-extension.vext")},
|
|
258
|
-
content_type="multipart/form-data",
|
|
259
|
-
)
|
|
260
|
-
assert response.status_code == 400
|
|
261
|
-
client.application.config["DATA_FOLDER_PATH"] = original_data_folder
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
def test_import_extension_wrong_extension(client: FlaskClient, tmp_path: Path) -> None:
|
|
265
|
-
"""Test uploading a file with wrong extension."""
|
|
266
|
-
route = "/opengeodeweb_back/import_extension"
|
|
267
|
-
wrong_file = tmp_path / "not-an-extension.zip"
|
|
268
|
-
with open(wrong_file, "wb") as f:
|
|
269
|
-
f.write(b"test content")
|
|
270
|
-
with open(wrong_file, "rb") as f:
|
|
271
|
-
response = client.post(
|
|
272
|
-
route,
|
|
273
|
-
data={"file": (f, "not-an-extension.zip")},
|
|
274
|
-
content_type="multipart/form-data",
|
|
275
|
-
)
|
|
276
|
-
assert response.status_code == 400
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/OpenGeodeWeb_Back.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/geode_functions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/kill.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opengeodeweb_back-6.3.2rc1 → opengeodeweb_back-6.3.3}/src/opengeodeweb_back/routes/schemas/ping.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|