From e9c1b1de8962810b2213f5ac60f6f54b55f0627e Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Tue, 14 Oct 2008 11:54:42 +0000 Subject: [PATCH] Remove GRDB export code. GRDB export is not supported. svn: r11144 --- po/POTFILES.in | 1 - src/GrampsDbUtils/Makefile.am | 1 - src/GrampsDbUtils/_GrampsDbWRFactories.py | 4 -- src/GrampsDbUtils/_WriteGrdb.py | 69 ------------------- src/GrampsDbUtils/__init__.py | 6 +- .../test/_GrampsDbWRFactories_test.py | 1 - test/GrampsDb/GrampsDbBase_Test.py | 14 ---- 7 files changed, 3 insertions(+), 93 deletions(-) delete mode 100644 src/GrampsDbUtils/_WriteGrdb.py diff --git a/po/POTFILES.in b/po/POTFILES.in index 8f031516c..93afe7581 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -211,7 +211,6 @@ src/GrampsDbUtils/importdbdir.py src/GrampsDbUtils/_ReadGedcom.py src/GrampsDbUtils/_ReadXML.py src/GrampsDbUtils/_WriteGedcom.py -src/GrampsDbUtils/_WriteGrdb.py src/GrampsDbUtils/_WriteXML.py src/GrampsDbUtils/__init__.py diff --git a/src/GrampsDbUtils/Makefile.am b/src/GrampsDbUtils/Makefile.am index b4e5055c0..a7ee6ae74 100644 --- a/src/GrampsDbUtils/Makefile.am +++ b/src/GrampsDbUtils/Makefile.am @@ -22,7 +22,6 @@ pkgdata_PYTHON = \ _ReadGedcom.py\ _ReadXML.py\ _WriteGedcom.py\ - _WriteGrdb.py\ _WriteXML.py pkgpyexecdir = @pkgpyexecdir@/GrampsDbUtils diff --git a/src/GrampsDbUtils/_GrampsDbWRFactories.py b/src/GrampsDbUtils/_GrampsDbWRFactories.py index 0de9e4578..6f3ed09d6 100644 --- a/src/GrampsDbUtils/_GrampsDbWRFactories.py +++ b/src/GrampsDbUtils/_GrampsDbWRFactories.py @@ -29,14 +29,10 @@ for a database backend. The app_* constants in const.py can be used to indicate which backend is required e.g.: -> # To get a XML writer -> GrampsDb.gramps_db_writer_factory(db_type = const.APP_GRAMPS_XML) > > # To get a Gedcom reader > GrampsDb.gramps_db_reader_factory(db_type = const.APP_GEDCOM) -As of 3.0 the writer_factory is deprecated. Exporter uses directly the plugin -system for export, no factory needed. """ import const diff --git a/src/GrampsDbUtils/_WriteGrdb.py b/src/GrampsDbUtils/_WriteGrdb.py deleted file mode 100644 index c26f323b1..000000000 --- a/src/GrampsDbUtils/_WriteGrdb.py +++ /dev/null @@ -1,69 +0,0 @@ -# -# Gramps - a GTK+/GNOME based genealogy program -# -# Copyright (C) 2005-2006 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# $Id:_WriteGrdb.py 9912 2008-01-22 09:17:46Z acraphae $ - -# Written by Alex Roitman - -#------------------------------------------------------------------------- -# -# Standard Python Modules -# -#------------------------------------------------------------------------- -import os -from gettext import gettext as _ - -#------------------------------------------------------------------------- -# -# Gramps Modules -# -#------------------------------------------------------------------------- -from GrampsDbUtils._GrampsBSDDB import GrampsBSDDB -from QuestionDialog import ErrorDialog -from gen.utils import db_copy - -#------------------------------------------------------------------------- -# -# Importing data into the currently open database. -# -#------------------------------------------------------------------------- -def cli_callback(val): - pass - -def exportData(database, filename, person=None, callback=None, cl=False): - - if callback is None: - callback = cli_callback - - filename = os.path.normpath(filename) - new_database = GrampsBSDDB() - try: - new_database.load(filename,callback) - except: - if cl: - print "Error: %s could not be opened. Exiting." % filename - else: - ErrorDialog(_("%s could not be opened") % filename) - return - - # copy all data from new_database to database - db_copy(database, new_database,callback) - - new_database.close() diff --git a/src/GrampsDbUtils/__init__.py b/src/GrampsDbUtils/__init__.py index 07a4396cc..ff30b7c15 100644 --- a/src/GrampsDbUtils/__init__.py +++ b/src/GrampsDbUtils/__init__.py @@ -29,9 +29,9 @@ depends on Gtk. A number of importers and exporters are provided to convert between the different backend formats. -To obtain a class that implements writers use the gramps_db_writer_factory -method and for readers use the gramps_db_reader_factory method. For information -on using these factories see the _GrampsDbUtilsFactories.py file comments. +To obtain a class that implements readers use the gramps_db_reader_factory +method. For information on using this factory see the +_GrampsDbUtilsFactories.py file comments. """ diff --git a/src/GrampsDbUtils/test/_GrampsDbWRFactories_test.py b/src/GrampsDbUtils/test/_GrampsDbWRFactories_test.py index 191ec149c..d692b5f77 100644 --- a/src/GrampsDbUtils/test/_GrampsDbWRFactories_test.py +++ b/src/GrampsDbUtils/test/_GrampsDbWRFactories_test.py @@ -17,7 +17,6 @@ class Test1(unittest.TestCase): self.assertTrue(par in sys.path, "par %r has to be in path!" % par) ilist = ( - "_WriteGrdb", "_WriteXML", "_WriteGedcom", "_ReadXML", diff --git a/test/GrampsDb/GrampsDbBase_Test.py b/test/GrampsDb/GrampsDbBase_Test.py index 9e1571cc4..785595dee 100644 --- a/test/GrampsDb/GrampsDbBase_Test.py +++ b/test/GrampsDb/GrampsDbBase_Test.py @@ -42,20 +42,6 @@ class FactoryTest(unittest.TestCase): self.assertRaises(GrampsDb.GrampsDbException, GrampsDb.gramps_db_factory, "gibberish") - def test_gramps_db_writer_factory(self): - """Test that gramps_db_writer_factory returns the correct method.""" - - md = GrampsDb.gramps_db_writer_factory(db_type = const.app_gramps) - assert callable(md), "Returned method is %s " % str(md) - - md = GrampsDb.gramps_db_writer_factory(db_type = const.app_gramps_xml) - assert callable(md), "Returned method is %s " % str(md) - - md = GrampsDb.gramps_db_writer_factory(db_type = const.app_gedcom) - assert callable(md), "Returned method is %s " % str(md) - - self.assertRaises(GrampsDb.GrampsDbException, GrampsDb.gramps_db_writer_factory, "gibberish") - def test_gramps_db_reader_factory(self): """Test that gramps_db_reader_factory returns the correct method."""