GEDCOM improvements for GENEWEB from Alexandre Duret-Lutz

svn: r1238
This commit is contained in:
Don Allingham
2003-01-03 03:19:50 +00:00
parent 9464131a0d
commit cdc6b08430
5 changed files with 64 additions and 9 deletions

View File

@@ -42,6 +42,8 @@ PREFIX_NO = 0
PREFIX_YES = 1
RESIDENCE_ADDR = 0
RESIDENCE_PLAC = 1
SOURCE_REFS_NO = 0
SOURCE_REFS_YES = 1
#-------------------------------------------------------------------------
#
@@ -60,6 +62,7 @@ class GedcomDescription:
self.cal = CALENDAR_YES
self.obje = OBJE_YES
self.resi = RESIDENCE_ADDR
self.source_refs = SOURCE_REFS_YES
self.gramps2tag_map = {}
self.tag2gramps_map = {}
self.prefix = PREFIX_YES
@@ -112,6 +115,12 @@ class GedcomDescription:
def get_resi(self):
return self.resi
def set_source_refs(self,val):
self.source_refs = val
def get_source_refs(self):
return self.source_refs
def add_tag_value(self,tag,value):
self.gramps2tag_map[value] = tag
self.tag2gramps_map[tag] = value
@@ -227,3 +236,6 @@ class GedInfoParser:
elif tag == "residence":
if attrs['val'] == 'place':
self.current.set_resi(RESIDENCE_PLAC)
elif tag == "source_refs":
if u2l(attrs['val']) == 'no':
self.current.set_source_refs(SOURCE_REFS_NO)