From 0328a4a943814f1b5fa6e092437b4af9cef88454 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 21 Mar 2006 06:33:59 +0000 Subject: [PATCH] .ini settings svn: r6186 --- ChangeLog | 4 ++++ src/Config/_GrampsIniKeys.py | 3 ++- src/Config/__init__.py | 11 ++++++++--- src/const.py.in | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b1cb8b99..b95de6a98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-03-20 Don Allingham + * src/const.py.in: fix path combination + * src/Config/__init__.py: actually pay attention to no_gconf + 2006-03-20 Brian Matherly * src/GrampsDb/_GrampsIniKeys.py: os independent path diff --git a/src/Config/_GrampsIniKeys.py b/src/Config/_GrampsIniKeys.py index f2da905e1..aaf024a7c 100644 --- a/src/Config/_GrampsIniKeys.py +++ b/src/Config/_GrampsIniKeys.py @@ -28,6 +28,7 @@ import os import time import ConfigParser import errno +import const NL = "\n" # FIX: newlines on Mac/Windows, if different? @@ -199,7 +200,7 @@ class IniKeyClient: def suggest_sync(self): self.save_ini() # save back to default file, if named -client = IniKeyClient(os.path.expanduser("~" + os.sep + ".gramps" + os.sep + "keys.ini")) +client = IniKeyClient(os.path.join(const.home_dir,"keys.ini")) #------------------------------------------------------------------------- # diff --git a/src/Config/__init__.py b/src/Config/__init__.py index e42a9e127..0ac47498f 100644 --- a/src/Config/__init__.py +++ b/src/Config/__init__.py @@ -25,7 +25,12 @@ This package implements access to GRAMPS configuration. It provides the choice between different storage backends. """ -try: - from _GrampsGconfKeys import * -except: +import const + +if const.no_gconf: from _GrampsIniKeys import * +else: + try: + from _GrampsGconfKeys import * + except: + from _GrampsIniKeys import * diff --git a/src/const.py.in b/src/const.py.in index fb957d70f..fb4d9a74b 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -79,9 +79,9 @@ no_gconf = False # #------------------------------------------------------------------------- if os.environ.has_key('HOME'): - home_dir = os.path(os.environ['HOME'],'.gramps') + home_dir = os.path.join(os.environ['HOME'],'.gramps') else: - home_dir = os.path(os.environ['USERPROFILE'],'gramps') + home_dir = os.path.join(os.environ['USERPROFILE'],'gramps') #------------------------------------------------------------------------- #