From 0719e0485846bc9b3a16b4bd767655bd667094b6 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 3 Jul 2016 18:37:30 +0100 Subject: [PATCH] Update directory structure for database plugins --- gramps/plugins/{database => db}/__init__.py | 0 .../{database/bsddb_support => db/bsddb}/__init__.py | 0 .../plugins/{database/bsddb_support => db/bsddb}/backup.py | 0 gramps/plugins/{database => db/bsddb}/bsddb.gpr.py | 0 gramps/plugins/{database => db/bsddb}/bsddb.py | 2 +- .../{database/bsddb_support => db/bsddb}/bsddbtxn.py | 0 .../plugins/{database/bsddb_support => db/bsddb}/cursor.py | 0 .../plugins/{database/bsddb_support => db/bsddb}/read.py | 0 .../{database/bsddb_support => db/bsddb}/summary.py | 0 .../{database/bsddb_support => db/bsddb}/test/__init__.py | 0 .../bsddb_support => db/bsddb}/test/cursor_test.py | 0 .../{database/bsddb_support => db/bsddb}/test/db_test.py | 0 .../bsddb_support => db/bsddb}/test/grampsdbtestbase.py | 0 .../bsddb_support => db/bsddb}/test/reference_map_test.py | 0 .../{database/bsddb_support => db/bsddb}/undoredo.py | 0 .../{database/bsddb_support => db/bsddb}/upgrade.py | 0 .../plugins/{database/bsddb_support => db/bsddb}/write.py | 0 .../{database/dbapi_support => db/dbapi}/__init__.py | 0 gramps/plugins/{database => db/dbapi}/dbapi.gpr.py | 0 gramps/plugins/{database => db/dbapi}/dbapi.py | 7 +++---- gramps/plugins/{database => db/dbapi}/inmemorydb.gpr.py | 0 gramps/plugins/{database => db/dbapi}/inmemorydb.py | 4 ++-- .../plugins/{database/dbapi_support => db/dbapi}/mysql.py | 0 .../{database/dbapi_support => db/dbapi}/postgresql.py | 0 .../plugins/{database/dbapi_support => db/dbapi}/sqlite.py | 0 gramps/plugins/{database => db}/dummydb.gpr.py | 0 gramps/plugins/{database => db}/dummydb.py | 0 gramps/plugins/{database => db}/test/db_test.py | 0 28 files changed, 6 insertions(+), 7 deletions(-) rename gramps/plugins/{database => db}/__init__.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/__init__.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/backup.py (100%) rename gramps/plugins/{database => db/bsddb}/bsddb.gpr.py (100%) rename gramps/plugins/{database => db/bsddb}/bsddb.py (94%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/bsddbtxn.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/cursor.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/read.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/summary.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/test/__init__.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/test/cursor_test.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/test/db_test.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/test/grampsdbtestbase.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/test/reference_map_test.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/undoredo.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/upgrade.py (100%) rename gramps/plugins/{database/bsddb_support => db/bsddb}/write.py (100%) rename gramps/plugins/{database/dbapi_support => db/dbapi}/__init__.py (100%) rename gramps/plugins/{database => db/dbapi}/dbapi.gpr.py (100%) rename gramps/plugins/{database => db/dbapi}/dbapi.py (99%) rename gramps/plugins/{database => db/dbapi}/inmemorydb.gpr.py (100%) rename gramps/plugins/{database => db/dbapi}/inmemorydb.py (97%) rename gramps/plugins/{database/dbapi_support => db/dbapi}/mysql.py (100%) rename gramps/plugins/{database/dbapi_support => db/dbapi}/postgresql.py (100%) rename gramps/plugins/{database/dbapi_support => db/dbapi}/sqlite.py (100%) rename gramps/plugins/{database => db}/dummydb.gpr.py (100%) rename gramps/plugins/{database => db}/dummydb.py (100%) rename gramps/plugins/{database => db}/test/db_test.py (100%) diff --git a/gramps/plugins/database/__init__.py b/gramps/plugins/db/__init__.py similarity index 100% rename from gramps/plugins/database/__init__.py rename to gramps/plugins/db/__init__.py diff --git a/gramps/plugins/database/bsddb_support/__init__.py b/gramps/plugins/db/bsddb/__init__.py similarity index 100% rename from gramps/plugins/database/bsddb_support/__init__.py rename to gramps/plugins/db/bsddb/__init__.py diff --git a/gramps/plugins/database/bsddb_support/backup.py b/gramps/plugins/db/bsddb/backup.py similarity index 100% rename from gramps/plugins/database/bsddb_support/backup.py rename to gramps/plugins/db/bsddb/backup.py diff --git a/gramps/plugins/database/bsddb.gpr.py b/gramps/plugins/db/bsddb/bsddb.gpr.py similarity index 100% rename from gramps/plugins/database/bsddb.gpr.py rename to gramps/plugins/db/bsddb/bsddb.gpr.py diff --git a/gramps/plugins/database/bsddb.py b/gramps/plugins/db/bsddb/bsddb.py similarity index 94% rename from gramps/plugins/database/bsddb.py rename to gramps/plugins/db/bsddb/bsddb.py index 266f0a931..72dccda32 100644 --- a/gramps/plugins/database/bsddb.py +++ b/gramps/plugins/db/bsddb/bsddb.py @@ -19,5 +19,5 @@ # -from bsddb_support import DbBsddb +from gramps.plugins.db.bsddb import DbBsddb diff --git a/gramps/plugins/database/bsddb_support/bsddbtxn.py b/gramps/plugins/db/bsddb/bsddbtxn.py similarity index 100% rename from gramps/plugins/database/bsddb_support/bsddbtxn.py rename to gramps/plugins/db/bsddb/bsddbtxn.py diff --git a/gramps/plugins/database/bsddb_support/cursor.py b/gramps/plugins/db/bsddb/cursor.py similarity index 100% rename from gramps/plugins/database/bsddb_support/cursor.py rename to gramps/plugins/db/bsddb/cursor.py diff --git a/gramps/plugins/database/bsddb_support/read.py b/gramps/plugins/db/bsddb/read.py similarity index 100% rename from gramps/plugins/database/bsddb_support/read.py rename to gramps/plugins/db/bsddb/read.py diff --git a/gramps/plugins/database/bsddb_support/summary.py b/gramps/plugins/db/bsddb/summary.py similarity index 100% rename from gramps/plugins/database/bsddb_support/summary.py rename to gramps/plugins/db/bsddb/summary.py diff --git a/gramps/plugins/database/bsddb_support/test/__init__.py b/gramps/plugins/db/bsddb/test/__init__.py similarity index 100% rename from gramps/plugins/database/bsddb_support/test/__init__.py rename to gramps/plugins/db/bsddb/test/__init__.py diff --git a/gramps/plugins/database/bsddb_support/test/cursor_test.py b/gramps/plugins/db/bsddb/test/cursor_test.py similarity index 100% rename from gramps/plugins/database/bsddb_support/test/cursor_test.py rename to gramps/plugins/db/bsddb/test/cursor_test.py diff --git a/gramps/plugins/database/bsddb_support/test/db_test.py b/gramps/plugins/db/bsddb/test/db_test.py similarity index 100% rename from gramps/plugins/database/bsddb_support/test/db_test.py rename to gramps/plugins/db/bsddb/test/db_test.py diff --git a/gramps/plugins/database/bsddb_support/test/grampsdbtestbase.py b/gramps/plugins/db/bsddb/test/grampsdbtestbase.py similarity index 100% rename from gramps/plugins/database/bsddb_support/test/grampsdbtestbase.py rename to gramps/plugins/db/bsddb/test/grampsdbtestbase.py diff --git a/gramps/plugins/database/bsddb_support/test/reference_map_test.py b/gramps/plugins/db/bsddb/test/reference_map_test.py similarity index 100% rename from gramps/plugins/database/bsddb_support/test/reference_map_test.py rename to gramps/plugins/db/bsddb/test/reference_map_test.py diff --git a/gramps/plugins/database/bsddb_support/undoredo.py b/gramps/plugins/db/bsddb/undoredo.py similarity index 100% rename from gramps/plugins/database/bsddb_support/undoredo.py rename to gramps/plugins/db/bsddb/undoredo.py diff --git a/gramps/plugins/database/bsddb_support/upgrade.py b/gramps/plugins/db/bsddb/upgrade.py similarity index 100% rename from gramps/plugins/database/bsddb_support/upgrade.py rename to gramps/plugins/db/bsddb/upgrade.py diff --git a/gramps/plugins/database/bsddb_support/write.py b/gramps/plugins/db/bsddb/write.py similarity index 100% rename from gramps/plugins/database/bsddb_support/write.py rename to gramps/plugins/db/bsddb/write.py diff --git a/gramps/plugins/database/dbapi_support/__init__.py b/gramps/plugins/db/dbapi/__init__.py similarity index 100% rename from gramps/plugins/database/dbapi_support/__init__.py rename to gramps/plugins/db/dbapi/__init__.py diff --git a/gramps/plugins/database/dbapi.gpr.py b/gramps/plugins/db/dbapi/dbapi.gpr.py similarity index 100% rename from gramps/plugins/database/dbapi.gpr.py rename to gramps/plugins/db/dbapi/dbapi.gpr.py diff --git a/gramps/plugins/database/dbapi.py b/gramps/plugins/db/dbapi/dbapi.py similarity index 99% rename from gramps/plugins/database/dbapi.py rename to gramps/plugins/db/dbapi/dbapi.py index 739887ce4..7966d2d6e 100644 --- a/gramps/plugins/database/dbapi.py +++ b/gramps/plugins/db/dbapi/dbapi.py @@ -38,7 +38,6 @@ from html import escape #------------------------------------------------------------------------ from gramps.gen.db.generic import * from gramps.gen.db.dbconst import DBLOGNAME -import dbapi_support from gramps.gen.config import config from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext @@ -164,16 +163,16 @@ class DBAPI(DbGeneric): settings = self.__parse_settings(settings_file) if settings['dbtype'] == 'sqlite': - from dbapi_support.sqlite import Sqlite + from gramps.plugins.db.dbapi.sqlite import Sqlite path_to_db = os.path.join(directory, 'sqlite.db') self.dbapi = Sqlite(path_to_db) elif settings['dbtype'] == 'mysql': - from dbapi_support.mysql import MySQL + from gramps.plugins.db.dbapi.mysql import MySQL self.dbapi = MySQL(settings['host'], settings['user'], settings['password'], settings['dbname'], charset='utf8', use_unicode=True) elif settings['dbtype'] == 'postgres': - from dbapi_support.postgresql import Postgresql + from gramps.plugins.db.dbapi.postgresql import Postgresql self.dbapi = Postgresql(dbname=settings['dbname'], user=settings['user'], host=settings['host'], diff --git a/gramps/plugins/database/inmemorydb.gpr.py b/gramps/plugins/db/dbapi/inmemorydb.gpr.py similarity index 100% rename from gramps/plugins/database/inmemorydb.gpr.py rename to gramps/plugins/db/dbapi/inmemorydb.gpr.py diff --git a/gramps/plugins/database/inmemorydb.py b/gramps/plugins/db/dbapi/inmemorydb.py similarity index 97% rename from gramps/plugins/database/inmemorydb.py rename to gramps/plugins/db/dbapi/inmemorydb.py index 5af1967de..ec3490df1 100644 --- a/gramps/plugins/database/inmemorydb.py +++ b/gramps/plugins/db/dbapi/inmemorydb.py @@ -18,8 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -from dbapi import DBAPI -from dbapi_support.sqlite import Sqlite +from gramps.plugins.db.dbapi.dbapi import DBAPI +from gramps.plugins.db.dbapi.sqlite import Sqlite from gramps.gen.db.generic import DbGeneric, DBBACKEND, LOG import os import glob diff --git a/gramps/plugins/database/dbapi_support/mysql.py b/gramps/plugins/db/dbapi/mysql.py similarity index 100% rename from gramps/plugins/database/dbapi_support/mysql.py rename to gramps/plugins/db/dbapi/mysql.py diff --git a/gramps/plugins/database/dbapi_support/postgresql.py b/gramps/plugins/db/dbapi/postgresql.py similarity index 100% rename from gramps/plugins/database/dbapi_support/postgresql.py rename to gramps/plugins/db/dbapi/postgresql.py diff --git a/gramps/plugins/database/dbapi_support/sqlite.py b/gramps/plugins/db/dbapi/sqlite.py similarity index 100% rename from gramps/plugins/database/dbapi_support/sqlite.py rename to gramps/plugins/db/dbapi/sqlite.py diff --git a/gramps/plugins/database/dummydb.gpr.py b/gramps/plugins/db/dummydb.gpr.py similarity index 100% rename from gramps/plugins/database/dummydb.gpr.py rename to gramps/plugins/db/dummydb.gpr.py diff --git a/gramps/plugins/database/dummydb.py b/gramps/plugins/db/dummydb.py similarity index 100% rename from gramps/plugins/database/dummydb.py rename to gramps/plugins/db/dummydb.py diff --git a/gramps/plugins/database/test/db_test.py b/gramps/plugins/db/test/db_test.py similarity index 100% rename from gramps/plugins/database/test/db_test.py rename to gramps/plugins/db/test/db_test.py