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.
docstr_tok: ["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):
              if not idlelib.testing:
                  warn = (
                      '\n Warning: os.path.expanduser("~") points to\n '
                      + userDir
                      + ",\n but the path does not exist."
                  )
                  try:
                      print(warn, file=sys.stderr)
                  except OSError:
                      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:
              if not idlelib.testing:
                  warn = (
                      "\n Warning: unable to create user config directory\n"
                      + userDir
                      + "\n Check path and permissions.\n Exiting!\n"
                  )
                  try:
                      print(warn, file=sys.stderr)
                  except OSError:
                      pass
              raise SystemExit
      # TODO continue without userDIr instead of exit
      return userDir
  
imports: from configparser import ConfigParser
  import os
  import sys
  from tkinter.font import Font
  import idlelib
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