def sort_dict_list(dict_list, sort_key): """Please add doc ASAP :param dict_list: :param sort_key: :return: """ sorted_dict_list = [] sort_key_values = [] for dictionary in dict_list: sort_key_values.append(dictionary[sort_key]) #FIXME: This is really complicated! Either there is an in-built function or dictionary['name'] would suffice for value in sort_urdf_elements(sort_key_values): for dictionary in dict_list: if dictionary[sort_key] == value: sorted_dict_list.append(dictionary) break # TODO: delete found dictionary to save time return sorted_dict_list
def sort_dict_list(dict_list, sort_key): """TODO Please add doc ASAP Args: dict_list: param sort_key: sort_key: Returns: """ sorted_dict_list = [] sort_key_values = [] for dictionary in dict_list: sort_key_values.append(dictionary[sort_key]) # FIXME: This is really complicated! Either there is an in-built function or dictionary['name'] would suffice for value in sort_urdf_elements(sort_key_values): for dictionary in dict_list: if dictionary[sort_key] == value: sorted_dict_list.append(dictionary) break # TODO: delete found dictionary to save time return sorted_dict_list