* 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'


svn: r5147
This commit is contained in:
Martin Hawlisch 2005-08-30 15:00:34 +00:00
parent 15dd5945cf
commit 5a2cb0273e
3 changed files with 26 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2005-08-30 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* 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 <don@gramps-project.org> 2005-08-29 Don Allingham <don@gramps-project.org>
* src/GenericFilter.py: fixed "only one" filter rule, and matching * src/GenericFilter.py: fixed "only one" filter rule, and matching
the descendents of a filter the descendents of a filter

View File

@ -162,10 +162,10 @@ class BasePage:
self.cur_name = self.build_name("",name) self.cur_name = self.build_name("",name)
if self.archive: if self.archive:
self.string_io = StringIO() 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: else:
page_name = os.path.join(self.html_dir,self.cur_name) 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 return of
def link_path(self,name,path): def link_path(self,name,path):
@ -176,13 +176,13 @@ class BasePage:
self.cur_name = self.link_path(name,path) self.cur_name = self.link_path(name,path)
if self.archive: if self.archive:
self.string_io = StringIO() 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: else:
dirname = os.path.join(self.html_dir,path,name[0],name[1]) dirname = os.path.join(self.html_dir,path,name[0],name[1])
if not os.path.isdir(dirname): if not os.path.isdir(dirname):
os.makedirs(dirname) os.makedirs(dirname)
page_name = self.build_name(dirname,name) 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 return of
def close_file(self,of): def close_file(self,of):

View File

@ -191,6 +191,19 @@ class GeneWebWriter:
for family_handle in p.get_family_handle_list(): for family_handle in p.get_family_handle_list():
self.flist[family_handle] = 1 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): def cl_setup(self):
self.restrict = 0 self.restrict = 0
self.private = 0 self.private = 0
@ -561,7 +574,7 @@ class GeneWebWriter:
return retval return retval
def iso8859(self,s): def iso8859(self,s):
return s.encode('iso-8859-1','replace') return s.encode('iso-8859-1','xmlcharrefreplace')
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #