本文整理汇总了Python中gramps.gen.lib.Name.set_value方法的典型用法代码示例。如果您正苦于以下问题:Python Name.set_value方法的具体用法?Python Name.set_value怎么用?Python Name.set_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.lib.Name
的用法示例。
在下文中一共展示了Name.set_value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_person
# 需要导入模块: from gramps.gen.lib import Name [as 别名]
# 或者: from gramps.gen.lib.Name import set_value [as 别名]
#.........这里部分代码省略.........
birth_parsed = True
else:
LOG.debug("Death Date: %s" % field)
death_date = self.parse_date(self.decode(field))
if field == "mj":
death_cause = "Died joung"
elif field.startswith("k"):
death_cause = "Killed"
elif field.startswith("m"):
death_cause = "Murdered"
elif field.startswith("e"):
death_cause = "Executed"
elif field.startswith("d"):
death_cause = "Disappeared"
#TODO: Set special death types more properly
else:
LOG.warning(("parse_person(): Unknown field " +
"'%s' for person in line %d!") % (field, self.lineno))
if public_name:
name = person.get_primary_name()
name.set_type(NameType(NameType.BIRTH))
person.add_alternate_name(name)
name = Name()
name.set_type(NameType(NameType.AKA))
name.set_first_name(public_name)
surname_obj = name.get_primary_surname()
surname_obj.set_surname(surname)
person.set_primary_name(name)
for aka in nick_names:
name = Attribute()
name.set_type(AttributeType(AttributeType.NICKNAME))
name.set_value(aka)
person.add_attribute(name)
for aka in firstname_aliases:
name = Name()
name.set_type(NameType(NameType.AKA))
name.set_first_name(aka)
surname_obj = name.get_primary_surname()
surname_obj.set_surname(surname)
person.add_alternate_name(name)
for aka in name_aliases:
name = Name()
name.set_type(NameType(NameType.AKA))
name.set_first_name(aka)
surname_obj = name.get_primary_surname()
surname_obj.set_surname(surname)
person.add_alternate_name(name)
for aka in surname_aliases:
name = Name()
name.set_type(NameType(NameType.AKA))
if public_name:
name.set_first_name(public_name)
else:
name.set_first_name(firstname)
surname_obj = name.get_primary_surname()
surname_obj.set_surname(aka)
person.add_alternate_name(name)
if source:
person.add_citation(source.get_handle())