Skip to content

Commit 6085729

Browse files
MaxNumeriquegithub-actions[bot]
authored andcommitted
Apply prepare changes
1 parent b0c91a2 commit 6085729

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

src/opengeodeweb_back/geode_functions.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def is_loadable(geode_object: str, file_absolute_path: str):
3939
def load(geode_object: str, file_absolute_path: str):
4040
return geode_object_value(geode_object)["load"](file_absolute_path)
4141

42+
4243
def load_data(geode_object: str, request_json: dict):
4344
data_folder_path = flask.current_app.config["DATA_FOLDER_PATH"]
4445
file_absolute_path = os.path.join(
@@ -48,18 +49,23 @@ def load_data(geode_object: str, request_json: dict):
4849
)
4950
return load(geode_object, file_absolute_path)
5051

52+
5153
def data_file_path(request_json, filename):
52-
data_folder_path = flask.current_app.config["DATA_FOLDER_PATH"] # Use the load_data function to get the data folder path
54+
data_folder_path = flask.current_app.config[
55+
"DATA_FOLDER_PATH"
56+
] # Use the load_data function to get the data folder path
5357
return os.path.join(
5458
data_folder_path,
5559
request_json["id"],
5660
werkzeug.utils.secure_filename(filename),
5761
)
5862

63+
5964
def upload_file_path(upload_folder, filename):
60-
secure_filename = werkzeug.utils.secure_filename(filename) # filename must be grabbed from the data_file_path function
61-
return os.path.abspath(os.path.join(upload_folder, secure_filename)
62-
)
65+
secure_filename = werkzeug.utils.secure_filename(
66+
filename
67+
) # filename must be grabbed from the data_file_path function
68+
return os.path.abspath(os.path.join(upload_folder, secure_filename))
6369

6470

6571
def is_saveable(geode_object: str, data, filename: str):

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def allowed_objects():
100100
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]
101101
utils_functions.validate_request(flask.request, allowed_objects_json)
102102
file_absolute_path = geode_functions.upload_file_path(
103-
UPLOAD_FOLDER, flask.request.json["filename"])
103+
UPLOAD_FOLDER, flask.request.json["filename"]
104+
)
104105
allowed_objects = geode_functions.list_geode_objects(
105106
file_absolute_path, flask.request.json["supported_feature"]
106107
)
@@ -124,8 +125,7 @@ def missing_files():
124125

125126
missing_files = geode_functions.missing_files(
126127
flask.request.json["input_geode_object"],
127-
geode_functions.upload_file_path(
128-
UPLOAD_FOLDER, flask.request.json["filename"]),
128+
geode_functions.upload_file_path(UPLOAD_FOLDER, flask.request.json["filename"]),
129129
geode_functions.build_upload_file_path(
130130
UPLOAD_FOLDER, flask.request.json["filename"]
131131
),
@@ -220,8 +220,7 @@ def geode_objects_and_output_extensions():
220220
)
221221
data = geode_functions.load(
222222
flask.request.json["input_geode_object"],
223-
geode_functions.upload_file_path(
224-
UPLOAD_FOLDER, flask.request.json["filename"]),
223+
geode_functions.upload_file_path(UPLOAD_FOLDER, flask.request.json["filename"]),
225224
geode_functions.build_upload_file_path(
226225
UPLOAD_FOLDER, flask.request.json["filename"]
227226
),
@@ -297,9 +296,9 @@ def create_point():
297296
def texture_coordinates():
298297
utils_functions.validate_request(flask.request, texture_coordinates_json)
299298
data = geode_functions.load_data(
300-
flask.request.json["input_geode_object"],
301-
flask.request.json,
302-
)
299+
flask.request.json["input_geode_object"],
300+
flask.request.json,
301+
)
303302

304303
texture_coordinates = data.texture_manager().texture_names()
305304

@@ -320,8 +319,8 @@ def texture_coordinates():
320319
def vertex_attribute_names():
321320
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
322321
data = geode_functions.load_data(
323-
flask.request.json["input_geode_object"],
324-
flask.request.json,
322+
flask.request.json["input_geode_object"],
323+
flask.request.json,
325324
)
326325

327326
vertex_attribute_names = data.vertex_attribute_manager().attribute_names()
@@ -348,8 +347,8 @@ def vertex_attribute_names():
348347
def polygon_attribute_names():
349348
utils_functions.validate_request(flask.request, polygon_attribute_names_json)
350349
data = geode_functions.load_data(
351-
flask.request.json["input_geode_object"],
352-
flask.request.json,
350+
flask.request.json["input_geode_object"],
351+
flask.request.json,
353352
)
354353

355354
polygon_attribute_names = data.polygon_attribute_manager().attribute_names()
@@ -376,8 +375,8 @@ def polygon_attribute_names():
376375
def polyhedron_attribute_names():
377376
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
378377
data = geode_functions.load_data(
379-
flask.request.json["input_geode_object"],
380-
flask.request.json,
378+
flask.request.json["input_geode_object"],
379+
flask.request.json,
381380
)
382381

383382
polyhedron_attribute_names = data.polyhedron_attribute_manager().attribute_names()

0 commit comments

Comments
 (0)