diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 3e479c423..8d46ba50e 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2005-08-30 Martin Hawlisch + * src/plugins/NavWebPage.py: Encode using 'xmlcharrefreplace' + * src/plugins/WriteGeneWeb.py: Remove empty families before running + the export. this gives now an error instead of writing an empty file; + Encode using 'xmlcharrefreplace' + 2005-08-29 Don Allingham * src/GenericFilter.py: fixed "only one" filter rule, and matching the descendents of a filter diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 8bb52583b..c974c6be1 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -162,10 +162,10 @@ class BasePage: self.cur_name = self.build_name("",name) if self.archive: self.string_io = StringIO() - of = codecs.EncodedFile(self.string_io,'utf-8',self.encoding) + of = codecs.EncodedFile(self.string_io,'utf-8',self.encoding,'xmlcharrefreplace') else: page_name = os.path.join(self.html_dir,self.cur_name) - of = codecs.EncodedFile(open(page_name, "w"),'utf-8',self.encoding) + of = codecs.EncodedFile(open(page_name, "w"),'utf-8',self.encoding,'xmlcharrefreplace') return of def link_path(self,name,path): @@ -176,13 +176,13 @@ class BasePage: self.cur_name = self.link_path(name,path) if self.archive: self.string_io = StringIO() - of = codecs.EncodedFile(self.string_io,'utf-8',self.encoding) + of = codecs.EncodedFile(self.string_io,'utf-8',self.encoding,'xmlcharrefreplace') else: dirname = os.path.join(self.html_dir,path,name[0],name[1]) if not os.path.isdir(dirname): os.makedirs(dirname) page_name = self.build_name(dirname,name) - of = codecs.EncodedFile(open(page_name, "w"),'utf-8',self.encoding) + of = codecs.EncodedFile(open(page_name, "w"),'utf-8',self.encoding,'xmlcharrefreplace') return of def close_file(self,of): diff --git a/gramps2/src/plugins/WriteGeneWeb.py b/gramps2/src/plugins/WriteGeneWeb.py index 66c2c66c1..202b05daf 100644 --- a/gramps2/src/plugins/WriteGeneWeb.py +++ b/gramps2/src/plugins/WriteGeneWeb.py @@ -190,7 +190,20 @@ class GeneWebWriter: p = self.db.get_person_from_handle(key) for family_handle in p.get_family_handle_list(): self.flist[family_handle] = 1 - + + # remove families that dont contain father AND mother + # because GeneWeb requires both to be present + templist = self.flist + self.flist = {} + for family_handle in templist: + family = self.db.get_family_from_handle(family_handle) + if family: + father_handle = family.get_father_handle() + mother_handle = family.get_mother_handle() + if father_handle and mother_handle: + self.flist[family_handle] = 1 + + def cl_setup(self): self.restrict = 0 self.private = 0 @@ -226,7 +239,7 @@ class GeneWebWriter: if len(self.flist) < 1: ErrorDialog(_("No families matched by selected filter")) return 0 - + for key in self.flist: self.write_family(key) self.writeln("") @@ -561,7 +574,7 @@ class GeneWebWriter: return retval def iso8859(self,s): - return s.encode('iso-8859-1','replace') + return s.encode('iso-8859-1','xmlcharrefreplace') #------------------------------------------------------------------------- #