def db_changed(self): if not self.dbstate.is_open(): return names = [] person = None for person in self.dbstate.db.iter_people(): lastname = person.get_primary_name().get_surname() if lastname not in names: names.append(lastname) names.sort() fill_combo(self.autocomp, names) if person: n = person.get_primary_name().get_surname() self.name.set_text(n) try: se_text = soundex(n) except UnicodeEncodeError: se_text = soundex("") self.value.set_text(se_text) else: self.name.set_text("")
def db_changed(self): if not self.dbstate.is_open(): return names = [] person = None for person in self.dbstate.db.iter_people(): lastname = person.get_primary_name().get_surname() if lastname not in names: names.append(lastname) names.sort() fill_combo(self.autocomp, names) if person: n = person.get_primary_name().get_surname() self.name.set_text(n) try: se_text = soundex(n) except UnicodeEncodeError: se_text = soundex('') self.value.set_text(se_text) else: self.name.set_text("")
def gen_key(self, val): if self.use_soundex: try: return soundex(val) except UnicodeEncodeError: return val else: return val
def by_family_soundex_key(self, handle): """Compare by family soundex.""" obj = self.query_method(handle) if obj.father_handle is not None: person = self.database.get_person_from_handle(obj.father_handle) elif obj.mother_handle is not None: person = self.database.get_person_from_handle(obj.mother_handle) return soundex(person.get_primary_name().get_surname())
def get_soundex(db_handle: DbReadBase, obj: GrampsObject, gramps_class_name: str) -> str: """Return soundex code.""" if gramps_class_name == "Family": if obj.father_handle is not None: person = db_handle.get_person_from_handle(obj.father_handle) elif obj.mother_handle is not None: person = db_handle.get_person_from_handle(obj.mother_handle) else: person = obj return soundex(person.get_primary_name().get_surname())
def on_apply_clicked(self, obj): try: se_text = soundex(str(obj.get_text())) except UnicodeEncodeError: se_text = soundex('') self.value.set_text(se_text)
def on_apply_clicked(self, obj): try: se_text = soundex(str(obj.get_text())) except UnicodeEncodeError: se_text = soundex("") self.value.set_text(se_text)
def by_person_soundex_key(self, handle): """Compare by soundex.""" obj = self.query_method(handle) return soundex(obj.get_primary_name().get_surname())