parameters: (csidl_name)
return_statement: return dir
docstring: This is a fallback technique at best. I'm not sure if using the
      registry for this guarantees us the correct answer for all CSIDL_*
      names.
docstring_summary: This is a fallback technique at best. I'm not sure if using the
      registry for this guarantees us the correct answer for all CSIDL_*
      names.
docstring_tokens: This is a fallback technique at best . I m not sure if using the registry for this guarantees us the correct answer for all CSIDL_ * names .
function: def _get_win_folder_from_registry(csidl_name):
      """This is a fallback technique at best. I'm not sure if using the
      registry for this guarantees us the correct answer for all CSIDL_*
      names.
      """
      if PY3:
        import winreg as _winreg
      else:
        import _winreg
  
      shell_folder_name = {
          "CSIDL_APPDATA": "AppData",
          "CSIDL_COMMON_APPDATA": "Common AppData",
          "CSIDL_LOCAL_APPDATA": "Local AppData",
      }[csidl_name]
  
      key = _winreg.OpenKey(
          _winreg.HKEY_CURRENT_USER,
          r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
      )
      dir, type = _winreg.QueryValueEx(key, shell_folder_name)
      return dir
function_tokens: def _get_win_folder_from_registry ( csidl_name ) : if PY3 : import winreg as _winreg else : import _winreg shell_folder_name = { "CSIDL_APPDATA" : "AppData" , "CSIDL_COMMON_APPDATA" : "Common AppData" , "CSIDL_LOCAL_APPDATA" : "Local AppData" , } [ csidl_name ] key = _winreg . OpenKey ( _winreg . HKEY_CURRENT_USER , r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ) dir , type = _winreg . QueryValueEx ( key , shell_folder_name ) return dir