Remove marker argument of note.get().
Eliminate 'up' parameter of person_link(). * src/plugins/NarrativeWeb.py svn: r10294
This commit is contained in:
parent
2642641b84
commit
dfe4088d86
@ -230,7 +230,7 @@ class BasePage:
|
|||||||
self.up = False
|
self.up = False
|
||||||
|
|
||||||
# TODO. All of these attributes are not necessary, because we have
|
# TODO. All of these attributes are not necessary, because we have
|
||||||
# als the options in self.options. Besides, we need to check which
|
# also the options in self.options. Besides, we need to check which
|
||||||
# are still required.
|
# are still required.
|
||||||
self.inc_download = options['incdownload']
|
self.inc_download = options['incdownload']
|
||||||
self.html_dir = options['target']
|
self.html_dir = options['target']
|
||||||
@ -255,34 +255,13 @@ class BasePage:
|
|||||||
self.photo_list = photo_list
|
self.photo_list = photo_list
|
||||||
self.usegraph = options['graph']
|
self.usegraph = options['graph']
|
||||||
self.graphgens = options['graphgens']
|
self.graphgens = options['graphgens']
|
||||||
self.use_home = self.options['homenote'] != "" or \
|
self.use_home = options['homenote'] != "" or \
|
||||||
self.options['homeimg'] != ""
|
options['homeimg'] != ""
|
||||||
|
|
||||||
def store_file(self, archive, html_dir, from_path, to_path):
|
|
||||||
if archive:
|
|
||||||
archive.add(str(from_path), str(to_path))
|
|
||||||
else:
|
|
||||||
dest = os.path.join(html_dir, to_path)
|
|
||||||
dirname = os.path.dirname(dest)
|
|
||||||
if not os.path.isdir(dirname):
|
|
||||||
os.makedirs(dirname)
|
|
||||||
if from_path != dest:
|
|
||||||
shutil.copyfile(from_path, dest)
|
|
||||||
elif self.warn_dir:
|
|
||||||
WarningDialog(
|
|
||||||
_("Possible destination error") + "\n" +
|
|
||||||
_("You appear to have set your target directory "
|
|
||||||
"to a directory used for data storage. This "
|
|
||||||
"could create problems with file management. "
|
|
||||||
"It is recommended that you consider using "
|
|
||||||
"a different directory to store your generated "
|
|
||||||
"web pages."))
|
|
||||||
self.warn_dir = False
|
|
||||||
|
|
||||||
def copy_media(self, photo, store_ref=True):
|
def copy_media(self, photo, store_ref=True):
|
||||||
handle = photo.get_handle()
|
handle = photo.get_handle()
|
||||||
if store_ref:
|
if store_ref:
|
||||||
lnk = (self.cur_name, self.page_title, self.gid)
|
lnk = (self.cur_fname, self.page_title, self.gid)
|
||||||
if handle in self.photo_list:
|
if handle in self.photo_list:
|
||||||
if lnk not in self.photo_list[handle]:
|
if lnk not in self.photo_list[handle]:
|
||||||
self.photo_list[handle].append(lnk)
|
self.photo_list[handle].append(lnk)
|
||||||
@ -295,13 +274,13 @@ class BasePage:
|
|||||||
return (real_path, thumb_path)
|
return (real_path, thumb_path)
|
||||||
|
|
||||||
def create_file(self, name):
|
def create_file(self, name):
|
||||||
self.cur_name = name + self.ext
|
self.cur_fname = name + self.ext
|
||||||
if self.archive:
|
if self.archive:
|
||||||
self.string_io = StringIO()
|
self.string_io = StringIO()
|
||||||
of = codecs.EncodedFile(self.string_io, 'utf-8',
|
of = codecs.EncodedFile(self.string_io, 'utf-8',
|
||||||
self.encoding, 'xmlcharrefreplace')
|
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_fname)
|
||||||
of = codecs.EncodedFile(open(page_name, "w"), 'utf-8',
|
of = codecs.EncodedFile(open(page_name, "w"), 'utf-8',
|
||||||
self.encoding, 'xmlcharrefreplace')
|
self.encoding, 'xmlcharrefreplace')
|
||||||
return of
|
return of
|
||||||
@ -320,7 +299,7 @@ class BasePage:
|
|||||||
"""
|
"""
|
||||||
path = self.build_path(path, name, up)
|
path = self.build_path(path, name, up)
|
||||||
return path + '/' + name + self.ext
|
return path + '/' + name + self.ext
|
||||||
|
|
||||||
def link_path(self, path, name):
|
def link_path(self, path, name):
|
||||||
path = "%s/%s/%s" % (path, name[0].lower(), name[1].lower())
|
path = "%s/%s/%s" % (path, name[0].lower(), name[1].lower())
|
||||||
return path + '/' + name + self.ext
|
return path + '/' + name + self.ext
|
||||||
@ -331,7 +310,7 @@ class BasePage:
|
|||||||
for the first two directory levels. For example
|
for the first two directory levels. For example
|
||||||
0/2/02c0d8f888f566ae95ffbdca64274b51
|
0/2/02c0d8f888f566ae95ffbdca64274b51
|
||||||
"""
|
"""
|
||||||
self.cur_name = self.link_path(path, name)
|
self.cur_fname = self.link_path(path, name)
|
||||||
if self.archive:
|
if self.archive:
|
||||||
self.string_io = StringIO()
|
self.string_io = StringIO()
|
||||||
of = codecs.EncodedFile(self.string_io, 'utf-8',
|
of = codecs.EncodedFile(self.string_io, 'utf-8',
|
||||||
@ -348,7 +327,7 @@ class BasePage:
|
|||||||
|
|
||||||
def close_file(self, of):
|
def close_file(self, of):
|
||||||
if self.archive:
|
if self.archive:
|
||||||
tarinfo = tarfile.TarInfo(self.cur_name)
|
tarinfo = tarfile.TarInfo(self.cur_fname)
|
||||||
tarinfo.size = len(self.string_io.getvalue())
|
tarinfo.size = len(self.string_io.getvalue())
|
||||||
tarinfo.mtime = time.time()
|
tarinfo.mtime = time.time()
|
||||||
if os.sys.platform != "win32":
|
if os.sys.platform != "win32":
|
||||||
@ -359,7 +338,7 @@ class BasePage:
|
|||||||
of.close()
|
of.close()
|
||||||
else:
|
else:
|
||||||
of.close()
|
of.close()
|
||||||
self.cur_name = None
|
self.cur_fname = None
|
||||||
|
|
||||||
def lnkfmt(self, text):
|
def lnkfmt(self, text):
|
||||||
"""This creates an MD5 hex string to be used as filename."""
|
"""This creates an MD5 hex string to be used as filename."""
|
||||||
@ -372,7 +351,7 @@ class BasePage:
|
|||||||
note = db.get_note_from_gramps_id(self.footer)
|
note = db.get_note_from_gramps_id(self.footer)
|
||||||
of.write('\t<div id="user_footer">\n')
|
of.write('\t<div id="user_footer">\n')
|
||||||
of.write('\t\t<p>')
|
of.write('\t\t<p>')
|
||||||
of.write(note.get(markup=True))
|
of.write(note.get())
|
||||||
of.write('</p>\n')
|
of.write('</p>\n')
|
||||||
of.write('\t</div>\n')
|
of.write('\t</div>\n')
|
||||||
if self.copyright == 0:
|
if self.copyright == 0:
|
||||||
@ -460,7 +439,7 @@ class BasePage:
|
|||||||
if self.header:
|
if self.header:
|
||||||
note = db.get_note_from_gramps_id(self.header)
|
note = db.get_note_from_gramps_id(self.header)
|
||||||
of.write('\t<p id="user_header">')
|
of.write('\t<p id="user_header">')
|
||||||
of.write(note.get(markup=True))
|
of.write(note.get())
|
||||||
of.write('</p>\n')
|
of.write('</p>\n')
|
||||||
of.write('</div>\n\n')
|
of.write('</div>\n\n')
|
||||||
|
|
||||||
@ -483,7 +462,7 @@ class BasePage:
|
|||||||
|
|
||||||
# Define 'self.currentsection' to correctly set navlink item CSS id
|
# Define 'self.currentsection' to correctly set navlink item CSS id
|
||||||
# 'CurrentSection' for Navigation styling.
|
# 'CurrentSection' for Navigation styling.
|
||||||
# Use 'self.cur_name' to determine 'CurrentSection' for individual
|
# Use 'self.cur_fname' to determine 'CurrentSection' for individual
|
||||||
# elements for Navigation styling.
|
# elements for Navigation styling.
|
||||||
self.currentsection = title
|
self.currentsection = title
|
||||||
|
|
||||||
@ -507,33 +486,33 @@ class BasePage:
|
|||||||
# Because of how this script was originally written, the appropriate section
|
# Because of how this script was originally written, the appropriate section
|
||||||
# ID is determined by looking for a directory or HTML file name to associate
|
# ID is determined by looking for a directory or HTML file name to associate
|
||||||
# with that section.
|
# with that section.
|
||||||
if "index" in self.cur_name:
|
if "index" in self.cur_fname:
|
||||||
divid = "Home"
|
divid = "Home"
|
||||||
elif "introduction" in self.cur_name:
|
elif "introduction" in self.cur_fname:
|
||||||
divid = "Introduction"
|
divid = "Introduction"
|
||||||
elif "surnames" in self.cur_name:
|
elif "surnames" in self.cur_fname:
|
||||||
divid = "Surnames"
|
divid = "Surnames"
|
||||||
elif "srn" in self.cur_name:
|
elif "srn" in self.cur_fname:
|
||||||
divid = "SurnameDetail"
|
divid = "SurnameDetail"
|
||||||
elif "individuals" in self.cur_name:
|
elif "individuals" in self.cur_fname:
|
||||||
divid = "Individuals"
|
divid = "Individuals"
|
||||||
elif "ppl" in self.cur_name:
|
elif "ppl" in self.cur_fname:
|
||||||
divid = "IndividualDetail"
|
divid = "IndividualDetail"
|
||||||
elif "sources" in self.cur_name:
|
elif "sources" in self.cur_fname:
|
||||||
divid = "Sources"
|
divid = "Sources"
|
||||||
elif "src" in self.cur_name:
|
elif "src" in self.cur_fname:
|
||||||
divid = "SourceDetail"
|
divid = "SourceDetail"
|
||||||
elif "places" in self.cur_name:
|
elif "places" in self.cur_fname:
|
||||||
divid = "Places"
|
divid = "Places"
|
||||||
elif "plc" in self.cur_name:
|
elif "plc" in self.cur_fname:
|
||||||
divid = "PlaceDetail"
|
divid = "PlaceDetail"
|
||||||
elif "gallery" in self.cur_name:
|
elif "gallery" in self.cur_fname:
|
||||||
divid = "Gallery"
|
divid = "Gallery"
|
||||||
elif "img" in self.cur_name:
|
elif "img" in self.cur_fname:
|
||||||
divid = "GalleryDetail"
|
divid = "GalleryDetail"
|
||||||
elif "download" in self.cur_name:
|
elif "download" in self.cur_fname:
|
||||||
divid = "Download"
|
divid = "Download"
|
||||||
elif "contact" in self.cur_name:
|
elif "contact" in self.cur_fname:
|
||||||
divid = "Contact"
|
divid = "Contact"
|
||||||
else:
|
else:
|
||||||
divid = ''
|
divid = ''
|
||||||
@ -556,28 +535,27 @@ class BasePage:
|
|||||||
if self.currentsection == title:
|
if self.currentsection == title:
|
||||||
cs = True
|
cs = True
|
||||||
elif title == "Surnames":
|
elif title == "Surnames":
|
||||||
if "srn" in self.cur_name:
|
if "srn" in self.cur_fname:
|
||||||
cs = True
|
cs = True
|
||||||
elif "Surnames" in self.currentsection:
|
elif "Surnames" in self.currentsection:
|
||||||
cs = True
|
cs = True
|
||||||
elif title == "Individuals":
|
elif title == "Individuals":
|
||||||
if "ppl" in self.cur_name:
|
if "ppl" in self.cur_fname:
|
||||||
cs = True
|
cs = True
|
||||||
elif title == "Sources":
|
elif title == "Sources":
|
||||||
if "src" in self.cur_name:
|
if "src" in self.cur_fname:
|
||||||
cs = True
|
cs = True
|
||||||
elif title == "Places":
|
elif title == "Places":
|
||||||
if "plc" in self.cur_name:
|
if "plc" in self.cur_fname:
|
||||||
cs = True
|
cs = True
|
||||||
elif title == "Gallery":
|
elif title == "Gallery":
|
||||||
if "img" in self.cur_name:
|
if "img" in self.cur_fname:
|
||||||
cs = True
|
cs = True
|
||||||
|
|
||||||
cs = cs and ' id="CurrentSection"' or ''
|
cs = cs and ' id="CurrentSection"' or ''
|
||||||
of.write('\t\t<li%s><a href="%s%s">%s</a></li>\n' % (cs, lpath, self.ext, title))
|
of.write('\t\t<li%s><a href="%s%s">%s</a></li>\n' % (cs, lpath, self.ext, title))
|
||||||
|
|
||||||
def display_first_image_as_thumbnail( self, of, db, photolist=None):
|
def display_first_image_as_thumbnail( self, of, db, photolist=None):
|
||||||
|
|
||||||
if not photolist or not self.use_gallery:
|
if not photolist or not self.use_gallery:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -599,7 +577,7 @@ class BasePage:
|
|||||||
self.doc_link(of, photo_handle, descr, up=True)
|
self.doc_link(of, photo_handle, descr, up=True)
|
||||||
of.write('\t</div>\n\n')
|
of.write('\t</div>\n\n')
|
||||||
|
|
||||||
lnk = (self.cur_name, self.page_title, self.gid)
|
lnk = (self.cur_fname, self.page_title, self.gid)
|
||||||
if photo_handle in self.photo_list:
|
if photo_handle in self.photo_list:
|
||||||
if lnk not in self.photo_list[photo_handle]:
|
if lnk not in self.photo_list[photo_handle]:
|
||||||
self.photo_list[photo_handle].append(lnk)
|
self.photo_list[photo_handle].append(lnk)
|
||||||
@ -631,7 +609,7 @@ class BasePage:
|
|||||||
descr = " ".join(wrapper.wrap(title))
|
descr = " ".join(wrapper.wrap(title))
|
||||||
self.doc_link(of, photo_handle, descr, up=True)
|
self.doc_link(of, photo_handle, descr, up=True)
|
||||||
|
|
||||||
lnk = (self.cur_name, self.page_title, self.gid)
|
lnk = (self.cur_fname, self.page_title, self.gid)
|
||||||
if photo_handle in self.photo_list:
|
if photo_handle in self.photo_list:
|
||||||
if lnk not in self.photo_list[photo_handle]:
|
if lnk not in self.photo_list[photo_handle]:
|
||||||
self.photo_list[photo_handle].append(lnk)
|
self.photo_list[photo_handle].append(lnk)
|
||||||
@ -648,9 +626,9 @@ class BasePage:
|
|||||||
return
|
return
|
||||||
|
|
||||||
for notehandle in notelist:
|
for notehandle in notelist:
|
||||||
noteobj = db.get_note_from_handle(notehandle)
|
note = db.get_note_from_handle(notehandle)
|
||||||
format = noteobj.get_format()
|
format = note.get_format()
|
||||||
text = noteobj.get(markup=True)
|
text = note.get()
|
||||||
try:
|
try:
|
||||||
text = unicode(text)
|
text = unicode(text)
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
@ -692,9 +670,12 @@ class BasePage:
|
|||||||
of.write('\t\t</ol>\n')
|
of.write('\t\t</ol>\n')
|
||||||
of.write('\t</div>\n\n')
|
of.write('\t</div>\n\n')
|
||||||
|
|
||||||
|
# Probably only used in IndividualPage.display_ind_sources
|
||||||
|
# and MediaPage.display_media_sources
|
||||||
def display_source_refs(self, of, db, bibli):
|
def display_source_refs(self, of, db, bibli):
|
||||||
if bibli.get_citation_count() == 0:
|
if bibli.get_citation_count() == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
of.write('\t<div id="sourcerefs" class="subsection">\n')
|
of.write('\t<div id="sourcerefs" class="subsection">\n')
|
||||||
of.write('\t\t<h4>%s</h4>\n' % _('Source References'))
|
of.write('\t\t<h4>%s</h4>\n' % _('Source References'))
|
||||||
of.write('\t\t<ol>\n')
|
of.write('\t\t<ol>\n')
|
||||||
@ -704,9 +685,9 @@ class BasePage:
|
|||||||
cindex += 1
|
cindex += 1
|
||||||
# Add this source to the global list of sources to be displayed
|
# Add this source to the global list of sources to be displayed
|
||||||
# on each source page.
|
# on each source page.
|
||||||
lnk = (self.cur_name, self.page_title, self.gid)
|
lnk = (self.cur_fname, self.page_title, self.gid)
|
||||||
shandle = citation.get_source_handle()
|
shandle = citation.get_source_handle()
|
||||||
if self.src_list.has_key(shandle):
|
if shandle in self.src_list:
|
||||||
if lnk not in self.src_list[shandle]:
|
if lnk not in self.src_list[shandle]:
|
||||||
self.src_list[shandle].append(lnk)
|
self.src_list[shandle].append(lnk)
|
||||||
else:
|
else:
|
||||||
@ -734,7 +715,7 @@ class BasePage:
|
|||||||
notelist = sref.get_note_list()
|
notelist = sref.get_note_list()
|
||||||
for notehandle in notelist:
|
for notehandle in notelist:
|
||||||
note = db.get_note_from_handle(notehandle)
|
note = db.get_note_from_handle(notehandle)
|
||||||
tmp.append("%s: %s" % (_('Text'), note.get(True)))
|
tmp.append("%s: %s" % (_('Text'), note.get()))
|
||||||
if len(tmp) > 0:
|
if len(tmp) > 0:
|
||||||
of.write('\t\t\t\t\t<li><a name="sref%d%s">' % (cindex, key))
|
of.write('\t\t\t\t\t<li><a name="sref%d%s">' % (cindex, key))
|
||||||
of.write('; '.join(tmp))
|
of.write('; '.join(tmp))
|
||||||
@ -747,6 +728,7 @@ class BasePage:
|
|||||||
def display_references(self, of, db, handlelist):
|
def display_references(self, of, db, handlelist):
|
||||||
if not handlelist:
|
if not handlelist:
|
||||||
return
|
return
|
||||||
|
|
||||||
of.write('\t<div id="references" class="subsection">\n')
|
of.write('\t<div id="references" class="subsection">\n')
|
||||||
of.write('\t\t<h4>%s</h4>\n' % _('References'))
|
of.write('\t\t<h4>%s</h4>\n' % _('References'))
|
||||||
of.write('\t\t<ol>\n')
|
of.write('\t\t<ol>\n')
|
||||||
@ -758,16 +740,13 @@ class BasePage:
|
|||||||
index = 1
|
index = 1
|
||||||
for (path, name, gid) in sortlist:
|
for (path, name, gid) in sortlist:
|
||||||
of.write('\t\t\t<li>')
|
of.write('\t\t\t<li>')
|
||||||
self.person_link(of, path, name, gid)
|
self.person_link(of, "../../../" + path, name, gid)
|
||||||
of.write('</li>\n')
|
of.write('</li>\n')
|
||||||
index = index + 1
|
index = index + 1
|
||||||
of.write('\t\t</ol>\n')
|
of.write('\t\t</ol>\n')
|
||||||
of.write('\t</div>\n')
|
of.write('\t</div>\n')
|
||||||
|
|
||||||
def person_link(self, of, path, name, gid="", up=True):
|
def person_link(self, of, path, name, gid=""):
|
||||||
if up:
|
|
||||||
path = "../../../" + path
|
|
||||||
|
|
||||||
of.write('<a href="%s">%s' % (path, name))
|
of.write('<a href="%s">%s' % (path, name))
|
||||||
if not self.noid and gid != "":
|
if not self.noid and gid != "":
|
||||||
of.write(' <span class="grampsid">[%s]</span>' % gid)
|
of.write(' <span class="grampsid">[%s]</span>' % gid)
|
||||||
@ -895,7 +874,7 @@ class IndividualListPage(BasePage):
|
|||||||
of.write('\t\t\t<td class="ColumnName">')
|
of.write('\t\t\t<td class="ColumnName">')
|
||||||
fname = self.build_path_fname('ppl', person.handle)
|
fname = self.build_path_fname('ppl', person.handle)
|
||||||
self.person_link(of, fname,
|
self.person_link(of, fname,
|
||||||
_nd.display_given(person), person.gramps_id, False)
|
_nd.display_given(person), person.gramps_id)
|
||||||
of.write('</td>\n')
|
of.write('</td>\n')
|
||||||
|
|
||||||
# birth column
|
# birth column
|
||||||
@ -1024,7 +1003,7 @@ class SurnamePage(BasePage):
|
|||||||
fname = self.build_path_fname('ppl', person.handle, True)
|
fname = self.build_path_fname('ppl', person.handle, True)
|
||||||
self.person_link(of, fname,
|
self.person_link(of, fname,
|
||||||
person.get_primary_name().get_first_name(),
|
person.get_primary_name().get_first_name(),
|
||||||
person.gramps_id, False)
|
person.gramps_id)
|
||||||
of.write('</td>\n')
|
of.write('</td>\n')
|
||||||
|
|
||||||
# birth column
|
# birth column
|
||||||
@ -1576,7 +1555,7 @@ class IntroductionPage(BasePage):
|
|||||||
note_id = options['intronote']
|
note_id = options['intronote']
|
||||||
if note_id:
|
if note_id:
|
||||||
note_obj = db.get_note_from_gramps_id(note_id)
|
note_obj = db.get_note_from_gramps_id(note_id)
|
||||||
text = note_obj.get(markup=True)
|
text = note_obj.get()
|
||||||
if note_obj.get_format():
|
if note_obj.get_format():
|
||||||
of.write('\t<pre>\n%s\n' % text)
|
of.write('\t<pre>\n%s\n' % text)
|
||||||
of.write('\t</pre>\n')
|
of.write('\t</pre>\n')
|
||||||
@ -1623,7 +1602,7 @@ class HomePage(BasePage):
|
|||||||
note_id = options['homenote']
|
note_id = options['homenote']
|
||||||
if note_id:
|
if note_id:
|
||||||
note_obj = db.get_note_from_gramps_id(note_id)
|
note_obj = db.get_note_from_gramps_id(note_id)
|
||||||
text = note_obj.get(markup=True)
|
text = note_obj.get()
|
||||||
if note_obj.get_format():
|
if note_obj.get_format():
|
||||||
of.write('\t<pre>\n%s\n' % text)
|
of.write('\t<pre>\n%s\n' % text)
|
||||||
of.write('\t</pre>\n')
|
of.write('\t</pre>\n')
|
||||||
@ -1874,7 +1853,7 @@ class ContactPage(BasePage):
|
|||||||
note_id = options['contactnote']
|
note_id = options['contactnote']
|
||||||
if note_id:
|
if note_id:
|
||||||
note_obj = db.get_note_from_gramps_id(note_id)
|
note_obj = db.get_note_from_gramps_id(note_id)
|
||||||
text = note_obj.get(markup=True)
|
text = note_obj.get()
|
||||||
if note_obj.get_format():
|
if note_obj.get_format():
|
||||||
text = u"\t\t<pre>%s</pre>" % text
|
text = u"\t\t<pre>%s</pre>" % text
|
||||||
else:
|
else:
|
||||||
@ -1977,7 +1956,7 @@ class IndividualPage(BasePage):
|
|||||||
of.write('\t\t\t\t<div class="box">')
|
of.write('\t\t\t\t<div class="box">')
|
||||||
if person.handle in self.ind_list:
|
if person.handle in self.ind_list:
|
||||||
person_name = _nd.display(person)
|
person_name = _nd.display(person)
|
||||||
fname = self.build_path_fname('ppl', person.handle)
|
fname = self.build_path_fname('ppl', person.handle, True)
|
||||||
self.person_link(of, fname, person_name)
|
self.person_link(of, fname, person_name)
|
||||||
else:
|
else:
|
||||||
of.write(_nd.display(person))
|
of.write(_nd.display(person))
|
||||||
@ -2245,7 +2224,7 @@ class IndividualPage(BasePage):
|
|||||||
if child_handle in self.ind_list:
|
if child_handle in self.ind_list:
|
||||||
of.write("\t\t\t\t\t\t<li>")
|
of.write("\t\t\t\t\t\t<li>")
|
||||||
child_name = _nd.display(child)
|
child_name = _nd.display(child)
|
||||||
fname = self.build_path_fname('ppl', child_handle)
|
fname = self.build_path_fname('ppl', child_handle, True)
|
||||||
self.person_link(of, fname, child_name, gid)
|
self.person_link(of, fname, child_name, gid)
|
||||||
else:
|
else:
|
||||||
of.write("\t\t\t\t\t\t<li>")
|
of.write("\t\t\t\t\t\t<li>")
|
||||||
@ -2258,7 +2237,7 @@ class IndividualPage(BasePage):
|
|||||||
of.write('\t\t\t\t<td class="ColumnValue">')
|
of.write('\t\t\t\t<td class="ColumnValue">')
|
||||||
gid = person.gramps_id
|
gid = person.gramps_id
|
||||||
if handle in self.ind_list:
|
if handle in self.ind_list:
|
||||||
fname = self.build_path_fname('ppl', handle)
|
fname = self.build_path_fname('ppl', handle, True)
|
||||||
self.person_link(of, fname, _nd.display(person), gid)
|
self.person_link(of, fname, _nd.display(person), gid)
|
||||||
else:
|
else:
|
||||||
of.write(_nd.display(person))
|
of.write(_nd.display(person))
|
||||||
@ -2428,7 +2407,7 @@ class IndividualPage(BasePage):
|
|||||||
gid = spouse.get_gramps_id()
|
gid = spouse.get_gramps_id()
|
||||||
if spouse_id in self.ind_list:
|
if spouse_id in self.ind_list:
|
||||||
spouse_name = _nd.display(spouse)
|
spouse_name = _nd.display(spouse)
|
||||||
fname = self.build_path_fname('ppl', spouse.handle)
|
fname = self.build_path_fname('ppl', spouse.handle, True)
|
||||||
self.person_link(of, fname, spouse_name, gid)
|
self.person_link(of, fname, spouse_name, gid)
|
||||||
else:
|
else:
|
||||||
of.write(name)
|
of.write(name)
|
||||||
@ -2454,10 +2433,10 @@ class IndividualPage(BasePage):
|
|||||||
of.write('\t\t\t</tr>\n')
|
of.write('\t\t\t</tr>\n')
|
||||||
notelist = family.get_note_list()
|
notelist = family.get_note_list()
|
||||||
for notehandle in notelist:
|
for notehandle in notelist:
|
||||||
nobj = self.db.get_note_from_handle(notehandle)
|
note = self.db.get_note_from_handle(notehandle)
|
||||||
if nobj:
|
if note:
|
||||||
text = nobj.get(markup=True)
|
text = note.get()
|
||||||
format = nobj.get_format()
|
format = note.get_format()
|
||||||
if text:
|
if text:
|
||||||
of.write('\t\t\t<tr>\n')
|
of.write('\t\t\t<tr>\n')
|
||||||
of.write('\t\t\t\t<td class="ColumnType"> </td>\n')
|
of.write('\t\t\t\t<td class="ColumnType"> </td>\n')
|
||||||
@ -2473,10 +2452,9 @@ class IndividualPage(BasePage):
|
|||||||
of.write('\t\t\t</tr>\n')
|
of.write('\t\t\t</tr>\n')
|
||||||
|
|
||||||
def pedigree_person(self, of, person):
|
def pedigree_person(self, of, person):
|
||||||
person_link = person.handle in self.ind_list
|
|
||||||
person_name = _nd.display(person)
|
person_name = _nd.display(person)
|
||||||
if person_link:
|
if person.handle in self.ind_list:
|
||||||
fname = self.build_path_fname('ppl', person.handle)
|
fname = self.build_path_fname('ppl', person.handle, True)
|
||||||
self.person_link(of, fname, person_name)
|
self.person_link(of, fname, person_name)
|
||||||
else:
|
else:
|
||||||
of.write(person_name)
|
of.write(person_name)
|
||||||
@ -2504,7 +2482,7 @@ class IndividualPage(BasePage):
|
|||||||
of.write('</li>\n')
|
of.write('</li>\n')
|
||||||
|
|
||||||
def format_event(self, event, event_ref):
|
def format_event(self, event, event_ref):
|
||||||
lnk = (self.cur_name, self.page_title, self.gid)
|
lnk = (self.cur_fname, self.page_title, self.gid)
|
||||||
descr = event.get_description()
|
descr = event.get_description()
|
||||||
place_handle = event.get_place_handle()
|
place_handle = event.get_place_handle()
|
||||||
if place_handle:
|
if place_handle:
|
||||||
@ -2555,10 +2533,10 @@ class IndividualPage(BasePage):
|
|||||||
notelist = event.get_note_list()
|
notelist = event.get_note_list()
|
||||||
notelist.extend(event_ref.get_note_list())
|
notelist.extend(event_ref.get_note_list())
|
||||||
for notehandle in notelist:
|
for notehandle in notelist:
|
||||||
nobj = self.db.get_note_from_handle(notehandle)
|
note = self.db.get_note_from_handle(notehandle)
|
||||||
if nobj:
|
if note:
|
||||||
note_text = nobj.get(markup=True)
|
note_text = note.get()
|
||||||
format = nobj.get_format()
|
format = note.get_format()
|
||||||
if note_text:
|
if note_text:
|
||||||
if format:
|
if format:
|
||||||
text += u"<pre>%s</pre>" % note_text
|
text += u"<pre>%s</pre>" % note_text
|
||||||
@ -2570,7 +2548,7 @@ class IndividualPage(BasePage):
|
|||||||
|
|
||||||
def get_citation_links(self, source_ref_list):
|
def get_citation_links(self, source_ref_list):
|
||||||
gid_list = []
|
gid_list = []
|
||||||
lnk = (self.cur_name, self.page_title, self.gid)
|
lnk = (self.cur_fname, self.page_title, self.gid)
|
||||||
text = ""
|
text = ""
|
||||||
|
|
||||||
for sref in source_ref_list:
|
for sref in source_ref_list:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user