def update_path_objs_appearance(self):
        """Update path objects to reflect selection state."""
        for path_obj in self.path_objs:

            ### try retrieving the index of the path
            try:
                index = self.selectable_paths.index(path_obj.path)

            ### in case a value error occurs, it means
            ### the path isn't selectable (it is either
            ### the parent path or None); when the path
            ### is the parent path, we must make sure that
            ### it appears as deselected, since it mustn't
            ### be selected; when the path is None, though,
            ### no further action is needed, since it isn't
            ### a visible object anyway (its drawing
            ### operation is set to an empty function);

            except ValueError:

                if path_obj.text == PATH_OBJ_PARENT_TEXT:
                    path_obj.deselect()

            ### otherwise, with the index you just obtained,
            ### retrieve the selected state and use it to
            ### change the selection appearance of the path
            ### obj

            else:

                selected_state = self.selection_states[index]
                path_obj.change_selection_appearance(selected_state)
Update path objects to reflect selection state.
nodezator/fileman/dirpanel/main.py