6767: WIP, allow opening of database without using filesystem
This commit is contained in:
parent
f4553d967f
commit
8bedb03d1d
@ -765,7 +765,10 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
||||
self.surname_list = self.get_surname_list()
|
||||
|
||||
self.set_save_path(directory)
|
||||
self.undolog = os.path.join(self._directory, DBUNDOFN)
|
||||
if self._directory:
|
||||
self.undolog = os.path.join(self._directory, DBUNDOFN)
|
||||
else:
|
||||
self.undolog = None
|
||||
self.undodb = DbGenericUndo(self, self.undolog)
|
||||
self.undodb.open()
|
||||
|
||||
|
@ -176,6 +176,7 @@ def import_as_dict(filename, user=None):
|
||||
if user is None:
|
||||
user = User()
|
||||
db = DictionaryDb()
|
||||
db.load(None)
|
||||
db.set_feature("skip-import-additions", True)
|
||||
dbstate = DbState()
|
||||
climanager = CLIManager(dbstate, setloader=False, user=user)
|
||||
|
@ -970,6 +970,7 @@ class DictionaryDb(DbGeneric):
|
||||
# Dictionary-specific load:
|
||||
from gramps.plugins.importer.importxml import importData
|
||||
from gramps.cli.user import User
|
||||
filename = os.path.join(self._directory, "data.gramps")
|
||||
if os.path.isfile(filename):
|
||||
importData(self, filename, User())
|
||||
if self._directory:
|
||||
filename = os.path.join(self._directory, "data.gramps")
|
||||
if os.path.isfile(filename):
|
||||
importData(self, filename, User())
|
||||
|
Loading…
Reference in New Issue
Block a user