#NEWLINE# def main( global_config , **settings ) : #NEWLINE# #INDENT# ' This function returns a Pyramid WSGI application.' #NEWLINE# session_factory = UnencryptedCookieSessionFactoryConfig ( settings [ 'session.secret' ] ) #NEWLINE# providers = settings . get ( 'login_providers' , '' ) #NEWLINE# providers = filter ( None , [ p . strip ( ) for line in providers . splitlines ( ) for p in line . split ( ', ' ) ] ) #NEWLINE# settings [ 'login_providers' ] = providers #NEWLINE# if ( not any ( providers ) ) : #NEWLINE# #INDENT# log . warn ( 'no login providers configured, double check your ini file and add a few' ) #NEWLINE# #UNINDENT# config = Configurator ( settings = settings ) #NEWLINE# config . set_session_factory ( session_factory ) #NEWLINE# config . add_static_view ( 'static' , 'static' , cache_max_age = 3600 ) #NEWLINE# if ( 'facebook' in providers ) : #NEWLINE# #INDENT# config . include ( 'velruse.providers.facebook' ) #NEWLINE# config . add_facebook_login_from_settings ( prefix = 'facebook.' ) #NEWLINE# #UNINDENT# if ( 'github' in providers ) : #NEWLINE# #INDENT# config . include ( 'velruse.providers.github' ) #NEWLINE# config . add_github_login_from_settings ( prefix = 'github.' ) #NEWLINE# #UNINDENT# if ( 'twitter' in providers ) : #NEWLINE# #INDENT# config . include ( 'velruse.providers.twitter' ) #NEWLINE# config . add_twitter_login_from_settings ( prefix = 'twitter.' ) #NEWLINE# #UNINDENT# if ( 'live' in providers ) : #NEWLINE# #INDENT# config . include ( 'velruse.providers.live' ) #NEWLINE# config . add_live_login_from_settings ( prefix = 'live.' ) #NEWLINE# #UNINDENT# if ( 'bitbucket' in providers ) : #NEWLINE# #INDENT# config . include ( 'velruse.providers.bitbucket' ) #NEWLINE# config . add_bitbucket_login_from_settings ( prefix = 'bitbucket.' ) #NEWLINE# #UNINDENT# if ( 'google' in providers ) : #NEWLINE# #INDENT# config . include ( 'velruse.providers.google' ) #NEWLINE# config . add_google_login ( realm = settings [ 'google.realm' ] , consumer_key = settings [ 'google.consumer_key' ] , consumer_secret = settings [ 'google.consumer_secret' ] ) #NEWLINE# #UNINDENT# if ( 'yahoo' in providers ) : #NEWLINE# #INDENT# config . include ( 'velruse.providers.yahoo' ) #NEWLINE# config . add_yahoo_login ( realm = settings [ 'yahoo.realm' ] , consumer_key = settings [ 'yahoo.consumer_key' ] , consumer_secret = settings [ 'yahoo.consumer_secret' ] ) #NEWLINE# #UNINDENT# config . scan ( ) #NEWLINE# return config . make_wsgi_app ( )