Comment 3 for bug 333873

Revision history for this message
blackdaemon (blackdaemon) wrote :

Can we agree on that? I think this is very imnportant issue.

To summarize:

Linux:
  $HOME/.local/share/enso/

  files:
  $HOME/.local/share/enso/.ensorc
  $HOME/.local/share/enso/.ensocommands
  $HOME/.local/share/enso/commands/

  how to get it:
  os.expanduser("~/enso")

OSX:
  $HOME/enso/

  files:
  $HOME/enso/.ensorc
  $HOME/enso/.ensocommands
  $HOME/enso/commands/

  how to get it:
  os.expanduser("~/enso")

Windows XP/Vista:
  C:\Documents and Settings\<username>\Local Settings\Application Data\Enso\

  files:
  C:\Documents and Settings\<username>\Local Settings\Application Data\.ensorc
  C:\Documents and Settings\<username>\Local Settings\Application Data\.ensocommands
  C:\Documents and Settings\<username>\Local Settings\Application Data\Enso\commands\

  how to get it:
  from win32com.shell import shell, shellcon
  os.path.join(shell.SHGetFolderPath(0, shellcon.CSIDL_LOCAL_APPDATA, 0, 0), "Enso")

I suggest creating get_home_folder() or get_enso_folder() somewhere in enso/platform/xxx.

There is also possibility of having heavier platform specific APIs to get important folders, something like:
get_special_folder(constant.ENSO_FOLDER)
get_special_folder(constant.ENSO_LEARNASFOLDER)
get_special_folder(constant.ENSO_COMMANDSFOLDER)

etc.