A
Andrew Gregory
IDLE puts its configuration info. in a directory called .idlerc
On running it looks for this directory on a path given by the HOME
environment variable.
On Windows HOME would only exist if the user has created it. If it is
not there, IDLE defaults to the highest-lettered hard drive. This
often will be a network drive and is not a good choice. If the drive
is read only (which is quite possible) IDLE fails.
Here are a few extra lines to go in configHandler.h function
GetUserCfgDir to solve this. This allows an IDLERC environment
variable to be used.
def GetUserCfgDir(self):
"""
Creates (if required) and returns a filesystem directory for
storing
user config files.
"""
cfgDir='.idlerc'
if string.find(os.environ['os'].upper(),'WIN')>-1:
userDir=os.getenv('IDLERC')
if userDir==None: userDir=os.getenv('HOME') # may omit,
given later
if userDir==None: userDir="C:\\Python23"
if not os.path.exists(userDir): useDir=os.getcwd()
else:
userDir=os.path.expanduser('~') # unix
[snip]
Andrew.
On running it looks for this directory on a path given by the HOME
environment variable.
On Windows HOME would only exist if the user has created it. If it is
not there, IDLE defaults to the highest-lettered hard drive. This
often will be a network drive and is not a good choice. If the drive
is read only (which is quite possible) IDLE fails.
Here are a few extra lines to go in configHandler.h function
GetUserCfgDir to solve this. This allows an IDLERC environment
variable to be used.
def GetUserCfgDir(self):
"""
Creates (if required) and returns a filesystem directory for
storing
user config files.
"""
cfgDir='.idlerc'
if string.find(os.environ['os'].upper(),'WIN')>-1:
userDir=os.getenv('IDLERC')
if userDir==None: userDir=os.getenv('HOME') # may omit,
given later
if userDir==None: userDir="C:\\Python23"
if not os.path.exists(userDir): useDir=os.getcwd()
else:
userDir=os.path.expanduser('~') # unix
[snip]
Andrew.