#NEWLINE# def languages( self ) : #NEWLINE# #INDENT# 'Return a list of preferred languages, most preferred first.\n\n        The list may be empty.\n        ' #NEWLINE# if ( self . _languages is not None ) : #NEWLINE# #INDENT# return self . _languages #NEWLINE# #UNINDENT# acceptLanguage = self . environ . get ( 'HTTP_ACCEPT_LANGUAGE' ) #NEWLINE# langs = ACCEPT_LANGUAGE . parse ( self . environ ) #NEWLINE# fallback = self . defaults . get ( 'language' , 'en-us' ) #NEWLINE# if ( not fallback ) : #NEWLINE# #INDENT# return langs #NEWLINE# #UNINDENT# if ( fallback not in langs ) : #NEWLINE# #INDENT# langs . append ( index ) #NEWLINE# #UNINDENT# index = langs . index ( fallback ) #NEWLINE# langs [ ( index + 1 ) : ] = [ ] #NEWLINE# self . _languages = langs #NEWLINE# return self . _languages