8112: Common means nick, call, or otherwise first of given

This commit is contained in:
Doug Blank 2015-08-08 00:27:07 -04:00
parent dcb8efd8e6
commit 7fa9e647e5
2 changed files with 7 additions and 6 deletions

View File

@ -32,7 +32,7 @@ Specific symbols for parts of a name are defined:
'f' given (first names) 'f' given (first names)
'l' full surname (lastname) 'l' full surname (lastname)
'c' callname 'c' callname
'x' nick name if existing, otherwise first first name (common name) 'x' nick name, call, or otherwise first first name (common name)
'i' initials of the first names 'i' initials of the first names
'm' primary surname (main) 'm' primary surname (main)
'0m' primary surname prefix '0m' primary surname prefix
@ -567,7 +567,7 @@ class NameDisplay(object):
'f' : given = given (first names) 'f' : given = given (first names)
'l' : surname = full surname (lastname) 'l' : surname = full surname (lastname)
'c' : call = callname 'c' : call = callname
'x' : common = nick name if existing, otherwise first first name (common name) 'x' : common = nick name, call, otherwise first first name (common name)
'i' : initials = initials of the first names 'i' : initials = initials of the first names
'm' : primary = primary surname (main) 'm' : primary = primary surname (main)
'0m': primary[pre]= prefix primary surname (main) '0m': primary[pre]= prefix primary surname (main)
@ -601,7 +601,7 @@ class NameDisplay(object):
_("suffix")), _("suffix")),
"c": ("raw_data[_CALL]", "call", "c": ("raw_data[_CALL]", "call",
_("Name|call")), _("Name|call")),
"x": ("(raw_data[_NICK] or raw_data[_FIRSTNAME].split(' ')[0])", "x": ("(raw_data[_NICK] or raw_data[_CALL] or raw_data[_FIRSTNAME].split(' ')[0])",
"common", "common",
_("Name|common")), _("Name|common")),
"i": ("''.join([word[0] +'.' for word in ('. ' +" + "i": ("''.join([word[0] +'.' for word in ('. ' +" +
@ -668,7 +668,7 @@ class NameDisplay(object):
'f' : given = given (first names) 'f' : given = given (first names)
'l' : surname = full surname (lastname) 'l' : surname = full surname (lastname)
'c' : call = callname 'c' : call = callname
'x' : common = nick name if existing, otherwise first first name (common name) 'x' : common = nick name, call, or otherwise first first name (common name)
'i' : initials = initials of the first names 'i' : initials = initials of the first names
'm' : primary = primary surname (main) 'm' : primary = primary surname (main)
'0m': primary[pre]= prefix primary surname (main) '0m': primary[pre]= prefix primary surname (main)
@ -701,7 +701,7 @@ class NameDisplay(object):
_("suffix")), _("suffix")),
"c": ("call", "call", "c": ("call", "call",
_("Name|call")), _("Name|call")),
"x": ("(nick or first.split(' ')[0])", "common", "x": ("(nick or call or first.split(' ')[0])", "common",
_("Name|common")), _("Name|common")),
"i": ("''.join([word[0] +'.' for word in ('. ' + first).split()][1:])", "i": ("''.join([word[0] +'.' for word in ('. ' + first).split()][1:])",
"initials", "initials",
@ -770,7 +770,7 @@ class NameDisplay(object):
'%f' : given (first names) '%f' : given (first names)
'%l' : full surname (lastname) '%l' : full surname (lastname)
'%c' : callname '%c' : callname
'%x' : nick name if existing, otherwise first first name (common name) '%x' : nick name, call, or otherwise first first name (common name)
'%i' : initials of the first names '%i' : initials of the first names
'%m' : primary surname (main) '%m' : primary surname (main)
'%0m': prefix primary surname (main) '%0m': prefix primary surname (main)

View File

@ -436,6 +436,7 @@ class EditPerson(EditPrimary):
#make sure title updates automatically #make sure title updates automatically
for obj in [self.top.get_object("given_name"), for obj in [self.top.get_object("given_name"),
self.top.get_object("nickname"),
self.top.get_object("call"), self.top.get_object("call"),
self.top.get_object("suffix"), self.top.get_object("suffix"),
self.top.get_object("prefix"), self.top.get_object("prefix"),