class_docstr: Hold config parsers for all idle config files in singleton instance.
  
  Default config files, self.defaultCfg --
      for config_type in self.config_types:
          (idle install dir)/config-{config-type}.def
  
  User config files, self.userCfg --
      for config_type in self.config_types:
      (user home dir)/.idlerc/config-{config-type}.cfg
class_docstr_tok: ["Hold","config","parsers","for","all","idle","config","files","in","singleton","instance",".","Default","config","files",",","self.defaultCfg","--","for","config_type","in","self.config_types",":","(","idle","install","dir",")","\/config-","{","config-type","}",".def","User","config","files",",","self.userCfg","--","for","config_type","in","self.config_types",":","(","user","home","dir",")","\/.idlerc\/config-","{","config-type","}",".cfg"]
docstr: Return a filesystem directory for storing user config files.
  
  Creates it if required.
code: def GetUserCfgDir(self):
      """Return a filesystem directory for storing user config files.
  
      Creates it if required.
      """
      cfgDir = ".idlerc"
      userDir = os.path.expanduser("~")
      if userDir != "~":  # expanduser() found user home dir
          if not os.path.exists(userDir):
              warn = (
                  '\n Warning: os.path.expanduser("~") points to\n '
                  + userDir
                  + ",\n but the path does not exist."
              )
              try:
                  print(warn, file=sys.stderr)
              except IOError:
                  pass
              userDir = "~"
      if userDir == "~":  # still no path to home!
          # traditionally IDLE has defaulted to os.getcwd(), is this adequate?
          userDir = os.getcwd()
      userDir = os.path.join(userDir, cfgDir)
      if not os.path.exists(userDir):
          try:
              os.mkdir(userDir)
          except (OSError, IOError):
              warn = (
                  "\n Warning: unable to create user config directory\n"
                  + userDir
                  + "\n Check path and permissions.\n Exiting!\n"
              )
              print(warn, file=sys.stderr)
              raise SystemExit
      # TODO continue without userDIr instead of exit
      return userDir
  
imports: from __future__ import print_function
  import os
  import sys
  from ConfigParser import ConfigParser
  from Tkinter import TkVersion
  from tkFont import Font, nametofont
label_desc: Use image node_id 3 for calling the IdleConf obj's underlying member method code with example usage: obj.GetUserCfgDir() and returns: userDir