From 6cc8dfa7d8eb5338888c201efc810d59bebb71d7 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Mon, 24 Jul 2006 02:19:08 +0000 Subject: [PATCH] * src/plugins/NarrativeWeb.py: fix bug for no surname (bug #265) svn: r7064 --- gramps2/ChangeLog | 3 +++ gramps2/src/plugins/NarrativeWeb.py | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0bcda67b4..9a9b8ed88 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2006-07-23 Brian Matherly + * src/plugins/NarrativeWeb.py: fix bug for no surname (bug #265) + 2006-07-23 Manfred Paulus * src/BaseDoc.py: fix angle calculation * src/docgen/PSDrawDoc.py: fix angle calculation diff --git a/gramps2/src/plugins/NarrativeWeb.py b/gramps2/src/plugins/NarrativeWeb.py index cf068ab41..e157c7f61 100644 --- a/gramps2/src/plugins/NarrativeWeb.py +++ b/gramps2/src/plugins/NarrativeWeb.py @@ -2744,11 +2744,14 @@ def sort_people(db,handle_list): return sorted_lists def strcoll_case_sensitive(string1,string2): - """ This function was written because string comparisons in Windows + """ This function was written because string comparisons seem to be case insensitive if the string is longer than one character. """ - # First, compare the first character - diff = locale.strcoll(string1[0],string2[0]) + if len(string1) > 0 and len(string2) > 0: + diff = locale.strcoll(string1[0],string2[0]) + else: + diff = 0 + if diff == 0: # If the first character is the same, compare the rest diff = locale.strcoll(string1,string2)