\n')
of.write('\t\t\t
' % (dirpath, handle, self.ext))
of.write('\n')
of.write('\t\t\t' % (dirpath, handle, self.ext))
of.write('\n')
def source_link(self, of, handle, name, gid="", up=False):
- dirpath = self.build_path(handle, 'src', up)
+ dirpath = self.build_path('src', handle, up)
of.write(' href="%s/%s%s">%s' % (dirpath, handle, self.ext, html_escape(name)))
if not self.noid and gid != "":
of.write(' [%s]' % gid)
of.write('')
def place_link(self, of, handle, name, gid="", up=False):
- dirpath = self.build_path(handle, 'plc', up)
+ dirpath = self.build_path('plc', handle, up)
of.write('
%s' % (dirpath, handle, self.ext, html_escape(name)))
if not self.noid and gid != "":
@@ -822,7 +822,7 @@ class BasePage:
of.write('')
def place_link_str(self, handle, name, gid="", up=False):
- dirpath = self.build_path(handle, 'plc', up)
+ dirpath = self.build_path('plc', handle, up)
retval = '
%s' % (dirpath, handle, self.ext, html_escape(name))
if not self.noid and gid != "":
@@ -890,8 +890,8 @@ class IndividualListPage(BasePage):
# firstname column
of.write('\t\t\t')
- path = self.build_path(person.handle, "ppl", False)
- self.person_link(of, self.build_name(path, person.handle),
+ fname = self.build_path_fname('ppl', person.handle)
+ self.person_link(of, fname,
_nd.display_given(person), person.gramps_id, False)
of.write(' | \n')
@@ -985,7 +985,7 @@ class SurnamePage(BasePage):
BasePage.__init__(self, title, options, archive, media_list, "")
- of = self.create_link_file(md5.new(title).hexdigest(), 'srn')
+ of = self.create_link_file('srn', self.lnkfmt(title))
self.display_header(of, db, title, get_researcher().get_name(), True)
msg = _("This page contains an index of all the individuals in the "
@@ -1017,8 +1017,8 @@ class SurnamePage(BasePage):
person = db.get_person_from_handle(person_handle)
of.write('\t\t
\n')
of.write('\t\t\t')
- path = self.build_path(person.handle, "ppl", True)
- self.person_link(of, self.build_name(path, person.handle),
+ fname = self.build_path_fname('ppl', person.handle, True)
+ self.person_link(of, fname,
person.get_primary_name().get_first_name(),
person.gramps_id, False)
of.write(' | \n')
@@ -1177,7 +1177,7 @@ class PlacePage(BasePage):
place = db.get_place_from_handle( place_handle)
BasePage.__init__(self, title, options, archive, media_list,
place.gramps_id)
- of = self.create_link_file(place.get_handle(), "plc")
+ of = self.create_link_file('plc', place.get_handle())
self.page_title = ReportUtils.place_name(db, place_handle)
self.display_header(of, db, "%s - %s" % (_('Places'), self.page_title), get_researcher().get_name(), up=True)
@@ -1245,7 +1245,7 @@ class MediaPage(BasePage):
(prev, next, page_number, total_pages) = info
photo = db.get_object_from_handle(handle)
BasePage.__init__(self, title, options, archive, media_list, photo.gramps_id)
- of = self.create_link_file(handle, "img")
+ of = self.create_link_file('img', handle)
self.db = db
self.src_list = src_list
@@ -1317,7 +1317,7 @@ class MediaPage(BasePage):
photo.get_path()),
thmb_path, 320):
try:
- path = "%s/%s.png" % (self.build_path(photo.handle, "preview"), photo.handle)
+ path = "%s/%s.png" % (self.build_path("preview", photo.handle), photo.handle)
self.store_file(archive, self.html_dir, thmb_path, path)
os.unlink(thmb_path)
except IOError:
@@ -1394,7 +1394,7 @@ class MediaPage(BasePage):
def copy_source_file(self, handle, photo):
ext = os.path.splitext(photo.get_path())[1]
- to_dir = self.build_path(handle, 'images')
+ to_dir = self.build_path('images', handle)
newpath = to_dir + "/" + handle + ext
fullpath = Utils.media_path_full(self.db, photo.get_path())
@@ -1415,7 +1415,7 @@ class MediaPage(BasePage):
return None
def copy_thumbnail(self, handle, photo):
- to_dir = self.build_path(handle, 'thumb')
+ to_dir = self.build_path('thumb', handle)
to_path = os.path.join(to_dir, handle+".png")
if photo.get_mime_type():
from_path = ThumbNails.get_thumbnail_path(Utils.media_path_full(
@@ -1702,7 +1702,7 @@ class SourcePage(BasePage):
source = db.get_source_from_handle( handle)
BasePage.__init__(self, title, options, archive, media_list,
source.gramps_id)
- of = self.create_link_file(source.get_handle(), "src")
+ of = self.create_link_file('src', source.get_handle())
self.page_title = source.get_title()
self.display_header(of, db, "%s - %s" % (_('Sources'), self.page_title),
get_researcher().get_name(), up=True)
@@ -1914,7 +1914,7 @@ class IndividualPage(BasePage):
self.sort_name = _nd.sorted(self.person)
self.name = _nd.sorted(self.person)
- of = self.create_link_file(person.handle, "ppl")
+ of = self.create_link_file('ppl', person.handle)
self.display_header(of, db, self.sort_name,
get_researcher().get_name(), up=True)
self.display_ind_general(of)
@@ -1975,8 +1975,7 @@ class IndividualPage(BasePage):
of.write('\t\t\t\t')
if person.handle in self.ind_list:
person_name = _nd.display(person)
- path = self.build_path(person.handle, "ppl", False)
- fname = self.build_name(path, person.handle)
+ fname = self.build_path_fname('ppl', person.handle)
self.person_link(of, fname, person_name)
else:
of.write(_nd.display(person))
@@ -2244,9 +2243,8 @@ class IndividualPage(BasePage):
if child_handle in self.ind_list:
of.write("\t\t\t\t\t\t
")
child_name = _nd.display(child)
- path = self.build_path(child_handle, "ppl", False)
- self.person_link(of, self.build_name(path, child_handle),
- child_name, gid)
+ fname = self.build_path_fname('ppl', child_handle)
+ self.person_link(of, fname, child_name, gid)
else:
of.write("\t\t\t\t\t\t")
of.write(_nd.display(child))
@@ -2256,12 +2254,10 @@ class IndividualPage(BasePage):
person = self.db.get_person_from_handle(handle)
of.write('\t\t\t\t%s | \n' % title)
of.write('\t\t\t\t')
- val = person.gramps_id
+ gid = person.gramps_id
if handle in self.ind_list:
- path = self.build_path(handle, "ppl", False)
- fname = self.build_name(path, handle)
- self.person_link(of, fname, _nd.display(person),
- val)
+ fname = self.build_path_fname('ppl', handle)
+ self.person_link(of, fname, _nd.display(person), gid)
else:
of.write(_nd.display(person))
if rel != gen.lib.ChildRefType.BIRTH:
@@ -2430,8 +2426,7 @@ class IndividualPage(BasePage):
gid = spouse.get_gramps_id()
if spouse_id in self.ind_list:
spouse_name = _nd.display(spouse)
- path = self.build_path(spouse.handle, "ppl", False)
- fname = self.build_name(path, spouse.handle)
+ fname = self.build_path_fname('ppl', spouse.handle)
self.person_link(of, fname, spouse_name, gid)
else:
of.write(name)
@@ -2479,8 +2474,7 @@ class IndividualPage(BasePage):
person_link = person.handle in self.ind_list
person_name = _nd.display(person)
if person_link:
- path = self.build_path(person.handle, "ppl", False)
- fname = self.build_name(path, person.handle)
+ fname = self.build_path_fname('ppl', person.handle)
self.person_link(of, fname, person_name)
else:
of.write(person_name)
|