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

@@ -393,10 +393,12 @@ class GrampsParser(UpdateCallback):
"call" : (None, self.stop_call),
"gender" : (None, self.stop_gender),
"header" : (None, None),
"last" : (self.start_last, self.stop_last),
"last" : (self.start_last, self.stop_last),
"map" : (self.start_namemap, None),
"mediapath" : (None, self.stop_mediapath),
"mother" : (self.start_mother, None),
"name" : (self.start_name, self.stop_name),
"name" : (self.start_name, self.stop_name),
"namemaps" : (None, None),
"nick" : (None, self.stop_nick),
"note" : (self.start_note, self.stop_note),
"noteref" : (self.start_noteref, None),
@@ -1170,6 +1172,21 @@ class GrampsParser(UpdateCallback):
except KeyError:
pass
def start_namemap(self, attrs):
type = attrs.get('type')
key = attrs['key']
value = attrs['value']
if type == 'group_as':
if self.db.has_name_group_key(key) :
present = self.db.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)
self.errmsg(msg)
else:
self.db.set_name_group_mapping(key, value)
def start_last(self, attrs):
self.name.prefix = attrs.get('prefix', '')
self.name.group_as = attrs.get('group', '')