diff --git a/example/gramps/data.gramps b/example/gramps/data.gramps
index 773b7b992..5bd977f4a 100644
Binary files a/example/gramps/data.gramps and b/example/gramps/data.gramps differ
diff --git a/src/GedcomInfo.py b/src/GedcomInfo.py
index 9b9a3cb4c..d4ac9e68a 100644
--- a/src/GedcomInfo.py
+++ b/src/GedcomInfo.py
@@ -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)
diff --git a/src/data/gedcom.xml b/src/data/gedcom.xml
index 1f55efb03..2fc1d15a9 100644
--- a/src/data/gedcom.xml
+++ b/src/data/gedcom.xml
@@ -11,6 +11,7 @@
+
@@ -23,6 +24,7 @@
+
@@ -38,6 +40,7 @@
+
@@ -51,6 +54,7 @@
+
@@ -63,6 +67,7 @@
+
@@ -75,6 +80,7 @@
+
@@ -87,6 +93,7 @@
+
@@ -99,6 +106,7 @@
+
@@ -111,6 +119,7 @@
+
@@ -123,6 +132,7 @@
+
diff --git a/src/plugins/WebPage.py b/src/plugins/WebPage.py
index 853cba352..d85d2d9b3 100644
--- a/src/plugins/WebPage.py
+++ b/src/plugins/WebPage.py
@@ -259,8 +259,10 @@ class IndividualPage:
if self.person.getGender() == Person.male:
self.write_normal_row("%s:" % _("Gender"), _("Male"),None)
- else:
+ elif self.person.getGender() == Person.female:
self.write_normal_row("%s:" % _("Gender"), _("Female"),None)
+ else:
+ self.write_normal_row("%s:" % _("Gender"), _("Unknown"),None)
family = self.person.getMainParents()
if family:
diff --git a/src/plugins/WriteGedcom.py b/src/plugins/WriteGedcom.py
index 05403e775..91d06c803 100644
--- a/src/plugins/WriteGedcom.py
+++ b/src/plugins/WriteGedcom.py
@@ -412,6 +412,7 @@ class GedcomWriter:
self.obje = self.target_ged.get_obje()
self.resi = self.target_ged.get_resi()
self.prefix = self.target_ged.get_prefix()
+ self.source_refs = self.target_ged.get_source_refs()
if self.topDialog.get_widget("ansel").get_active():
self.cnvtxt = latin_to_ansel
@@ -533,7 +534,10 @@ class GedcomWriter:
self.pbar.set_fraction(1.0)
self.write_families()
- self.write_sources()
+ if self.source_refs:
+ self.write_sources()
+ else:
+ self.sbar.set_value(100.0)
self.g.write("0 TRLR\n")
self.g.close()
@@ -945,17 +949,44 @@ class GedcomWriter:
def write_source_ref(self,level,ref):
if ref.getBase() == None:
return
+
self.g.write("%d SOUR @%s@\n" % (level,self.sid(ref.getBase().getId())))
if ref.getPage():
self.g.write("%d PAGE %s\n" % (level+1,ref.getPage()))
- ref_text = ref.getText()
- if ref_text or not ref.getDate().isEmpty():
- self.g.write('%d DATA\n' % (level+1))
- if ref_text:
- self.write_long_text("TEXT",level+2,ref_text)
- pfx = "%d DATE" % (level+2)
- self.print_date(pfx,ref.getDate())
+ if self.source_refs:
+ self.g.write("%d SOUR @%s@\n" %
+ (level,self.sid(ref.getBase().getId())))
+ if ref.getPage() != "":
+ self.g.write("%d PAGE %s\n" % (level+1,ref.getPage()))
+
+ ref_text = ref.getText()
+ if ref_text != "" or not ref.getDate().isEmpty():
+ self.g.write('%d DATA\n' % (level+1))
+ if ref_text != "":
+ self.write_long_text("TEXT",level+2,ref_text)
+ pfx = "%d DATE" % (level+2)
+ self.print_date(pfx,ref.getDate())
+ else:
+ # We put title, page, and date on the SOUR line.
+ # Not using CONC because GeneWeb does not support this.
+ # TEXT and NOTE will be ignored by GeneWeb, but we can't
+ # output paragaphs in SOUR if we don't use CONC.
+ sbase = ref.getBase()
+ if sbase and sbase.getTitle():
+ txt = sbase.getTitle() + ". "
+ else:
+ txt = ""
+ if ref.getPage():
+ txt = txt + ref.getPage() + ". "
+ self.g.write("%d SOUR %s" % (level,self.cnvtxt(txt)))
+ if not ref.getDate().isEmpty():
+ self.print_date("", ref.getDate())
+ else:
+ self.g.write("\n")
+ if ref.getText():
+ self.write_long_text("TEXT",level+1,ref_text)
+
if ref.getComments():
self.write_long_text("NOTE",level+1,ref.getComments())