From ddf7d2e27c341955d832ad4891a5f827fb4d2034 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sat, 19 Oct 2024 23:36:58 +0100 Subject: [PATCH] Make BaseObject the parent class for Date, StyledText and StyledTextTag --- gramps/gen/lib/date.py | 3 ++- gramps/gen/lib/styledtext.py | 3 ++- gramps/gen/lib/styledtexttag.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps/gen/lib/date.py b/gramps/gen/lib/date.py index e7e957c81b3..8905966792e 100644 --- a/gramps/gen/lib/date.py +++ b/gramps/gen/lib/date.py @@ -38,6 +38,7 @@ # Gramps modules # # ------------------------------------------------------------------------ +from .baseobj import BaseObject from ..config import config from ..const import GRAMPS_LOCALE as glocale from ..errors import DateError @@ -563,7 +564,7 @@ def _diff(self, date1, date2): # Date # # ------------------------------------------------------------------------- -class Date: +class Date(BaseObject): """ The core date handling class for Gramps. diff --git a/gramps/gen/lib/styledtext.py b/gramps/gen/lib/styledtext.py index c64ed768055..1c793115a16 100644 --- a/gramps/gen/lib/styledtext.py +++ b/gramps/gen/lib/styledtext.py @@ -35,6 +35,7 @@ # # ------------------------------------------------------------------------- from ..const import GRAMPS_LOCALE as glocale +from .baseobj import BaseObject from .styledtexttag import StyledTextTag _ = glocale.translation.gettext @@ -45,7 +46,7 @@ # StyledText # # ------------------------------------------------------------------------- -class StyledText: +class StyledText(BaseObject): """Helper class to enable character based text formatting. :py:class:`StyledText` is a wrapper class binding the clear text string and diff --git a/gramps/gen/lib/styledtexttag.py b/gramps/gen/lib/styledtexttag.py index dfe3c716f43..e1ee33396cc 100644 --- a/gramps/gen/lib/styledtexttag.py +++ b/gramps/gen/lib/styledtexttag.py @@ -28,6 +28,7 @@ # # ------------------------------------------------------------------------- from ..const import GRAMPS_LOCALE as glocale +from .baseobj import BaseObject from .styledtexttagtype import StyledTextTagType _ = glocale.translation.gettext @@ -38,7 +39,7 @@ # StyledTextTag # # ------------------------------------------------------------------------- -class StyledTextTag: +class StyledTextTag(BaseObject): """Hold formatting information for :py:class:`.StyledText`. :py:class:`StyledTextTag` is a container class, it's attributes are