2007-06-24 Alex Roitman <shura@gramps-project.org>

* src/NameDisplay.py (_gen_cooked_func,_gen_raw_func): Do not
	replace %% with anything.



svn: r8662
This commit is contained in:
Alex Roitman 2007-06-25 05:19:18 +00:00
parent e696e33b38
commit 270382d00c
2 changed files with 7 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2007-06-24 Alex Roitman <shura@gramps-project.org>
* src/NameDisplay.py (_gen_cooked_func,_gen_raw_func): Do not
replace %% with anything.
2007-06-24 Brian Matherly <brian@gramps-project.org> 2007-06-24 Brian Matherly <brian@gramps-project.org>
* src/plugins/BookReport.py (on_booklist_ok_clicked): Handle unicode names * src/plugins/BookReport.py (on_booklist_ok_clicked): Handle unicode names

View File

@ -271,7 +271,7 @@ class NameDisplay:
"%S":"raw_data[_SUFFIX].upper()", "%S":"raw_data[_SUFFIX].upper()",
"%Y":"raw_data[_PATRONYM].upper()", "%Y":"raw_data[_PATRONYM].upper()",
"%C":"raw_data[_CALL].upper()", "%C":"raw_data[_CALL].upper()",
"%%":"'%'"} }
new_fmt = format_str new_fmt = format_str
@ -292,13 +292,12 @@ class NameDisplay:
new_fmt = new_fmt.replace("%S","%s") new_fmt = new_fmt.replace("%S","%s")
new_fmt = new_fmt.replace("%Y","%s") new_fmt = new_fmt.replace("%Y","%s")
new_fmt = new_fmt.replace("%C","%s") new_fmt = new_fmt.replace("%C","%s")
new_fmt = new_fmt.replace("%%",'%')
# find each format flag in the original format string # find each format flag in the original format string
# for each one we find the variable name that is needed to # 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 # replace it and add this to a list. This list will be used
# generate the replacement tuple. # generate the replacement tuple.
pat = re.compile("%.") pat = re.compile('|'.join(d.keys()))
param = () param = ()
mat = pat.search(format_str) mat = pat.search(format_str)
@ -346,7 +345,7 @@ class NameDisplay:
"%S":"suffix.upper()", "%S":"suffix.upper()",
"%Y":"patronymic.upper()", "%Y":"patronymic.upper()",
"%C":"call.upper()", "%C":"call.upper()",
"%%":"'%'"} }
new_fmt = format_str new_fmt = format_str
@ -368,7 +367,6 @@ class NameDisplay:
new_fmt = new_fmt.replace("%S","%s") new_fmt = new_fmt.replace("%S","%s")
new_fmt = new_fmt.replace("%Y","%s") new_fmt = new_fmt.replace("%Y","%s")
new_fmt = new_fmt.replace("%C","%s") new_fmt = new_fmt.replace("%C","%s")
new_fmt = new_fmt.replace("%%",'%')
# find each format flag in the original format string # find each format flag in the original format string
# for each one we find the variable name that is needed to # for each one we find the variable name that is needed to