parameters: ()
docstring: Determine the default cache location
  
      This returns the ``PYTHON_EGG_CACHE`` environment variable, if set.
      Otherwise, on Windows, it returns a "Python-Eggs" subdirectory of the
      "Application Data" directory.  On all other systems, it's "~/.python-eggs".
docstring_summary: Determine the default cache location
docstring_tokens: Determine the default cache location
function: def get_default_cache():
      """Determine the default cache location
  
      This returns the ``PYTHON_EGG_CACHE`` environment variable, if set.
      Otherwise, on Windows, it returns a "Python-Eggs" subdirectory of the
      "Application Data" directory.  On all other systems, it's "~/.python-eggs".
      """
      try:
          return os.environ['PYTHON_EGG_CACHE']
      except KeyError:
          pass
  
      if os.name!='nt':
          return os.path.expanduser('~/.python-eggs')
  
      app_data = 'Application Data'   # XXX this may be locale-specific!
      app_homes = [
          (('APPDATA',), None),       # best option, should be locale-safe
          (('USERPROFILE',), app_data),
          (('HOMEDRIVE','HOMEPATH'), app_data),
          (('HOMEPATH',), app_data),
          (('HOME',), None),
          (('WINDIR',), app_data),    # 95/98/ME
      ]
  
      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"
          )
function_tokens: 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' # XXX this may be locale-specific! app_homes = [ ( ( 'APPDATA' , ) , None ) , # best option, should be locale-safe ( ( 'USERPROFILE' , ) , app_data ) , ( ( 'HOMEDRIVE' , 'HOMEPATH' ) , app_data ) , ( ( 'HOMEPATH' , ) , app_data ) , ( ( 'HOME' , ) , None ) , ( ( 'WINDIR' , ) , app_data ) , # 95/98/ME ] 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" )