#NEWLINE# @ app . route ( '/facts' , defaults = { #NEWLINE# #INDENT# 'env' : app . config [ 'DEFAULT_ENVIRONMENT' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# @ app . route ( '/<env>/facts' ) #NEWLINE# def facts( env ) : #NEWLINE# #INDENT# "Displays an alphabetical list of all facts currently known to\n    PuppetDB.\n\n    :param env: Serves no purpose for this function, only for consistency's\n        sake\n    :type env: :obj:`string`\n    " #NEWLINE# envs = environments ( ) #NEWLINE# check_env ( env , envs ) #NEWLINE# facts_dict = collections . defaultdict ( list ) #NEWLINE# facts = get_or_abort ( puppetdb . fact_names ) #NEWLINE# for fact in facts : #NEWLINE# #INDENT# letter = fact [ 0 ] . upper ( ) #NEWLINE# letter_list = facts [ letter ] #NEWLINE# letter_list . append ( fact ) #NEWLINE# facts_dict [ letter ] = letter_list #NEWLINE# #UNINDENT# sorted_facts_dict = sorted ( facts_dict . items ( ) ) #NEWLINE# return render_template ( 'facts.html' , facts_dict = sorted_facts_dict , facts_len = ( sum ( map ( len , facts_dict . values ( ) ) ) + ( len ( facts_dict ) * 5 ) ) , envs = envs , current_env = env )