本文整理汇总了Python中gramps.gen.lib.Family.add_note方法的典型用法代码示例。如果您正苦于以下问题:Python Family.add_note方法的具体用法?Python Family.add_note怎么用?Python Family.add_note使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.lib.Family
的用法示例。
在下文中一共展示了Family.add_note方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gramps.gen.lib import Family [as 别名]
# 或者: from gramps.gen.lib.Family import add_note [as 别名]
#.........这里部分代码省略.........
if not birth:
birth = self.create_event(EventType.BIRTH)
birth_ref = EventRef()
birth_ref.set_reference_handle(birth.get_handle())
child.set_birth_ref(birth_ref)
birth.set_place_handle(self.current_child_birthplace_handle)
self.db.commit_event(birth,self.trans)
if self.current_child_source_handle:
child.add_citation(self.current_child_source_handle)
self.db.commit_person(child,self.trans)
else:
break
self.current_mode = None
return None
def read_children_birthplace_line(self,line,fields):
cbp = self.get_or_create_place(self.decode(fields[1]))
if cbp:
self.current_child_birthplace_handle = cbp.get_handle()
return None
def read_children_source_line(self,line,fields):
csrc = self.get_or_create_source(self.decode(fields[1]))
self.current_child_source_handle = csrc.handle
return None
def read_family_comment(self,line,fields):
if not self.current_family:
LOG.warning("Unknown family of child in line %d!" % self.lineno)
return None
n = Note()
n.set(line)
self.db.add_note(n,self.trans)
self.current_family.add_note(n.handle)
self.db.commit_family(self.current_family,self.trans)
return None
def _read_notes_lines(self, note_tag):
note_txt = ""
while True:
line = self.get_next_line()
if line is None:
break
fields = line.split(" ")
if fields[0] == "end" and fields[1] == note_tag:
break
elif fields[0] == "beg":
continue
else:
if note_txt:
note_txt = note_txt + "\n" + line
else:
note_txt = note_txt + line
if note_txt:
n = Note()
n.set(note_txt)
self.db.add_note(n,self.trans)
return n.handle
return None
def read_person_notes_lines(self,line,fields):
(idx,person) = self.parse_person(fields,1,None,None)
note_handle = self._read_notes_lines( fields[0])
if note_handle: