From e63996d08f786993b1f67da07c6cb838c8bd8ec4 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Fri, 17 Apr 2009 13:32:41 +0000 Subject: [PATCH] ExportFtree: simplify get_name function svn: r12461 --- src/plugins/export/ExportFtree.py | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/plugins/export/ExportFtree.py b/src/plugins/export/ExportFtree.py index fbf8116af..19a558f7c 100644 --- a/src/plugins/export/ExportFtree.py +++ b/src/plugins/export/ExportFtree.py @@ -292,25 +292,14 @@ def fdate(val): def get_name(name, count): """returns a name string built from the components of the Name instance, in the form of Firstname Surname""" - if count == -1: - val = "" - else: - val = str(count) - - if (name.suffix == ""): - if name.prefix: - return "%s %s %s%s" % (name.first_name, name.prefix, - name.surname, val) - else: - return "%s %s%s" % (name.first_name, name.surname, val) - else: - if name.prefix: - return "%s %s %s%s, %s" % (name.first_name, name.prefix, - name.surname, val, name.suffix) - else: - return "%s %s%s, %s" % (name.first_name, - name.surname, val, name.suffix) - + + return = (name.first_name + ' ' + + (name.prefix + ' ' if name.prefix else '') + + name.surname + + (str(count) if count != -1 else '') + + (', ' +name.suffix if name.suffix else '') + ) + #------------------------------------------------------------------------ # # Register with the plugin system