def update_outline_rect(self):
        """Update outline rect attribute.

        The outline rect is the rect of a path object when
        its path was the last selected one. When there's
        no such path (for instance, in freshly loaded
        directories), it is set to None.
        """
        index = self._last_selected_index

        ### check whether the index corresponds to a path
        ### in the self.selectable_paths

        try:
            path = self.selectable_paths[index]

        ### if a TypeError is raised, then it is None,
        ### in which case we set the outline rect to None
        except TypeError:
            self.outline_rect = None

        ### otherwise we check whether any of the path
        ### object holds that path

        else:

            ## if a path obj has such path, use its rect
            ## as the outline rect and break out of the
            ## loop

            for path_obj in self.path_objs:

                if path_obj.path == path:

                    self.outline_rect = path_obj.rect
                    break

            ## otherwise set the outline rect to None
            else:
                self.outline_rect = None
Update outline rect attribute.

        The outline rect is the rect of a path object when
        its path was the last selected one. When there's
        no such path (for instance, in freshly loaded
        directories), it is set to None.
        
nodezator/fileman/dirpanel/main.py