2007-12-09 Benny Malengier <benny.malengier@gramps-project.org>
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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user