URL:
<http://gna.org/bugs/?17662>
Summary: Standardize mypaint configuration path
Project: MyPaint
Submitted by: tumagonx
Submitted on: Mon 07 Feb 2011 01:40:59 AM GMT
Severity: 1 - Wish
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release:
Planned Release: None
Operating System:
_______________________________________________________
Details:
In Windows I expect Local AppData folder for saving settings,
in pygobject there is glib.get_user_config_dir() but it has windows issue
that just recently fixed (Glib 2.27.x ?) otherwise it seems to conform XDG
spec too. I guess it's good to settle this before 1.0 release?
While still using older glib I propose this (mypaint.py):
...
if homepath == '~':
confpath = join(prefix, 'UserData')
#Workaround before glib.get_user_config_dir() fixed in upstream
elif sys.platform == 'win32':
import _winreg
try:
HKCU = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER)
except WindowsError:
print "Can't connect to local registry"
try:
ShellKey = _winreg.OpenKey(HKCU,
"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders")
except WindowsError:
print "Can't open Shell Folders key"
HKCU.Close()
try:
localappdatapath = _winreg.QueryValueEx(ShellKey, "Local
AppData")[0]
except WindowsError:
print "Can't retrive Local Application Data Path from registry"
HKCU.Close()
ShellKey.Close()
confpath = join(localappdatapath, 'mypaint/')
else:
confpath = join(homepath, '.mypaint/')
...
I will disable py2exe's logging too and use mypaint's (under additional
"logging mode" shortcut) and set the default file dialog path to "My
Documents"
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?17662>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Mypaint-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-bugs