#NEWLINE# def config_dirs( ) : #NEWLINE# #INDENT# 'Return a platform-specific list of candidates for user\n    configuration directories on the system.\n\n    The candidates are in order of priority, from highest to lowest. The\n    last element is the "fallback" location to be used when no\n    higher-priority config file exists.\n    ' #NEWLINE# paths = [ ] #NEWLINE# if ( platform . system ( ) == 'Darwin' ) : #NEWLINE# #INDENT# paths . append ( MAC_DIR ) #NEWLINE# paths . append ( UNIX_DIR_FALLBACK ) #NEWLINE# if ( UNIX_DIR_VAR in os . environ ) : #NEWLINE# #INDENT# paths . append ( os . environ [ UNIX_DIR_VAR ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( platform . system ( ) == 'Windows' ) : #NEWLINE# #INDENT# paths . append ( WINDOWS_DIR_FALLBACK ) #NEWLINE# if ( WINDOWS_DIR_VAR in os . environ ) : #NEWLINE# #INDENT# paths . append ( os . environ [ WINDOWS_DIR_VAR ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# paths . append ( UNIX_DIR_FALLBACK ) #NEWLINE# if ( UNIX_DIR_VAR in os . environ ) : #NEWLINE# #INDENT# paths . append ( os . environ [ UNIX_DIR_VAR ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# out = [ ] #NEWLINE# for path in paths : #NEWLINE# #INDENT# path = os . path . abspath ( os . path . expanduser ( path ) ) #NEWLINE# if ( path not in out ) : #NEWLINE# #INDENT# out . append ( path ) #NEWLINE# #UNINDENT# #UNINDENT# return out