@@ -110,55 +110,59 @@ def get_geode_object_output_extensions(geode_object: str):
110110 return output_list
111111
112112
113- def list_input_extensions (
114- keys : list = [],
115- ):
116- """
117- Purpose:
118- Function that returns a list of all input extensions
119- Args:
120- keys -- Tells the function if we want the geode_objects that have a crs
121- Returns:
122- An ordered list of input file extensions
123- """
113+ def list_input_extensions (keys : list = []):
124114 extensions_list = []
125-
126115 for geode_object , value in objects_list ().items ():
127116 if keys :
128117 for key in keys :
129118 if key in value :
130- if type (value [key ]) == bool and value [key ] == True :
131- pass
119+ if type (value [key ]) == bool :
120+ if value [key ] == True :
121+ extensions_list += get_geode_object_input_extensions (
122+ geode_object
123+ )
132124 else :
133- continue
125+ extensions_list += get_geode_object_input_extensions (
126+ geode_object
127+ )
134128 else :
135129 continue
136-
137- geode_object_input_extensions = get_geode_object_input_extensions (geode_object )
138- extensions_list = extensions_list + geode_object_input_extensions
130+ else :
131+ extensions_list += get_geode_object_input_extensions (geode_object )
139132
140133 extensions_list = list (set (extensions_list ))
141134 extensions_list .sort ()
142135 return extensions_list
143136
144137
138+ def has_creator (input_factories , extension : str ):
139+ for input in input_factories :
140+ if input .has_creator (extension ):
141+ return True
142+
143+
145144def list_geode_objects (extension : str , keys : list = []):
146- """
147- Purpose:
148- Function that returns a list of objects that can handle a file, given his extension
149- Args:
150- extension -- The extension of the file
151- Returns:
152- An ordered list of object's names
153- """
154145 geode_objects_list = []
155-
156146 for geode_object , value in objects_list ().items ():
157- input_factory = get_input_factory (geode_object )
158- for input in input_factory :
159- if input .has_creator (extension ):
160- if geode_object not in geode_objects_list :
161- geode_objects_list .append (geode_object )
147+ geode_object_input_factory = get_input_factory (geode_object )
148+ if keys :
149+ for key in keys :
150+ if key in value :
151+ if type (value [key ]) == bool :
152+ if value [key ] == True :
153+ if has_creator (geode_object_input_factory , extension ):
154+ print (f"{ geode_object = } " )
155+ geode_objects_list .append (geode_object )
156+ else :
157+ if has_creator (geode_object_input_factory , extension ):
158+ print (f"{ geode_object = } " )
159+ geode_objects_list .append (geode_object )
160+ else :
161+ continue
162+ else :
163+ if has_creator (geode_object_input_factory , extension ):
164+ print (f"{ geode_object = } " )
165+ geode_objects_list .append (geode_object )
162166 geode_objects_list .sort ()
163167 return geode_objects_list
164168
0 commit comments