'Generate a list of books sorted by title.
Sort the database by title.
Inputs:
self.books_to_catalog (list): database
Outputs:
books_by_title: database, sorted by title
Return:
True: no errors
False: author_sort mismatch detected while building MOBI'

def fetch_books_by_title(self):

    self.update_progress_full_step(_('Sorting    titles'))
    if len(self.books_to_catalog):
        self.books_by_title = sorted(self.books_to_catalog, key=(lambda x: sort_key(x['title_sort'].upper())))
        if (self.DEBUG and self.opts.verbose):
            self.opts.log.info(('fetch_books_by_title():    %d    books' % len(self.books_by_title)))
            self.opts.log.info(('    %-40s    %-40s' % ('title', 'title_sort')))
            for title in self.books_by_title:
                self.opts.log.info((u'    %-40s    %-40s' % (title['title'][0:40], title['title_sort'][0:40])).encode('utf-8'))
    else:
        error_msg = _("No    books    to    catalog.\nCheck    'Excluded    books'    rules    in    E-book    options.\n")
        self.opts.log.error((('***    ' + error_msg) + '    ***'))
        self.error.append(_('No    books    available    to    include    in    catalog'))
        self.error.append(error_msg)
        raise EmptyCatalogException(error_msg)
