diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ecb335e99..252543698 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2007-01-22 Don Allingham + * src/ViewManager.py: import of gramps package + * src/ArgHandler.py: import of gramps package + * src/GrampsDb/_ReadGedcom.py: catch bad LDS ords + 2007-01-22 Martin Hawlisch * src/ArgHandler.py, * src/DbLoader.py: Print out more precise error messages when trying diff --git a/gramps2/src/ArgHandler.py b/gramps2/src/ArgHandler.py index b2eb9429a..377fadf12 100644 --- a/gramps2/src/ArgHandler.py +++ b/gramps2/src/ArgHandler.py @@ -326,7 +326,7 @@ class ArgHandler: os._exit(1) elif filetype == const.app_gramps_package: print "Type: GRAMPS package" - self.read_pkg(filename) + self.vm.import_pkg(filename) success = True else: print "Unknown file type: %s" % filetype @@ -754,9 +754,9 @@ class NewNativeDbPrompter: print Config.TRANSACTIONS self.state.db = GrampsDb.gramps_db_factory(const.app_gramps)( Config.TRANSACTIONS) - self.vm.read_file(filename) + self.vm.db_loader.read_file(filename, const.app_gramps) self.state.signal_change() - self.change_page(None, None) + #self.change_page(None, None) # Add the file to the recent items RecentFiles.recent_files(filename,const.app_gramps) return True diff --git a/gramps2/src/GrampsDb/_ReadGedcom.py b/gramps2/src/GrampsDb/_ReadGedcom.py index 73fb51408..2c29cf430 100644 --- a/gramps2/src/GrampsDb/_ReadGedcom.py +++ b/gramps2/src/GrampsDb/_ReadGedcom.py @@ -1328,8 +1328,9 @@ class GedcomParser(UpdateCallback): a.set_value(matches[2]) self.family.add_attribute(a) else: - func = self.family_func.get(matches[1], self.func_family_event) - func(self.family, matches, 2) + if matches[1] not in (TOKEN_ENDL, TOKEN_BAPL, TOKEN_CONL): + func = self.family_func.get(matches[1], self.func_family_event) + func(self.family, matches, 2) # handle addresses attached to families if self.addr != None: diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 13562bbc5..23017657b 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -859,6 +859,11 @@ class ViewManager: self.page_is_changing = False + def import_pkg(self, filename): + import ReadPkg + ReadPkg.impData(self.state.db, filename, self.uistate.pulse_progressbar) + self.post_load() + def import_data(self, obj): if self.state.db.db_is_open: self.db_loader.import_file()