def _setup_config(self, dist, filename, section, vars, verbosity):
        """
        Called to setup an application, given its configuration
        file/directory.

        The default implementation calls
        ``package.websetup.setup_config(command, filename, section,
        vars)`` or ``package.websetup.setup_app(command, config,
        vars)``

        With ``setup_app`` the ``config`` object is a dictionary with
        the extra attributes ``global_conf``, ``local_conf`` and
        ``filename``
        """
        modules = [line.strip() for line in dist.get_metadata_lines('top_level.txt')
                    if line.strip() and not line.strip().startswith('#')]

        if not modules:
            print('No modules are listed in top_level.txt')
            print('Try running python setup.py egg_info to regenerate that file')

        for mod_name in modules:
            mod_name = mod_name + '.websetup'
            try:
                mod = self._import_module(mod_name)
            except __HOLE__ as e:
                print(e)
                desc = getattr(e, 'args', ['No module named websetup'])[0]
                if not desc.startswith('No module named websetup'):
                    raise
                mod = None

            if mod is None:
                continue

            if hasattr(mod, 'setup_app'):
                if verbosity:
                    print('Running setup_app() from %s' % mod_name)
                self._call_setup_app(mod.setup_app, filename, section, vars)
            elif hasattr(mod, 'setup_config'):
                if verbosity:
                    print('Running setup_config() from %s' % mod_name)
                mod.setup_config(None, filename, section, vars)
            else:
                print('No setup_app() or setup_config() function in %s (%s)' % (mod.__name__, mod.__file__))
dataset/ETHPy150Open TurboGears/gearbox/gearbox/commands/setup_app.py/SetupAppCommand._setup_config