From f47f7b0d7f00c6a93dd8dcbd50353bf31dcdc4a2 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 13 Feb 2005 03:54:47 +0000 Subject: [PATCH] * src/plugins/NavWebPage.py: More enhancements * src/Sort.py: sort places by title svn: r4026 --- gramps2/ChangeLog | 4 + gramps2/src/Sort.py | 8 + gramps2/src/plugins/NavWebPage.py | 723 ++++++------------------------ 3 files changed, 152 insertions(+), 583 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 00901d475..803cb75e0 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2005-02-12 Don Allingham + * src/plugins/NavWebPage.py: More enhancements + * src/Sort.py: sort places by title + 2005-02-09 Don Allingham * src/plugins/NavWebpage.py: Build template pages for unused pages, add Surname List and Individual List pages. diff --git a/gramps2/src/Sort.py b/gramps2/src/Sort.py index 33996e13c..fc935c98b 100644 --- a/gramps2/src/Sort.py +++ b/gramps2/src/Sort.py @@ -105,3 +105,11 @@ class Sort: a = self.database.get_event_from_handle(a_id) b = self.database.get_event_from_handle(b_id) return cmp(a.get_date_object(),b.get_date_object()) + + def by_place_title(self,a_id,b_id): + """Sort routine for comparing two events by their dates. """ + if not (a_id and b_id): + return 0 + a = self.database.get_place_from_handle(a_id) + b = self.database.get_place_from_handle(b_id) + return cmp(a.title,b.title) diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 8bce05fe0..c9867c5d9 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -124,8 +124,8 @@ _css = [ class BasePage: - def __init__(self): - pass + def __init__(self,title): + self.title_str = title def lnkfmt(self,text): return text.replace(' ','%20') @@ -143,9 +143,8 @@ class BasePage: def display_header(self,ofile,title,author=""): ofile.write('\n') - ofile.write('\n') - ofile.write('\n') - ofile.write('My Family Tree\n') + ofile.write('\n\n') + ofile.write('%s\n' % self.title_str) ofile.write('\n') ofile.write('\n') ofile.write('