Logo Search packages:      
Sourcecode: matplotlib version File versions

def matplotlib::config::cutils::get_config_file (   tconfig = False  ) 

Return the path to the rc file

Search order:

 * current working dir
 * environ var MATPLOTLIBRC
 * HOME/.matplotlib/matplotlibrc
 * MATPLOTLIBDATA/matplotlibrc

Definition at line 150 of file cutils.py.

00150                                   :
    """
    Return the path to the rc file

    Search order:

     * current working dir
     * environ var MATPLOTLIBRC
     * HOME/.matplotlib/matplotlibrc
     * MATPLOTLIBDATA/matplotlibrc

    """
    if tconfig:
        filename = 'matplotlib.conf'
    else:
        filename = 'matplotlibrc'

    fname = os.path.join( os.getcwd(), filename)
    if os.path.exists(fname): return fname

    if os.environ.has_key('MATPLOTLIBRC'):
        path =  os.environ['MATPLOTLIBRC']
        if os.path.exists(path):
            fname = os.path.join(path, filename)
            if os.path.exists(fname):
                return fname

    fname = os.path.join(get_configdir(), filename)
    if os.path.exists(fname): return fname


    path =  get_data_path() # guaranteed to exist or raise
    fname = os.path.join(path, filename)
    if not os.path.exists(fname):
        warnings.warn('Could not find %s; using defaults'%filename)
    return fname
    return fname


Generated by  Doxygen 1.6.0   Back to index