33import threading
44import time
55import zipfile
6+ from typing import List , Dict , Any
67
78# Third party imports
89import flask
@@ -154,8 +155,11 @@ def create_data_folder_from_id(data_id: str) -> str:
154155
155156
156157def save_all_viewables_and_return_info (
157- geode_object , data , input_file , additional_files = None
158- ):
158+ geode_object : str ,
159+ data : Any ,
160+ input_file : List [str ],
161+ additional_files : List [str ] = []
162+ ) -> Dict [str , Any ]:
159163 data_entry = Data .create (
160164 name = data .name (),
161165 geode_object = geode_object ,
@@ -191,18 +195,27 @@ def save_all_viewables_and_return_info(
191195 "object_type" : geode_functions .get_object_type (geode_object ),
192196 "binary_light_viewable" : binary_light_viewable .decode ("utf-8" ),
193197 "geode_object" : data_entry .geode_object ,
194- "input_files" : data_entry .additional_files ,
198+ "input_files" : data_entry .input_file ,
199+ "additional_files" : data_entry .additional_files ,
195200 }
196201
197202
198- def generate_native_viewable_and_light_viewable_from_object (geode_object , data ):
199- return save_all_viewables_and_return_info (geode_object , data )
203+ def generate_native_viewable_and_light_viewable_from_object (
204+ geode_object : str ,
205+ data : Any
206+ ) -> Dict [str , Any ]:
207+ return save_all_viewables_and_return_info (geode_object , data , input_file = [])
200208
201209
202- def generate_native_viewable_and_light_viewable_from_file (geode_object , input_filename ):
203- temp_data_entry = Data .create_and_get_id (
210+ def generate_native_viewable_and_light_viewable_from_file (
211+ geode_object : str ,
212+ input_filename : str
213+ ) -> Dict [str , Any ]:
214+ temp_data_entry = Data .create (
204215 name = "temp" ,
205- geode_object = geode_object
216+ geode_object = geode_object ,
217+ input_file = [input_filename ],
218+ additional_files = [],
206219 )
207220
208221 data_path = create_data_folder_from_id (temp_data_entry .id )
@@ -213,7 +226,7 @@ def generate_native_viewable_and_light_viewable_from_file(geode_object, input_fi
213226 )
214227 shutil .copy2 (full_input_filename , copied_full_path )
215228
216- additional_files_copied = []
229+ additional_files_copied : List [ str ] = []
217230 additional = geode_functions .additional_files (geode_object , full_input_filename )
218231 for additional_file in additional .mandatory_files + additional .optional_files :
219232 if additional_file .is_missing :
@@ -236,5 +249,6 @@ def generate_native_viewable_and_light_viewable_from_file(geode_object, input_fi
236249 return save_all_viewables_and_return_info (
237250 geode_object ,
238251 data ,
252+ input_file = [input_filename ],
239253 additional_files = additional_files_copied ,
240254 )
0 commit comments