Changeset 7197


Ignore:
Timestamp:
Jun 12, 2009, 3:33:59 PM (13 years ago)
Author:
rwilson
Message:

Changes to caching - use ANUGADATA environment variable, not INUNDATIONHOME.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/caching/caching.py

    r6232 r7197  
    5555
    5656cache_dir = '.python_cache'
     57
    5758# Make default caching directory name
    58 #
     59# We are changing the 'data directory' environment variable from
     60# INUNDATIONHOME to ANUGADATA - this gives a changeover.
    5961if unix:
    60   homedir = getenv('INUNDATIONHOME')
    61   if homedir is None:
    62     homedir = '~'
    63   else:
    64     homedir = homedir + os.sep + '.cache'
    65     # Since homedir will be a group area, individually label the caches
    66     user = getenv('LOGNAME')
    67     if user is not None:
    68       cache_dir += '_' + user
    69    
    70   CR = '\n'
     62    homedir = getenv('ANUGADATA')
     63    if not homedir:
     64        homedir = getenv('INUNDATIONHOME')
     65
     66    if not homedir:
     67        homedir = '~'
     68    else:
     69        # Since homedir will be a group area, individually label the caches
     70        user = getenv('LOGNAME')
     71        if not user:
     72            cache_dir += '_' + user
     73   
     74    CR = '\n'
    7175else:
    72   homedir = 'c:'
    73   CR = '\r\n'  #FIXME: Not tested under windows
    74  
    75 cachedir = homedir + os.sep + cache_dir + os.sep
     76    homedir = 'c:'
     77    CR = '\r\n'  #FIXME: Not tested under windows
     78 
     79cachedir = os.path.join(homedir, cache_dir)
    7680
    7781# -----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.