* src/Config/_GrampsIniKeys.py: Report error on invalid filename
* src/const.py.in: detect windows home directory before others svn: r7216
This commit is contained in:
parent
bc31162cc2
commit
3d3eda02a5
@ -1,3 +1,7 @@
|
|||||||
|
2006-08-20 Brian Matherly <brian@gramps-project.org>
|
||||||
|
* src/Config/_GrampsIniKeys.py: Report error on invalid filename
|
||||||
|
* src/const.py.in: detect windows home directory before others
|
||||||
|
|
||||||
2006-08-19 Alex Roitman <shura@gramps-project.org>
|
2006-08-19 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/plugins/MediaManager.py (Convert2Rel._run): Correct logic.
|
* src/plugins/MediaManager.py (Convert2Rel._run): Correct logic.
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ import time
|
|||||||
import ConfigParser
|
import ConfigParser
|
||||||
import errno
|
import errno
|
||||||
import const
|
import const
|
||||||
|
from QuestionDialog import ErrorDialog
|
||||||
from _GrampsConfigKeys import *
|
from _GrampsConfigKeys import *
|
||||||
|
|
||||||
NL = "\n" # FIX: newlines on Mac/Windows, if different?
|
NL = "\n" # FIX: newlines on Mac/Windows, if different?
|
||||||
@ -50,6 +51,15 @@ class IniKeyClient:
|
|||||||
self.filename = filename
|
self.filename = filename
|
||||||
if self.filename and os.path.exists(filename):
|
if self.filename and os.path.exists(filename):
|
||||||
self.data = self.load_ini(self.filename)
|
self.data = self.load_ini(self.filename)
|
||||||
|
elif self.filename and not os.path.exists(filename):
|
||||||
|
try:
|
||||||
|
head, tail = os.path.split( filename )
|
||||||
|
os.makedirs( head )
|
||||||
|
except OSError, e:
|
||||||
|
ErrorDialog(_("Unable to load preferences from %s") %
|
||||||
|
self.filename,
|
||||||
|
_("Preferences will not be loaded or saved."))
|
||||||
|
self.filename = None
|
||||||
|
|
||||||
def notify_add(self, path, func):
|
def notify_add(self, path, func):
|
||||||
"""
|
"""
|
||||||
|
@ -78,12 +78,12 @@ no_gconf = False
|
|||||||
# Windows apparently uses USERPROFILE
|
# Windows apparently uses USERPROFILE
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
if os.environ.has_key('HOME'):
|
if os.environ.has_key('USERPROFILE'):
|
||||||
user_home = os.environ['HOME']
|
|
||||||
home_dir = os.path.join(user_home,'.gramps')
|
|
||||||
else:
|
|
||||||
user_home = os.environ['USERPROFILE']
|
user_home = os.environ['USERPROFILE']
|
||||||
home_dir = os.path.join(user_home,'gramps')
|
home_dir = os.path.join(user_home,'gramps')
|
||||||
|
else:
|
||||||
|
user_home = os.environ['HOME']
|
||||||
|
home_dir = os.path.join(user_home,'.gramps')
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user