human
Solve the following python programming problem given the following code:
@flaskbb.command()
@click.option('--server', '-s', default='gunicorn', type=click.Choice(['gunicorn', 'gevent']), help='The    WSGI    Server    to    run    FlaskBB    on.')
@click.option('--host', '-h', default='127.0.0.1', help='The    interface    to    bind    FlaskBB    to.')
@click.option('--port', '-p', default='8000', type=int, help='The    port    to    bind    FlaskBB    to.')
@click.option('--workers', '-w', default=4, help='The    number    of    worker    processes    for    handling    requests.')
@click.option('--daemon', '-d', default=False, is_flag=True, help='Starts    gunicorn    as    daemon.')
@click.option('--config', '-c', help='The    configuration    file    to    use    for    FlaskBB.')
def start(server, host, port, workers, config, daemon):
assistant
#Here is the Python program you requested.

    """Starts a production ready wsgi server.
    TODO: Figure out a way how to forward additional args to gunicorn
    without causing any errors.
    """
    if (server == 'gunicorn'):
        try:
            from gunicorn.app.base import Application
            class FlaskBBApplication(Application, ):
                def __init__(self, app, options=None):
                    self.options = (options or {})
                    self.application = app
                    super(FlaskBBApplication, self).__init__()
                def load_config(self):
                    config = dict([(key, value) for (key, value) in iteritems(self.options) if ((key in self.cfg.settings) and (value is not None))])
                    for (key, value) in iteritems(config):
                        self.cfg.set(key.lower(), value)
                def load(self):
                    return self.application
            options = {'bind': '{}:{}'.format(host, port), 'workers': workers, 'daemon': daemon}
            FlaskBBApplication(create_app(config=config), options).run()
        except ImportError:
            raise FlaskBBCLIError('Cannot    import    gunicorn.    Make    sure    it    is    installed.', fg='red')
    elif (server == 'gevent'):
        try:
            from gevent import __version__
            from gevent.pywsgi import WSGIServer
            click.secho('*    Starting    gevent    {}'.format(__version__))
            click.secho('*    Listening    on    http://{}:{}/'.format(host, port))
            http_server = WSGIServer((host, port), create_app(config=config))
            http_server.serve_forever()
        except ImportError:
            raise FlaskBBCLIError('Cannot    import    gevent.    Make    sure    it    is    installed.', fg='red')