diff --git a/ChangeLog b/ChangeLog index 459869669..a7efc8501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-02-18 Martin Hawlisch + * src/GrampsDbUtils/_GedcomParse.py: Work around some Tracebacks + 2007-02-16 Zsolt Foldvari * src/DisplayTabs/_NoteTab.py: accelerators replaced with key-press signal handler. diff --git a/src/GrampsDbUtils/_GedcomParse.py b/src/GrampsDbUtils/_GedcomParse.py index 5660c997d..16d1f8291 100644 --- a/src/GrampsDbUtils/_GedcomParse.py +++ b/src/GrampsDbUtils/_GedcomParse.py @@ -792,6 +792,12 @@ class GedcomParser(UpdateCallback): """ return self._find_from_handle(gramps_id, self.fid2id) + def find_object_handle(self, gramps_id): + """ + Returns the database handle associated with the media object's GRAMPS ID + """ + return self._find_from_handle(gramps_id, self.oid2id) + def find_or_create_person(self, gramps_id): """ Finds or creates a person based on the GRAMPS ID. If the ID is @@ -924,8 +930,12 @@ class GedcomParser(UpdateCallback): fullname = fullname.replace('\\', os.path.sep) tries.append(fullname) - if os.path.isfile(fullname): - return (1, fullname) + try: + if os.path.isfile(fullname): + return (1, fullname) + except UnicodeEncodeError: + # FIXME: problem possibly caused by umlaut/accented character in filename + return (0, tries) other = os.path.join(altpath, fullname) tries.append(other) if os.path.isfile(other): @@ -2718,7 +2728,14 @@ class GedcomParser(UpdateCallback): break else: func = func_map.get(line.token, self.func_event_undef) - func(line, event_ref, event, level+1) + if func.__name__ == "func_ignore": + # FIXME: in some cases the returned handler is func_ignore instead of func_event_ignore + # but those two require different arguments passed + state = GedcomUtils.CurrentState() + state.level = level + func(line, state) + else: + func(line, event_ref, event, level+1) def func_event_ignore(self, line, event_ref, event, level): self.skip_subordinate_levels(level)