parameters: (self)
return_statement: return userDir
docstring: Creates (if required) and returns a filesystem directory for storing
          user config files.
docstring_summary: Creates (if required) and returns a filesystem directory for storing
          user config files.
docstring_tokens: Creates ( if required ) and returns a filesystem directory for storing user config files .
function: def GetUserCfgDir(self):
          """
          Creates (if required) and returns a filesystem directory for storing
          user config files.
  
          """
          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.\n')
                  try:
                      sys.stderr.write(warn)
                  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\n')
                  sys.stderr.write(warn)
                  raise SystemExit
          return userDir
function_tokens: def GetUserCfgDir ( self ) : 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.\n' ) try : sys . stderr . write ( warn ) 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\n' ) sys . stderr . write ( warn ) raise SystemExit return userDir