Remove is_empty database method
The existing get_total method can be used instead.
This commit is contained in:
parent
3e69fa5cbe
commit
61da801fa1
@ -316,7 +316,7 @@ class CLIManager:
|
|||||||
# database is empty, then copy default researcher to DB owner
|
# database is empty, then copy default researcher to DB owner
|
||||||
if (res.is_empty()
|
if (res.is_empty()
|
||||||
and not owner.is_empty()
|
and not owner.is_empty()
|
||||||
and self.dbstate.db.is_empty()):
|
and self.dbstate.db.get_total() == 0):
|
||||||
self.dbstate.db.set_researcher(owner)
|
self.dbstate.db.set_researcher(owner)
|
||||||
|
|
||||||
name_displayer.set_name_format(self.dbstate.db.name_formats)
|
name_displayer.set_name_format(self.dbstate.db.name_formats)
|
||||||
|
@ -721,15 +721,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def is_open(self):
|
def is_open(self):
|
||||||
return self.db_is_open
|
return self.db_is_open
|
||||||
|
|
||||||
def is_empty(self):
|
|
||||||
"""
|
|
||||||
Return true if there are no [primary] records in the database
|
|
||||||
"""
|
|
||||||
for table in self.get_table_func():
|
|
||||||
if len(self.get_table_func(table, "handles_func")()) > 0:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def get_dbid(self):
|
def get_dbid(self):
|
||||||
"""
|
"""
|
||||||
We use the file directory name as the unique ID for
|
We use the file directory name as the unique ID for
|
||||||
|
@ -1757,7 +1757,7 @@ class GedcomParser(UpdateCallback):
|
|||||||
self.number_of_errors = 0
|
self.number_of_errors = 0
|
||||||
self.maxpeople = stage_one.get_person_count()
|
self.maxpeople = stage_one.get_person_count()
|
||||||
self.dbase = dbase
|
self.dbase = dbase
|
||||||
self.import_researcher = self.dbase.is_empty()
|
self.import_researcher = self.dbase.get_total() == 0
|
||||||
self.emapper = IdFinder(dbase.get_gramps_ids(EVENT_KEY),
|
self.emapper = IdFinder(dbase.get_gramps_ids(EVENT_KEY),
|
||||||
dbase.event_prefix)
|
dbase.event_prefix)
|
||||||
self.famc_map = stage_one.get_famc_map()
|
self.famc_map = stage_one.get_famc_map()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user