#NEWLINE# def includeme( config ) : #NEWLINE# #INDENT# '\n    :type config: :class:`pyramid.config.Configurator`\n    ' #NEWLINE# settings = config . registry . settings #NEWLINE# swagger_versions = get_swagger_versions ( settings ) #NEWLINE# config . add_renderer ( 'yaml' , 'pyramid_swagger.api.YamlRendererFactory' ) #NEWLINE# settings [ 'pyramid_swagger.schema12' ] = None #NEWLINE# settings [ 'pyramid_swagger.schema20' ] = None #NEWLINE# if ( SWAGGER_12 in swagger_versions ) : #NEWLINE# #INDENT# settings [ 'pyramid_swagger.schema12' ] = get_swagger_schema ( settings ) #NEWLINE# #UNINDENT# if ( SWAGGER_20 in swagger_versions ) : #NEWLINE# #INDENT# settings [ 'pyramid_swagger.schema20' ] = get_swagger_spec ( settings ) #NEWLINE# #UNINDENT# config . add_tween ( 'pyramid_swagger.tween.validation_tween_factory' , under = pyramid . tweens . EXCVIEW ) #NEWLINE# if settings . get ( 'pyramid_swagger.enable_api_doc_views' , True ) : #NEWLINE# #INDENT# if ( SWAGGER_12 in swagger_versions ) : #NEWLINE# #INDENT# register_api_doc_endpoints ( config , settings [ 'pyramid_swagger.schema12' ] . get_api_doc_endpoints ( ) ) #NEWLINE# #UNINDENT# if ( SWAGGER_20 in swagger_versions ) : #NEWLINE# #INDENT# register_api_doc_endpoints ( config , build_swagger_20_swagger_schema_views ( config ) , base_path = '' )