Database API: expore name, full_name, and brief_name
This commit is contained in:
parent
16c2843073
commit
1c05879f62
@ -404,6 +404,9 @@ class DictionaryDb(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
self.abort_possible = False
|
self.abort_possible = False
|
||||||
self._bm_changes = 0
|
self._bm_changes = 0
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
|
self.full_name = None
|
||||||
|
self.path = None
|
||||||
|
self.brief_name = None
|
||||||
if directory:
|
if directory:
|
||||||
self.load(directory)
|
self.load(directory)
|
||||||
|
|
||||||
@ -1671,6 +1674,9 @@ class DictionaryDb(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
from gramps.plugins.importer.importxml import importData
|
from gramps.plugins.importer.importxml import importData
|
||||||
from gramps.cli.user import User
|
from gramps.cli.user import User
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
|
self.full_name = os.path.abspath(self._directory)
|
||||||
|
self.path = self.full_name
|
||||||
|
self.brief_name = os.path.basename(self._directory)
|
||||||
filename = os.path.join(directory, "data.gramps")
|
filename = os.path.join(directory, "data.gramps")
|
||||||
if os.path.isfile(filename):
|
if os.path.isfile(filename):
|
||||||
importData(self, filename, User())
|
importData(self, filename, User())
|
||||||
@ -1690,6 +1696,9 @@ class DictionaryDb(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
|
|
||||||
def set_save_path(self, directory):
|
def set_save_path(self, directory):
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
|
self.full_name = os.path.abspath(self._directory)
|
||||||
|
self.path = self.full_name
|
||||||
|
self.brief_name = os.path.basename(self._directory)
|
||||||
|
|
||||||
def undo(self, update_history=True):
|
def undo(self, update_history=True):
|
||||||
pass
|
pass
|
||||||
|
@ -349,6 +349,9 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
self.abort_possible = False
|
self.abort_possible = False
|
||||||
self._bm_changes = 0
|
self._bm_changes = 0
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
|
self.full_name = None
|
||||||
|
self.path = None
|
||||||
|
self.brief_name = None
|
||||||
if directory:
|
if directory:
|
||||||
self.load(directory)
|
self.load(directory)
|
||||||
|
|
||||||
@ -358,6 +361,9 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
force_bsddb_downgrade=False,
|
force_bsddb_downgrade=False,
|
||||||
force_python_upgrade=False):
|
force_python_upgrade=False):
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
|
self.full_name = os.path.abspath(self._directory)
|
||||||
|
self.path = self.full_name
|
||||||
|
self.brief_name = os.path.basename(self._directory)
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
default_settings = {"__file__":
|
default_settings = {"__file__":
|
||||||
os.path.join(directory, "default_settings.py")}
|
os.path.join(directory, "default_settings.py")}
|
||||||
@ -1836,6 +1842,9 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
|
|
||||||
def set_save_path(self, directory):
|
def set_save_path(self, directory):
|
||||||
self._directory = directory
|
self._directory = directory
|
||||||
|
self.full_name = os.path.abspath(self._directory)
|
||||||
|
self.path = self.full_name
|
||||||
|
self.brief_name = os.path.basename(self._directory)
|
||||||
|
|
||||||
## Get types:
|
## Get types:
|
||||||
def get_event_attribute_types(self):
|
def get_event_attribute_types(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user