Ignore:
Timestamp:
May 23, 2008, 2:06:02 PM (16 years ago)
Author:
duncan
Message:

changing where caching goes

File:
1 edited

Legend:

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

    r4817 r5359  
    4242# Determine platform
    4343#
     44from os import getenv
     45
    4446import os
    4547if os.name in ['nt', 'dos', 'win32', 'what else?']:
     
    4850  unix = 1
    4951
     52cache_dir = '.python_cache'
    5053# Make default caching directory name
    5154#
    5255if unix:
    53   homedir = '~'
     56  homedir = getenv('INUNDATIONHOME')
     57  if homedir is None:
     58    homedir = '~'
     59  else:
     60    homedir = homedir + os.sep + '.cache'
     61    # Since homedir will be a group area, individually label the caches
     62    user = getenv('LOGNAME')
     63    if user is not None:
     64      cache_dir += '_' + user
     65   
    5466  CR = '\n'
    5567else:
     
    5769  CR = '\r\n'  #FIXME: Not tested under windows
    5870 
    59 cachedir = homedir + os.sep + '.python_cache' + os.sep
     71cachedir = homedir + os.sep + cache_dir + os.sep
    6072
    6173# -----------------------------------------------------------------------------
     
    24132425  #sys.exit()
    24142426  raise StandardError
     2427
     2428#-------------------------------------------------------------
     2429if __name__ == "__main__":
     2430  pass
Note: See TracChangeset for help on using the changeset viewer.