* src/ArgHandler.py: Support for the native importer.

* NEWS: Update.


svn: r3986
This commit is contained in:
Alex Roitman 2005-01-29 06:05:51 +00:00
parent f9dbedea4a
commit 760b3561f1
4 changed files with 16 additions and 7 deletions

View File

@ -4,6 +4,9 @@
* src/DbPrompter.py: Support for the native importer. * src/DbPrompter.py: Support for the native importer.
* src/Errors.py: Add HandleError exception for duplicate handles. * src/Errors.py: Add HandleError exception for duplicate handles.
* src/ArgHandler.py: Support for the native importer.
* NEWS: Update.
2005-01-26 Don Allingham <dallingham@users.sourceforge.net> 2005-01-26 Don Allingham <dallingham@users.sourceforge.net>
* src/DbPrompter.py: gnome.vfs vs. gnomevfs, tolerence * src/DbPrompter.py: gnome.vfs vs. gnomevfs, tolerence
* src/GrampsMime.py: gnome.vfs vs. gnomevfs tolerence * src/GrampsMime.py: gnome.vfs vs. gnomevfs tolerence

3
NEWS
View File

@ -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. * GnomePrint backend supports shadows for the boxes.
* Bug fixes. * Bug fixes.

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # 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 # 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 # it under the terms of the GNU General Public License as published by
@ -318,6 +318,7 @@ class ArgHandler:
print "Cleaning up." print "Cleaning up."
# remove import db after use # remove import db after use
self.parent.db.close()
os.remove(self.imp_db_path) os.remove(self.imp_db_path)
print "Exiting." print "Exiting."
os._exit(0) os._exit(0)
@ -341,7 +342,15 @@ class ArgHandler:
Command-line import routine. Try to import filename using the format. Command-line import routine. Try to import filename using the format.
Any errors will cause the os._exit(1) call. 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 import ReadGedcom
filename = os.path.normpath(os.path.abspath(filename)) filename = os.path.normpath(os.path.abspath(filename))
try: try:

View File

@ -48,12 +48,8 @@ import Errors
def importData(database, filename, callback=None,cl=0,use_trans=True): def importData(database, filename, callback=None,cl=0,use_trans=True):
filename = os.path.normpath(filename) filename = os.path.normpath(filename)
basefile = os.path.dirname(filename)
change = os.path.getmtime(filename)
other_database = GrampsBSDDB.GrampsBSDDB() other_database = GrampsBSDDB.GrampsBSDDB()
try: try:
other_database.load(filename,callback) other_database.load(filename,callback)
except: except: