def _find(self, spec):
        """
        Find and return the path to the template associated to the instance.

        """
        if spec.template_path is not None:
            return spec.template_path

        dir_path, file_name = self._find_relative(spec)

        locator = self.loader._make_locator()

        if dir_path is None:
            # Then we need to search for the path.
            path = locator.find_object(spec, self.loader.search_dirs, file_name=file_name)
        else:
            obj_dir = locator.get_object_directory(spec)
            path = os.path.join(obj_dir, dir_path, file_name)

        return path
def _find ( self , spec ) : if spec . template_path is not None : return spec . template_path dir_path , file_name = self . _find_relative ( spec ) locator = self . loader . _make_locator ( ) if dir_path is None : path = locator . find_object ( spec , self . loader . search_dirs , file_name = file_name ) else : obj_dir = locator . get_object_directory ( spec ) path = os . path . join ( obj_dir , dir_path , file_name ) return path
Find and return the path to the template associated to the instance.