Got something in my configuration somewhere that insists on writing my configuration to my HomeDrive instead of my Documents and Settings\UserName folder. Anyone know what setting drpython is reading to determine this? I'd like to modify my system to avoid this happening in the future when that home drive is mapped (to P: in my case).
I was checking this and it seems that if you have a HOMEDIR set in your SET commands, it automatically chooses this. The problem is for mobile users who may not always be connected. My HOMEDIR is set by default to a network drive. When I work offline, it doesn't find this and sets self.homedirectory to APPDATA instead. I was wondering if it might be worth moving this part up in the code to check that for Windows first rather than the HOMEDIR. I've already modified my system and this works great for me, but I'll have to remember this on my next install.
Not sure how this affects anything else, so wanted to put that out here to see what the thoughts were.
self.homedirectory = os.environ["APPDATA"].replace("\\", "/") #os.path.expanduser("~")
(Suggestion to Dan)
preferences => use own drPython basedirectory
directory (weglicken fragen ob file gelscht werden soll)
ask delete file
for example .drpython in root of current drive
homedir=c:/ (or c:/windows, ....)
homedirset = False
if os.path.exists (<currentdrive> + '/.drPython"
f = file(DrFrame.homedirectory + "/plugins/FindAutoComplete.preferences.dat", 'r')
text = f.read()
if os.path.exists (homedir)
self.homedirectory = homedir
homdirset = True
Messagebox (does not exist; take default)
if not homdirset:
self.homedirectory = os.path.expanduser("~")
I'm looking at the suggestions and that could be useful, but I know several people who dual/triple/multiple boot systems and have C: set to something like Win9x (used infrequently) and another drive set for Windows NT flavor. Setting C: as Homedir probably wouldn't work as expected for them, though it would be relatively consistent. I was just thinking that checking for a local settings folder first may be desirable instead of defaulting to HomeDir.
I think this would also catch the instances involving roaming profiles because it would go to their particular Application Data folders first, then to the home directory. Local users would get a local/portable copy. Roaming users would get their roaming copy.
Setting C: by default would also cause some havoc on things like Citrix servers. Users don't typically have rights to that drive or the whole thing. They would also run the risk of overwriting preferences.
I like the idea in general though.
Thank you for the help/comments.
Hm, yes, you're right about this,
i didn't consider the fact about multiple users and multiple operating systems on one machine.
We had already a discussion of using appdata
environment variabl in the feature-request tracker.
[ 1025252 ] change DrPython directory in Windows
and in open discussion: Windows Question
Alright, so here's the deal:
If I change how this works by default, existing windows users will have to move all of their drpython setting, plugins, etc. My question is, do you think this is worth it?
At the moment, for the next version I am including a short script that can be run on its own, pops up a Directory Selection Dialog, and edits drpython.py to set the homedirectory variable to the directory you select.
Is this enough of a solution?
I am actually quite split on what to do.
If the App Data environment variable is the preferred solutution on windows, and it is always availible (in situations where the home directory is not), then perhaps I should just change it, and make a large note of the change to users.
I like the idea of running a short script on setup or perhaps some other easy method that sets the directory for that computer/user. I think the App Data environment variable is the current preferred method, but don't know about what the future holds - this is MS after all. :-)
Perhaps also add some items in that script to allow moving the setting folder? That would allow us to keep something that was created in the HOMEDIR by moving it somewhere we specify for users who have been running for a while.
Hmmmm. It would be pretty simple to expand the prefs script to allow for moving/copying preferences.
1. Allow you to set the preferences directory
(and prompt the user to move existing preferences/plugins to that directory, if they exist).
2. Allow you to make a copy of the preferences directory (Either copy from x to y, or zip it all up).