From 768ce714f7aa3c06025b28e526b2d7bb35d1805e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 7 Feb 2006 03:07:31 +0000 Subject: [PATCH] * src/SourceView.py: fix source query dialog * src/ansel_utf8.py: fix unicode conversion * src/GrampsDb/_GrampsDbBase.py: fix surname detection * src/GrampsDb/_ReadGedcomp.py: fix note importation svn: r5893 --- ChangeLog | 4 ++++ src/GrampsDb/_GrampsDbBase.py | 2 +- src/GrampsDb/_ReadGedcom.py | 17 +++++++++++------ src/SourceView.py | 4 ++-- src/ansel_utf8.py | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 427133649..f5f73ba62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ 2006-02-06 Don Allingham + * src/SourceView.py: fix source query dialog + * src/ansel_utf8.py: fix unicode conversion + * src/GrampsDb/_GrampsDbBase.py: fix surname detection + * src/GrampsDb/_ReadGedcomp.py: fix note importation * src/EditFamily.py: Complete save operation, handle new family * src/EditMedia.py: Add file selector button * src/FamilyList.py: Save properly diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index 29577027b..a1d673a95 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -964,7 +964,7 @@ class GrampsDbBase(GrampsDBCallback): cursor = self.get_person_cursor() data = cursor.first() while data: - slist.append((data[1][3].sname,data[0])) + slist.append((data[1][3][3],data[0])) data = cursor.next() cursor.close() slist.sort() diff --git a/src/GrampsDb/_ReadGedcom.py b/src/GrampsDb/_ReadGedcom.py index 9a1b72c71..7a9fd90e1 100644 --- a/src/GrampsDb/_ReadGedcom.py +++ b/src/GrampsDb/_ReadGedcom.py @@ -396,22 +396,23 @@ class Reader: try: val = self.cnv(val) except: - val = line[2].translate(val,self.transtable2) + val = self.cnv(line[2].translate(val,self.transtable2)) try: level = int(line[0]) except: level = 0 - data = (level,tokens.get(line[1],TOKEN_UNKNOWN),val,line[1],self.index) - + data = (level,tokens.get(line[1],TOKEN_UNKNOWN),val, + self.cnv(line[1]),self.index) + if data[1] == TOKEN_CONT: l = self.current_list[0] self.current_list[0] = (l[0],l[1],l[2]+'\n'+data[2],l[3],l[4]) elif data[1] == TOKEN_CONC: l = self.current_list[0] if self.broken_conc: - new_value = "%s %s" % (l[2],data[2]) + new_value = u"%s %s" % (l[2],data[2]) else: new_value = l[2] + data[2] self.current_list[0] = (l[0],l[1],new_value,l[3],l[4]) @@ -1157,9 +1158,12 @@ class GedcomParser: return u"" else: if old_note: - note = "%s\n%s" % (old_note,matches[2]) + note = u"%s\n%s" % (old_note,matches[2]) else: note = matches[2] + if type(note) != unicode: + print type(note),type(matches[2]) + task(note) self.ignore_sub_junk(level+1) return note @@ -1180,6 +1184,7 @@ class GedcomParser: if int(matches[0]) < 1: self.backup() if state.get_text(): + print state state.person.set_note(state.get_text()) return else: @@ -2018,7 +2023,7 @@ class GedcomParser: self.parse_person_object(2,state) def func_person_note(self,matches,state): - self.note = self.parse_note(matches,self.person,1,state)#self.note) + self.note = self.parse_note(matches,self.person,1,state.note) def func_person_sex(self,matches,state): if matches[2] == '': diff --git a/src/SourceView.py b/src/SourceView.py index 64065ef1c..f84fc385b 100644 --- a/src/SourceView.py +++ b/src/SourceView.py @@ -130,8 +130,8 @@ class SourceView(PageView.ListView): event = db.get_event_from_handle(event_handle) - ans = EditSource.DelSourceQuery(event,db, - person_list,family_list) + ans = EditSource.DelSrcQuery(event,db, + person_list,family_list) if len(person_list) + len(family_list) > 0: msg = _('This source is currently being used. Deleting it ' diff --git a/src/ansel_utf8.py b/src/ansel_utf8.py index c2282d2ea..226122651 100644 --- a/src/ansel_utf8.py +++ b/src/ansel_utf8.py @@ -302,7 +302,7 @@ def ansel_to_utf8(s): head = s[0] s = s[1:] buff.write(head) - ans = buff.getvalue() + ans = unicode(buff.getvalue()) buff.close() return ans