Add support for name grouping import/export
	* src/GrampsDb/_GrampsDbWriteXML.py: write group table out
	* src/GrampsDb/_GrampsBSDDB.py: group table is no sec table, init it
		together with primary tables!
	* src/gen/db/base.py: obtain grouping keys
	* src/gen/db/dbdir.py: group table is no sec table, init it
		together with primary tables!
	* src/gen/utils/dbutils.py: grdb -> grdb copy of grouping table, 
		copy mediapath.
	* src/gen/proxy/proxybase.py: obtain grouping keys, add missing
		bookmark methods
	* src/gen/proxy/dbbase.py: add obtain grouping keys method
	* src/GrampsDbUtils/_ReadXML.py: read in group table
	* src/plugins/ReadGrdb.py: read in group table



svn: r9464
This commit is contained in:
Benny Malengier
2007-12-09 10:18:59 +00:00
parent ee1b05acef
commit 027036a8c5
10 changed files with 151 additions and 20 deletions

View File

@@ -230,6 +230,22 @@ def importData(database, filename, callback=None, cl=0, use_trans=True):
database.repo_bookmarks.append_list(other_database.repo_bookmarks.get())
database.note_bookmarks.append_list(other_database.note_bookmarks.get())
# Copy grouping table
group_map = other_database.get_name_group_keys()
name_len = len(group_map)
if name_len > 0:
for key in group_map:
value = other_database.get_name_group_mapping(key)
if database.has_name_group_key(key) :
present = database.get_name_group_mapping(key)
if not value == present:
msg = _("Your family tree groups name %s together"
" with %s, did not change this grouping to %s") % (
key, present, value)
print msg
else:
database.set_name_group_mapping(key, value)
# close the other database and clean things up
other_database.close()