2006-11-25 Alex Roitman <shura@gramps-project.org>
* src/GrampsDb/_GrampsBSDDB.py (GrampsBSDDB.load): Use per-database environment dirs, under ~/.gramps/env dir. * src/const.py.in (env_dir): Add new variable. svn: r7697
This commit is contained in:
parent
979162fa2d
commit
4dae3896e4
@ -1,3 +1,8 @@
|
|||||||
|
2006-11-25 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/GrampsDb/_GrampsBSDDB.py (GrampsBSDDB.load): Use
|
||||||
|
per-database environment dirs, under ~/.gramps/env dir.
|
||||||
|
* src/const.py.in (env_dir): Add new variable.
|
||||||
|
|
||||||
2006-11-25 Don Allingham <don@gramps-project.org>
|
2006-11-25 Don Allingham <don@gramps-project.org>
|
||||||
* src/Config/_GrampsConfigKeys.py: remember editor size
|
* src/Config/_GrampsConfigKeys.py: remember editor size
|
||||||
* src/Editors/_EditPlace.py: remember editor size
|
* src/Editors/_EditPlace.py: remember editor size
|
||||||
|
@ -31,6 +31,7 @@ Provides the Berkeley DB (BSDDB) database backend for GRAMPS
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import locale
|
import locale
|
||||||
@ -350,9 +351,20 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
|||||||
env_flags = db.DB_CREATE|db.DB_RECOVER|db.DB_PRIVATE|\
|
env_flags = db.DB_CREATE|db.DB_RECOVER|db.DB_PRIVATE|\
|
||||||
db.DB_INIT_MPOOL|db.DB_INIT_LOCK|\
|
db.DB_INIT_MPOOL|db.DB_INIT_LOCK|\
|
||||||
db.DB_INIT_LOG|db.DB_INIT_TXN|db.DB_THREAD
|
db.DB_INIT_LOG|db.DB_INIT_TXN|db.DB_THREAD
|
||||||
env_name = os.path.expanduser(const.bsddbenv_dir)
|
|
||||||
|
# Environment name is now based on the filename
|
||||||
|
env_name = os.path.join(os.path.expanduser(const.env_dir),
|
||||||
|
self.full_name[1:])
|
||||||
|
|
||||||
|
# Copy the old common environment dir to the new env
|
||||||
|
# if it does not exist yet
|
||||||
if not os.path.isdir(env_name):
|
if not os.path.isdir(env_name):
|
||||||
os.mkdir(env_name)
|
os.makedirs(env_name)
|
||||||
|
common_env_name = os.path.expanduser(const.bsddbenv_dir)
|
||||||
|
if os.path.isdir(common_env_name):
|
||||||
|
shutil.rmtree(env_name)
|
||||||
|
shutil.copytree(common_env_name,env_name)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
env_flags = db.DB_CREATE|db.DB_PRIVATE|db.DB_INIT_MPOOL
|
env_flags = db.DB_CREATE|db.DB_PRIVATE|db.DB_INIT_MPOOL
|
||||||
env_name = os.path.expanduser('~')
|
env_name = os.path.expanduser('~')
|
||||||
|
@ -100,6 +100,7 @@ report_options = os.path.join(home_dir,"report_options.xml")
|
|||||||
tool_options = os.path.join(home_dir,"tool_options.xml")
|
tool_options = os.path.join(home_dir,"tool_options.xml")
|
||||||
thumb_dir = os.path.join(home_dir,"thumb")
|
thumb_dir = os.path.join(home_dir,"thumb")
|
||||||
bsddbenv_dir = os.path.join(home_dir,"bsddbenv")
|
bsddbenv_dir = os.path.join(home_dir,"bsddbenv")
|
||||||
|
env_dir = os.path.join(home_dir,"env")
|
||||||
|
|
||||||
icon = os.path.join(root_dir,"images","gramps.png")
|
icon = os.path.join(root_dir,"images","gramps.png")
|
||||||
logo = os.path.join(root_dir,"images","logo.png")
|
logo = os.path.join(root_dir,"images","logo.png")
|
||||||
|
Loading…
Reference in New Issue
Block a user