* src/DbManager.py: make path recursive. Make default db dir consistent.

svn: r8589
This commit is contained in:
Brian Matherly 2007-06-19 04:27:32 +00:00
parent 3ec91e149b
commit 04a41cb464
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
2007-06-18 Brian Matherly <brian@gramps-project.org>
* src/DbManager.py: make path recursive. Make default db dir consistent.
2007-06-18 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsDBDir.py: revision control check in
* src/DbManager.py: revision control check in

View File

@ -73,7 +73,6 @@ import Config
# constants
#
#-------------------------------------------------------------------------
DEFAULT_DIR = os.path.join(const.home_dir, "grampsdb")
DEFAULT_TITLE = _("Family Tree")
NAME_FILE = "name.txt"
META_NAME = "meta_data.db"
@ -257,7 +256,7 @@ class DbManager:
try:
if not os.path.isdir(dbdir):
os.mkdir(dbdir)
os.makedirs(dbdir)
except (IOError, OSError), msg:
LOG.error(_("Could not make database directory: ") + str(msg))
@ -479,7 +478,8 @@ def find_next_db_dir():
"""
while True:
base = "%x" % int(time.time())
new_path = os.path.join(DEFAULT_DIR, base)
dbdir = os.path.expanduser(Config.get(Config.DATABASE_PATH))
new_path = os.path.join(dbdir, base)
if not os.path.isdir(new_path):
break
return new_path