def get_cache_dir():
 linkto = None
 if (set_temp_cache._temp_path is not None):
  xch = set_temp_cache._temp_path
  cache_path = os.path.join(xch, u'astropy')
  if (not os.path.exists(cache_path)):
   os.mkdir(cache_path)
  return os.path.abspath(cache_path)
 xch = os.environ.get(u'XDG_CACHE_HOME')
 if ((xch is not None) and os.path.exists(xch)):
  xchpth = os.path.join(xch, u'astropy')
  if (not os.path.islink(xchpth)):
   if os.path.exists(xchpth):
    return os.path.abspath(xchpth)
   else:
    linkto = xchpth
 return os.path.abspath(_find_or_create_astropy_dir(u'cache', linkto))

def get_cache_dir ( ) : linkto = None if ( set_temp_cache . _temp_path is not None ) : xch = set_temp_cache . _temp_path cache_path = os . path . join ( xch , u'astropy' ) if ( not os . path . exists ( cache_path ) ) : os . mkdir ( cache_path ) return os . path . abspath ( cache_path ) xch = os . environ . get ( u'XDG_CACHE_HOME' ) if ( ( xch is not None ) and os . path . exists ( xch ) ) : xchpth = os . path . join ( xch , u'astropy' ) if ( not os . path . islink ( xchpth ) ) : if os . path . exists ( xchpth ) : return os . path . abspath ( xchpth ) else : linkto = xchpth return os . path . abspath ( _find_or_create_astropy_dir ( u'cache' , linkto ) )
determines the astropy cache directory name and creates the directory if it doesnt exist .