Get the :func:`~glob.glob()` pattern to find the main configuration file.

        :param directory: The pathname of a base directory (a string).
        :returns: A filename pattern (a string).

        This method generates a pattern that matches a filename based on
        :attr:`program_name` with the suffix :attr:`filename_extension` in the
        given base `directory`. Here's an example:

        >>> from update_dotdee import ConfigLoader
        >>> loader = ConfigLoader(program_name='update-dotdee')
        >>> [loader.get_main_pattern(d) for d in loader.base_directories]
        ['/etc/update-dotdee.ini',
         '~/.update-dotdee.ini',
         '~/.config/update-dotdee.ini']

def get_main_pattern(self, directory):
        """
        Get the :func:`~glob.glob()` pattern to find the main configuration file.

        :param directory: The pathname of a base directory (a string).
        :returns: A filename pattern (a string).

        This method generates a pattern that matches a filename based on
        :attr:`program_name` with the suffix :attr:`filename_extension` in the
        given base `directory`. Here's an example:

        >>> from update_dotdee import ConfigLoader
        >>> loader = ConfigLoader(program_name='update-dotdee')
        >>> [loader.get_main_pattern(d) for d in loader.base_directories]
        ['/etc/update-dotdee.ini',
         '~/.update-dotdee.ini',
         '~/.config/update-dotdee.ini']
        """
        return os.path.join(directory, format(
            '{prefix}{program_name}.{extension}',
            extension=self.filename_extension.lstrip('.'),
            program_name=self.program_name,
            prefix=self.get_prefix(directory),
        ))