From 270382d00c94cf069dffac6aec4302a1b061564f Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Mon, 25 Jun 2007 05:19:18 +0000 Subject: [PATCH] 2007-06-24 Alex Roitman * src/NameDisplay.py (_gen_cooked_func,_gen_raw_func): Do not replace %% with anything. svn: r8662 --- ChangeLog | 4 ++++ src/NameDisplay.py | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebbf02eec..06e6112a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-06-24 Alex Roitman + * src/NameDisplay.py (_gen_cooked_func,_gen_raw_func): Do not + replace %% with anything. + 2007-06-24 Brian Matherly * src/plugins/BookReport.py (on_booklist_ok_clicked): Handle unicode names diff --git a/src/NameDisplay.py b/src/NameDisplay.py index d8a528df3..5749efbe1 100644 --- a/src/NameDisplay.py +++ b/src/NameDisplay.py @@ -271,7 +271,7 @@ class NameDisplay: "%S":"raw_data[_SUFFIX].upper()", "%Y":"raw_data[_PATRONYM].upper()", "%C":"raw_data[_CALL].upper()", - "%%":"'%'"} + } new_fmt = format_str @@ -292,13 +292,12 @@ class NameDisplay: new_fmt = new_fmt.replace("%S","%s") new_fmt = new_fmt.replace("%Y","%s") new_fmt = new_fmt.replace("%C","%s") - new_fmt = new_fmt.replace("%%",'%') # find each format flag in the original format string # for each one we find the variable name that is needed to # replace it and add this to a list. This list will be used # generate the replacement tuple. - pat = re.compile("%.") + pat = re.compile('|'.join(d.keys())) param = () mat = pat.search(format_str) @@ -346,7 +345,7 @@ class NameDisplay: "%S":"suffix.upper()", "%Y":"patronymic.upper()", "%C":"call.upper()", - "%%":"'%'"} + } new_fmt = format_str @@ -368,7 +367,6 @@ class NameDisplay: new_fmt = new_fmt.replace("%S","%s") new_fmt = new_fmt.replace("%Y","%s") new_fmt = new_fmt.replace("%C","%s") - new_fmt = new_fmt.replace("%%",'%') # find each format flag in the original format string # for each one we find the variable name that is needed to