Remove --databases command line option

This commit is contained in:
Nick Hall 2016-12-16 22:18:33 +00:00
parent 9a53fae5a0
commit 76cb80f17f
5 changed files with 0 additions and 69 deletions

View File

@ -77,7 +77,6 @@ Application options
-y, --yes Don't ask to confirm dangerous actions (non-GUI mode only)
-q, --quiet Suppress progress indication output (non-GUI mode only)
-v, --version Show versions
-b, --databases Show available database backends
""")
_USAGE = _("""
@ -154,7 +153,6 @@ class ArgParser:
-y, --yes Don't ask to confirm dangerous actions
-q, --quiet Suppress progress indication output
-v, --version Show versions
-b, --databases Show available database backends
-h, --help Display the help
--usage Display usage information
@ -325,23 +323,6 @@ class ArgParser:
repr(config.data[sect][setting])))
print()
sys.exit(0)
elif option in ['-b', '--databases']:
default = config.data["database"]["backend"]
pmgr = BasePluginManager.get_instance()
pmgr.reg_plugins(PLUGINS_DIR, self, None)
pmgr.reg_plugins(USER_PLUGINS, self, None, load_on_reg=True)
for plugin in pmgr.get_reg_databases():
pdata = pmgr.get_plugin(plugin.id)
mod = pmgr.load_plugin(pdata)
if mod:
database = getattr(mod, pdata.databaseclass)
summary = database.get_class_summary()
print("Database backend ID:",
pdata.id,
"(default)" if pdata.id == default else "")
for key in sorted(summary.keys()):
print(" ", _("%s:") % key, summary[key])
sys.exit(0)
elif option in ['-c', '--config']:
cfg_name = value
set_value = False

View File

@ -209,27 +209,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
Gramps database write access object.
"""
@classmethod
def get_class_summary(cls):
"""
Return a diction of information about this database.
"""
try:
import bsddb3 as bsddb
bsddb_str = bsddb.__version__
bsddb_db_str = str(bsddb.db.version()).replace(', ', '.')\
.replace('(', '').replace(')', '')
except:
bsddb_str = 'not found'
bsddb_db_str = 'not found'
summary = {
"DB-API version": "n/a",
"Database type": cls.__name__,
'Database version': bsddb_str,
'Database db version': bsddb_db_str
}
return summary
# Set up dictionary for callback signal handler
# ---------------------------------------------
# 1. Signals for primary objects

View File

@ -57,17 +57,6 @@ class DBAPI(DbGeneric):
"""
Database backends class for DB-API 2.0 databases
"""
@classmethod
def get_class_summary(cls):
"""
Return a diction of information about this database.
"""
summary = {
"DB-API version": "2.0",
"Database type": cls.__name__,
}
return summary
def get_schema_version(self, directory=None):
"""
Get the version of the schema that the database was created

View File

@ -29,14 +29,6 @@ class InMemoryDB(DBAPI):
"""
A DB-API 2.0 In-memory SQL database.
"""
@classmethod
def get_class_summary(cls):
summary = DBAPI.get_class_summary()
summary.update({
"Database location": "in memory",
})
return summary
def _initialize(self, directory):
"""
Create an in-memory sqlite database.

View File

@ -210,16 +210,6 @@ class DummyDb(M_A_M_B("NewBaseClass", (DbReadBase, Callback, object,), {})):
__signals__ = {}
@classmethod
def get_class_summary(cls):
"""
Return a diction of information about this database.
"""
summary = {
"Database type": cls.__name__,
}
return summary
def __init__(self):
"""
Create a new DummyDb instance.