'Generate catalog source files.
Assemble OPF, HTML and NCX files reflecting catalog options.
Generated source is OEB compliant.
Called from gui2.convert.gui_conversion:gui_catalog()
Args:
Exceptions:
AuthorSortMismatchException
EmptyCatalogException
Results:
error: problems reported during build'

def build_sources(self):

    self.fetch_books_by_title()
    self.fetch_books_by_author()
    self.fetch_bookmarks()
    if self.opts.generate_descriptions:
        self.generate_thumbnails()
        self.generate_html_descriptions()
    if self.opts.generate_authors:
        self.generate_html_by_author()
    if self.opts.generate_titles:
        self.generate_html_by_title()
    if self.opts.generate_series:
        self.generate_html_by_series()
    if self.opts.generate_genres:
        self.generate_html_by_genres()
        if ((self.opts.section_list == ['Genres']) and (not self.genres)):
            error_msg = _('No    genres    to    catalog.\n')
            if (not self.opts.cli_environment):
                error_msg += _("Check    'Excluded    genres'    regex    in    E-book    options.\n")
            self.opts.log.error(error_msg)
            self.error.append(_('No    books    available    to    catalog'))
            self.error.append(error_msg)
            raise EmptyCatalogException('No    genres    to    catalog')
    if self.opts.generate_recently_added:
        self.generate_html_by_date_added()
        if self.generate_recently_read:
            self.generate_html_by_date_read()
    self.generate_opf()
    self.generate_ncx_header()
    if self.opts.generate_authors:
        self.generate_ncx_by_author(_('Authors'))
    if self.opts.generate_titles:
        self.generate_ncx_by_title(_('Titles'))
    if self.opts.generate_series:
        self.generate_ncx_by_series(_('Series'))
    if self.opts.generate_genres:
        self.generate_ncx_by_genre(_('Genres'))
    if self.opts.generate_recently_added:
        self.generate_ncx_by_date_added(_('Recently    Added'))
        if self.generate_recently_read:
            self.generate_ncx_by_date_read(_('Recently    Read'))
    if self.opts.generate_descriptions:
        self.generate_ncx_descriptions(_('Descriptions'))
    self.write_ncx()
