From 760b3561f14ca73652af2742cbfef75dd3118703 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sat, 29 Jan 2005 06:05:51 +0000 Subject: [PATCH] * src/ArgHandler.py: Support for the native importer. * NEWS: Update. svn: r3986 --- ChangeLog | 3 +++ NEWS | 3 ++- src/ArgHandler.py | 13 +++++++++++-- src/ReadGrdb.py | 4 ---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a80cd248d..abbdf63c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ * src/DbPrompter.py: Support for the native importer. * src/Errors.py: Add HandleError exception for duplicate handles. + * src/ArgHandler.py: Support for the native importer. + * NEWS: Update. + 2005-01-26 Don Allingham * src/DbPrompter.py: gnome.vfs vs. gnomevfs, tolerence * src/GrampsMime.py: gnome.vfs vs. gnomevfs tolerence diff --git a/NEWS b/NEWS index c79aaa1bc..abc192dcb 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ -Version 1.1.4 -- the "" release +Version 1.1.4 -- the "Successful encyclopedia salesman" release +* Import from native GRDB format. * GnomePrint backend supports shadows for the boxes. * Bug fixes. diff --git a/src/ArgHandler.py b/src/ArgHandler.py index 2b4df36eb..1d748b2c4 100644 --- a/src/ArgHandler.py +++ b/src/ArgHandler.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2004 Donald N. Allingham +# Copyright (C) 2000-2005 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -318,6 +318,7 @@ class ArgHandler: print "Cleaning up." # remove import db after use + self.parent.db.close() os.remove(self.imp_db_path) print "Exiting." os._exit(0) @@ -341,7 +342,15 @@ class ArgHandler: Command-line import routine. Try to import filename using the format. Any errors will cause the os._exit(1) call. """ - if format == 'gedcom': + if format == 'grdb': + import ReadGrdb + filename = os.path.normpath(os.path.abspath(filename)) + try: + ReadGrdb.importData(self.parent.db,filename,None) + except: + print "Error importing %s" % filename + os._exit(1) + elif format == 'gedcom': import ReadGedcom filename = os.path.normpath(os.path.abspath(filename)) try: diff --git a/src/ReadGrdb.py b/src/ReadGrdb.py index 0ffdb5288..35071d429 100644 --- a/src/ReadGrdb.py +++ b/src/ReadGrdb.py @@ -48,12 +48,8 @@ import Errors def importData(database, filename, callback=None,cl=0,use_trans=True): filename = os.path.normpath(filename) - basefile = os.path.dirname(filename) - - change = os.path.getmtime(filename) other_database = GrampsBSDDB.GrampsBSDDB() - try: other_database.load(filename,callback) except: