Skip to content

Commit 3cc4c95

Browse files
committed
Explictly return None from DummyDB.get_<object>_from_gramps_id
In future, this allows the return type hint of <object> | None for consistency with other db implementations
1 parent 39b5913 commit 3cc4c95

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gramps/gen/db/dummydb.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ def get_event_from_gramps_id(self, gramps_id):
373373
if not self.db_is_open:
374374
LOG.debug("database is closed")
375375
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
376+
return None
376377

377378
def get_event_from_handle(self, handle):
378379
"""
@@ -463,6 +464,7 @@ def get_family_from_gramps_id(self, gramps_id):
463464
if not self.db_is_open:
464465
LOG.debug("database is closed")
465466
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
467+
return None
466468

467469
def get_family_from_handle(self, handle):
468470
"""
@@ -604,6 +606,7 @@ def get_note_from_gramps_id(self, gramps_id):
604606
if not self.db_is_open:
605607
LOG.debug("database is closed")
606608
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
609+
return None
607610

608611
def get_note_from_handle(self, handle):
609612
"""
@@ -723,6 +726,7 @@ def get_media_from_gramps_id(self, gramps_id):
723726
if not self.db_is_open:
724727
LOG.debug("database is closed")
725728
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
729+
return None
726730

727731
def get_media_from_handle(self, handle):
728732
"""
@@ -769,6 +773,7 @@ def get_person_from_gramps_id(self, gramps_id):
769773
if not self.db_is_open:
770774
LOG.debug("database is closed")
771775
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
776+
return None
772777

773778
def get_person_from_handle(self, handle):
774779
"""
@@ -829,6 +834,7 @@ def get_place_from_gramps_id(self, gramps_id):
829834
if not self.db_is_open:
830835
LOG.debug("database is closed")
831836
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
837+
return None
832838

833839
def get_place_from_handle(self, handle):
834840
"""
@@ -970,6 +976,7 @@ def get_repository_from_gramps_id(self, gramps_id):
970976
if not self.db_is_open:
971977
LOG.debug("database is closed")
972978
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
979+
return None
973980

974981
def get_repository_from_handle(self, handle):
975982
"""
@@ -1040,6 +1047,7 @@ def get_source_from_gramps_id(self, gramps_id):
10401047
if not self.db_is_open:
10411048
LOG.debug("database is closed")
10421049
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
1050+
return None
10431051

10441052
def get_source_from_handle(self, handle):
10451053
"""
@@ -1100,6 +1108,7 @@ def get_citation_from_gramps_id(self, gramps_id):
11001108
if not self.db_is_open:
11011109
LOG.debug("database is closed")
11021110
LOG.warning("gramps_id %s does not exist in the dummy database", gramps_id)
1111+
return None
11031112

11041113
def get_citation_from_handle(self, handle):
11051114
"""

0 commit comments

Comments
 (0)