def get_default_cache():
 try:
  return os.environ['PYTHON_EGG_CACHE']
 except KeyError:
  pass
 if (os.name != 'nt'):
  return os.path.expanduser('~/.python-eggs')
 app_data = 'Application Data'
 app_homes = [(('APPDATA',), None), (('USERPROFILE',), app_data), (('HOMEDRIVE', 'HOMEPATH'), app_data), (('HOMEPATH',), app_data), (('HOME',), None), (('WINDIR',), app_data)]
 for (keys, subdir) in app_homes:
  dirname = ''
  for key in keys:
   if (key in os.environ):
    dirname = os.path.join(dirname, os.environ[key])
   else:
    break
  else:
   if subdir:
    dirname = os.path.join(dirname, subdir)
   return os.path.join(dirname, 'Python-Eggs')
 else:
  raise RuntimeError('Please set the PYTHON_EGG_CACHE enviroment variable')

def get_default_cache ( ) : try : return os . environ [ 'PYTHON_EGG_CACHE' ] except KeyError : pass if ( os . name != 'nt' ) : return os . path . expanduser ( '~/.python-eggs' ) app_data = 'Application Data' app_homes = [ ( ( 'APPDATA' , ) , None ) , ( ( 'USERPROFILE' , ) , app_data ) , ( ( 'HOMEDRIVE' , 'HOMEPATH' ) , app_data ) , ( ( 'HOMEPATH' , ) , app_data ) , ( ( 'HOME' , ) , None ) , ( ( 'WINDIR' , ) , app_data ) ] for ( keys , subdir ) in app_homes : dirname = '' for key in keys : if ( key in os . environ ) : dirname = os . path . join ( dirname , os . environ [ key ] ) else : break else : if subdir : dirname = os . path . join ( dirname , subdir ) return os . path . join ( dirname , 'Python-Eggs' ) else : raise RuntimeError ( 'Please set the PYTHON_EGG_CACHE enviroment variable' )
return the python_egg_cache environment variable or a platform-relevant user cache dir for an app named "python-eggs" .