@@ -97,11 +97,8 @@ def allowed_objects():
9797 if flask .request .method == "OPTIONS" :
9898 return flask .make_response ({}, 200 )
9999
100- UPLOAD_FOLDER = flask .current_app .config ["UPLOAD_FOLDER" ]
101100 utils_functions .validate_request (flask .request , allowed_objects_json )
102- file_absolute_path = geode_functions .upload_file_path (
103- UPLOAD_FOLDER , flask .request .json ["filename" ]
104- )
101+ file_absolute_path = geode_functions .upload_file_path (flask .request .json ["filename" ])
105102 allowed_objects = geode_functions .list_geode_objects (
106103 file_absolute_path , flask .request .json ["supported_feature" ]
107104 )
@@ -120,12 +117,11 @@ def allowed_objects():
120117 methods = missing_files_json ["methods" ],
121118)
122119def missing_files ():
123- UPLOAD_FOLDER = flask .current_app .config ["UPLOAD_FOLDER" ]
124120 utils_functions .validate_request (flask .request , missing_files_json )
125-
121+ file_path = geode_functions . upload_file_path ( flask . request . json [ "filename" ])
126122 missing_files = geode_functions .missing_files (
127123 flask .request .json ["input_geode_object" ],
128- geode_functions . upload_file_path ( UPLOAD_FOLDER , flask . request . json [ "filename" ]) ,
124+ file_path ,
129125 )
130126 has_missing_files = missing_files .has_missing_files ()
131127
@@ -186,11 +182,9 @@ def crs_converter_geographic_coordinate_systems():
186182 methods = inspect_file_json ["methods" ],
187183)
188184def inspect_file ():
189- UPLOAD_FOLDER = flask .current_app .config ["UPLOAD_FOLDER" ]
190185 utils_functions .validate_request (flask .request , inspect_file_json )
191186
192- secure_filename = werkzeug .utils .secure_filename (flask .request .json ["filename" ])
193- file_path = os .path .abspath (os .path .join (UPLOAD_FOLDER , secure_filename ))
187+ file_path = geode_functions .upload_file_path (flask .request .json ["filename" ])
194188 data = geode_functions .load (flask .request .json ["input_geode_object" ], file_path )
195189 class_inspector = geode_functions .inspect (
196190 flask .request .json ["input_geode_object" ], data
@@ -211,13 +205,13 @@ def inspect_file():
211205 methods = geode_objects_and_output_extensions_json ["methods" ],
212206)
213207def geode_objects_and_output_extensions ():
214- UPLOAD_FOLDER = flask .current_app .config ["UPLOAD_FOLDER" ]
215208 utils_functions .validate_request (
216209 flask .request , geode_objects_and_output_extensions_json
217210 )
211+ file_path = geode_functions .upload_file_path (flask .request .json ["filename" ])
218212 data = geode_functions .load (
219213 flask .request .json ["input_geode_object" ],
220- geode_functions . upload_file_path ( UPLOAD_FOLDER , flask . request . json [ "filename" ]) ,
214+ file_path ,
221215 )
222216 geode_objects_and_output_extensions = (
223217 geode_functions .geode_objects_output_extensions (
@@ -243,9 +237,8 @@ def geode_objects_and_output_extensions():
243237)
244238def save_viewable_file ():
245239 utils_functions .validate_request (flask .request , save_viewable_file_json )
246- UPLOAD_FOLDER = flask .current_app .config ["UPLOAD_FOLDER" ]
247- secure_filename = werkzeug .utils .secure_filename (flask .request .json ["filename" ])
248- file_path = os .path .abspath (os .path .join (UPLOAD_FOLDER , secure_filename ))
240+
241+ file_path = geode_functions .upload_file_path (flask .request .json ["filename" ])
249242 data = geode_functions .load (flask .request .json ["input_geode_object" ], file_path )
250243 return flask .make_response (
251244 utils_functions .generate_native_viewable_and_light_viewable (
@@ -296,7 +289,12 @@ def texture_coordinates():
296289
297290 texture_coordinates = data .texture_manager ().texture_names ()
298291
299- return flask .make_response ({"texture_coordinates" : texture_coordinates }, 200 )
292+ return flask .make_response (
293+ {
294+ "texture_coordinates" : texture_coordinates
295+ },
296+ 200
297+ )
300298
301299
302300with open (
0 commit comments