Implement stand-alone default DummyDb database including diagnostics
when used incorrectly
This commit is contained in:
parent
403f53cc57
commit
f7203b5cd2
@ -67,7 +67,7 @@ class DbState(Callback):
|
|||||||
just a place holder until a real DB is assigned.
|
just a place holder until a real DB is assigned.
|
||||||
"""
|
"""
|
||||||
Callback.__init__(self)
|
Callback.__init__(self)
|
||||||
self.db = self.make_database("inmemorydb")
|
self.db = self.make_database("dummydb")
|
||||||
self.db.load(None)
|
self.db.load(None)
|
||||||
self.db.db_is_open = False
|
self.db.db_is_open = False
|
||||||
self.open = False
|
self.open = False
|
||||||
@ -112,7 +112,7 @@ class DbState(Callback):
|
|||||||
"""
|
"""
|
||||||
self.emit('no-database', ())
|
self.emit('no-database', ())
|
||||||
self.db.close()
|
self.db.close()
|
||||||
self.db = self.make_database("inmemorydb")
|
self.db = self.make_database("dummydb")
|
||||||
self.db.load(None)
|
self.db.load(None)
|
||||||
self.db.db_is_open = False
|
self.db.db_is_open = False
|
||||||
self.open = False
|
self.open = False
|
||||||
|
33
gramps/plugins/database/dummydb.gpr.py
Normal file
33
gramps/plugins/database/dummydb.gpr.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#
|
||||||
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
|
#
|
||||||
|
# Copyright (C) 2016 Tim G L Lyons
|
||||||
|
#
|
||||||
|
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
register(DATABASE,
|
||||||
|
id = 'dummydb',
|
||||||
|
name = _("Dummy database"),
|
||||||
|
name_accell = _("Dummy Database"),
|
||||||
|
description = _("Dummy Database"),
|
||||||
|
version = '1.0.0',
|
||||||
|
gramps_target_version = "5.0",
|
||||||
|
status = STABLE,
|
||||||
|
fname = 'dummydb.py',
|
||||||
|
databaseclass = 'DummyDb',
|
||||||
|
authors=['Tim Lyons'],
|
||||||
|
authors_email=[""],
|
||||||
|
)
|
1715
gramps/plugins/database/dummydb.py
Normal file
1715
gramps/plugins/database/dummydb.py
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user