OpenGeodeWeb-Back 5.10.0rc18__py3-none-any.whl → 5.10.0rc19__py3-none-any.whl

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.

Potentially problematic release.


This version of OpenGeodeWeb-Back might be problematic. Click here for more details.

@@ -5,6 +5,7 @@ import time
5
5
  import zipfile
6
6
  from collections.abc import Callable
7
7
  from typing import Any
8
+ from concurrent.futures import ThreadPoolExecutor
8
9
 
9
10
  # Third party imports
10
11
  import flask
@@ -175,38 +176,47 @@ def save_all_viewables_and_return_info(
175
176
  additional_files=additional_files,
176
177
  )
177
178
  data_path = create_data_folder_from_id(data_entry.id)
178
- saved_native_file_path = geode_functions.save(
179
- geode_object,
180
- data,
181
- data_path,
182
- "native." + data.native_extension(),
183
- )
184
- saved_viewable_file_path = geode_functions.save_viewable(
185
- geode_object, data, data_path, "viewable"
186
- )
187
- saved_light_viewable_file_path = geode_functions.save_light_viewable(
188
- geode_object, data, data_path, "light_viewable"
189
- )
190
- with open(saved_light_viewable_file_path, "rb") as f:
191
- binary_light_viewable = f.read()
192
- data_entry.native_file_name = os.path.basename(saved_native_file_path[0])
193
- data_entry.viewable_file_name = os.path.basename(saved_viewable_file_path)
194
- data_entry.light_viewable = os.path.basename(saved_light_viewable_file_path)
195
-
196
- session = get_session()
197
- if session:
198
- session.commit()
199
-
200
- return {
201
- "native_file_name": data_entry.native_file_name,
202
- "viewable_file_name": data_entry.viewable_file_name,
203
- "id": data_entry.id,
204
- "object_type": geode_functions.get_object_type(geode_object),
205
- "binary_light_viewable": binary_light_viewable.decode("utf-8"),
206
- "geode_object": data_entry.geode_object,
207
- "input_files": data_entry.input_file,
208
- "additional_files": data_entry.additional_files,
209
- }
179
+ with ThreadPoolExecutor() as executor:
180
+ native_future = executor.submit(
181
+ geode_functions.save,
182
+ geode_object,
183
+ data,
184
+ data_path,
185
+ "native." + data.native_extension(),
186
+ )
187
+ viewable_future = executor.submit(
188
+ geode_functions.save_viewable, geode_object, data, data_path, "viewable"
189
+ )
190
+ light_viewable_future = executor.submit(
191
+ geode_functions.save_light_viewable,
192
+ geode_object,
193
+ data,
194
+ data_path,
195
+ "light_viewable",
196
+ )
197
+ saved_light_viewable_file_path = light_viewable_future.result()
198
+ with open(saved_light_viewable_file_path, "rb") as f:
199
+ binary_light_viewable = f.read()
200
+ saved_native_file_path = native_future.result()
201
+ saved_viewable_file_path = viewable_future.result()
202
+ data_entry.native_file_name = os.path.basename(saved_native_file_path[0])
203
+ data_entry.viewable_file_name = os.path.basename(saved_viewable_file_path)
204
+ data_entry.light_viewable = os.path.basename(saved_light_viewable_file_path)
205
+
206
+ session = get_session()
207
+ if session:
208
+ session.commit()
209
+
210
+ return {
211
+ "native_file_name": data_entry.native_file_name,
212
+ "viewable_file_name": data_entry.viewable_file_name,
213
+ "id": data_entry.id,
214
+ "object_type": geode_functions.get_object_type(geode_object),
215
+ "binary_light_viewable": binary_light_viewable.decode("utf-8"),
216
+ "geode_object": data_entry.geode_object,
217
+ "input_files": data_entry.input_file,
218
+ "additional_files": data_entry.additional_files,
219
+ }
210
220
 
211
221
 
212
222
  def generate_native_viewable_and_light_viewable_from_object(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenGeodeWeb-Back
3
- Version: 5.10.0rc18
3
+ Version: 5.10.0rc19
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
@@ -4,7 +4,7 @@ opengeodeweb_back/geode_functions.py,sha256=NzELy9s6AETDnm7tyA_uM2N89zrfeLdblRhz
4
4
  opengeodeweb_back/geode_objects.py,sha256=_NclGPa024kCwUHdORkFuXYtiZBmQpgq6sO3LRkBhe8,27776
5
5
  opengeodeweb_back/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
6
6
  opengeodeweb_back/test_utils.py,sha256=18AbRW9-tfKkPcmRGilTTHXI7S3armYyV7Vdy5UvUKM,794
7
- opengeodeweb_back/utils_functions.py,sha256=hqLDghUARAZSGPR8shXTOFXPauq_Z17HKBlIXUgJ1PI,8694
7
+ opengeodeweb_back/utils_functions.py,sha256=k8FpsHruaqnqyYgfwRC2JVvzoQrV5JgY7z5JJ7dhMgs,9180
8
8
  opengeodeweb_back/routes/blueprint_routes.py,sha256=h_yfFC3ljH0KqFr5Ab_-IQYNB7VVRENwAMQk4NDsh18,11042
9
9
  opengeodeweb_back/routes/models/blueprint_models.py,sha256=Jo9pUDeu1nO3_IbBiuHGk57cc4_fhwxjM0EKNyv1FT0,1874
10
10
  opengeodeweb_back/routes/models/schemas/mesh_components.json,sha256=JmQUvpy7HpGS6FlThZLx1YjHqiInRTqUZ_Ft5MfOzEE,239
@@ -23,8 +23,8 @@ opengeodeweb_back/routes/schemas/save_viewable_file.json,sha256=pvvEdaC7bNASPMrl
23
23
  opengeodeweb_back/routes/schemas/texture_coordinates.json,sha256=2uQueIl1jOmxFG_gIi_vJETR4IurrwuSf8GAnzphk9g,237
24
24
  opengeodeweb_back/routes/schemas/upload_file.json,sha256=LJ3U3L5ApKuQDVFIpVT_y2alq4HW_suTvZ3HUucNbhg,219
25
25
  opengeodeweb_back/routes/schemas/vertex_attribute_names.json,sha256=ECIflohiqPZNsflAdkfEzksL4we0JvZhIxUd84Ubctg,240
26
- opengeodeweb_back-5.10.0rc18.dist-info/licenses/LICENSE,sha256=LoTB-aqQvzTGxoTRXNnhNV0LKiqdk2bQv6MB34l8zkI,1079
27
- opengeodeweb_back-5.10.0rc18.dist-info/METADATA,sha256=AqgpiECbJ2mKVxs3SFxJ7EP5K0apGyE2HIPR7qF4wnE,2955
28
- opengeodeweb_back-5.10.0rc18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- opengeodeweb_back-5.10.0rc18.dist-info/top_level.txt,sha256=tN1FZeLIVBrdja2-pbmhg5-tK-JILmmT9OeIBnhlUrQ,18
30
- opengeodeweb_back-5.10.0rc18.dist-info/RECORD,,
26
+ opengeodeweb_back-5.10.0rc19.dist-info/licenses/LICENSE,sha256=LoTB-aqQvzTGxoTRXNnhNV0LKiqdk2bQv6MB34l8zkI,1079
27
+ opengeodeweb_back-5.10.0rc19.dist-info/METADATA,sha256=DZXD_vYSpV51_xPLueg-W3XWtrJ9elYJkAIGPsN--nQ,2955
28
+ opengeodeweb_back-5.10.0rc19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ opengeodeweb_back-5.10.0rc19.dist-info/top_level.txt,sha256=tN1FZeLIVBrdja2-pbmhg5-tK-JILmmT9OeIBnhlUrQ,18
30
+ opengeodeweb_back-5.10.0rc19.dist-info/RECORD,,