def init_config(app):
        """Initialize configuration.

        .. note:: If CairoSVG is installed then the configuration
            ``FORMATTER_BADGES_ENABLE`` is ``True``.

        :param app: The Flask application.
        """
        try:
            get_distribution('CairoSVG')
            has_cairo = True
        except DistributionNotFound:
            has_cairo = False

        app.config.setdefault('FORMATTER_BADGES_ENABLE', has_cairo)

        for attr in dir(config):
            if attr.startswith('FORMATTER_'):
                app.config.setdefault(attr, getattr(config, attr))
def init_config ( app ) : try : get_distribution ( 'CairoSVG' ) has_cairo = True except DistributionNotFound : has_cairo = False app . config . setdefault ( 'FORMATTER_BADGES_ENABLE' , has_cairo ) for attr in dir ( config ) : if attr . startswith ( 'FORMATTER_' ) : app . config . setdefault ( attr , getattr ( config , attr ) )
Initialize configuration.

        .. note:: If CairoSVG is installed then the configuration
            ``FORMATTER_BADGES_ENABLE`` is ``True``.

        :param app: The Flask application.