* 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 7f19d06b36
commit 3b7b70d606
4 changed files with 16 additions and 7 deletions

View File

@ -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 <dallingham@users.sourceforge.net>
* src/DbPrompter.py: gnome.vfs vs. gnomevfs, tolerence
* src/GrampsMime.py: gnome.vfs vs. gnomevfs tolerence

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.
* Bug fixes.

View File

@ -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:

View File

@ -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: