'Setup the `self.opts` object.'

def setup_options(self):

    self.opts = OptionValues()
    for group in (self.input_options, self.pipeline_options, self.output_options, self.all_format_options):
        for rec in group:
            setattr(self.opts, rec.option.name, rec.recommended_value)
    def set_profile(profiles, which):
        attr = (which + '_profile')
        sval = getattr(self.opts, attr)
        for x in profiles():
            if (x.short_name == sval):
                setattr(self.opts, attr, x)
                return
        self.log.warn(('Profile    (%s)    %r    is    no    longer    available,    using    default' % (which, sval)))
        for x in profiles():
            if (x.short_name == 'default'):
                setattr(self.opts, attr, x)
                break
    set_profile(input_profiles, 'input')
    set_profile(output_profiles, 'output')
    self.read_user_metadata()
    self.opts.no_inline_navbars = (self.opts.output_profile.supports_mobi_indexing and (self.output_fmt == 'mobi'))
    if self.opts.verbose:
        self.log.filter_level = self.log.DEBUG
    if self.changed_options:
        self.log('Conversion    options    changed    from    defaults:')
        for rec in self.changed_options:
            if (rec.option.name not in ('username', 'password')):
                self.log('    ', ('%s:' % rec.option.name), repr(rec.recommended_value))
    if (self.opts.verbose > 1):
        self.log.debug('Resolved    conversion    options')
        try:
            self.log.debug('calibre    version:', __version__)
            odict = dict(self.opts.__dict__)
            for x in ('username', 'password'):
                odict.pop(x, None)
            self.log.debug(pprint.pformat(odict))
        except:
            self.log.exception('Failed    to    get    resolved    conversion    options')
