diff --git a/ChangeLog b/ChangeLog index fbe0cb1a8..48ea4b9de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ 2004-09-25 Don Allingham + * src/DateDisplay.py: add set_format function + * src/GrampsCfg.py: update RelLib display + * src/GrampsGconfKeys.py: import os + * src/RelLib.py: change _parser to parser and _display to display * src/const.py.in: remove calendar directory * src/gramps_main.py: remove calendar directory * configure.in: remove calendar directory diff --git a/src/DateDisplay.py b/src/DateDisplay.py index b9e80c25d..792aa10fd 100644 --- a/src/DateDisplay.py +++ b/src/DateDisplay.py @@ -140,6 +140,9 @@ class DateDisplay: self._display_islamic, ] + def set_format(self,format): + self.format = format + def verify_format(self,format): """ Verifies that the format value is within the correct range. diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 98f33dad3..691c8a88f 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -118,6 +118,7 @@ def get_toolbar_style(): def set_calendar_date_format(): format_list = DateHandler.get_date_formats() DateHandler.set_format(GrampsGconfKeys.get_date_format(format_list)) + RelLib.display.set_format(GrampsGconfKeys.get_date_format(format_list)) #------------------------------------------------------------------------- # diff --git a/src/GrampsGconfKeys.py b/src/GrampsGconfKeys.py index 8c873a698..615f20626 100644 --- a/src/GrampsGconfKeys.py +++ b/src/GrampsGconfKeys.py @@ -37,6 +37,8 @@ except ImportError: gconf = gnome.gconf +import os + client = gconf.client_get_default() client.add_dir("/apps/gramps",gconf.CLIENT_PRELOAD_NONE) diff --git a/src/RelLib.py b/src/RelLib.py index 282b8abc7..7bfcbd713 100644 --- a/src/RelLib.py +++ b/src/RelLib.py @@ -67,8 +67,8 @@ CONF_VERY_LOW = 0 # Class definitions # #------------------------------------------------------------------------- -_display = DateHandler.create_display() -_parser = DateHandler.create_parser() +display = DateHandler.create_display() +parser = DateHandler.create_parser() #------------------------------------------------------------------------- # @@ -991,12 +991,12 @@ class Event(PrimaryObject,DataObj): def set_date(self, date) : """attempts to sets the date of the Event instance""" - self.date = _parser.parse(date) + self.date = parser.parse(date) def get_date(self) : """returns a string representation of the date of the Event instance""" if self.date: - return _display.display(self.date) + return display.display(self.date) return u"" def get_preferred_date(self) : @@ -1007,7 +1007,7 @@ class Event(PrimaryObject,DataObj): """returns a string representation of the date of the Event instance, enclosing the results in quotes if it is not a valid date""" if self.date: - return _display.quote_display(self.date) + return display.quote_display(self.date) return u"" def get_date_object(self): @@ -1408,12 +1408,12 @@ class LdsOrd(SourceNote): """attempts to sets the date of the ordinance""" if not self.date: self.date = Date.Date() - _parser.set_date(self.date,date) + parser.set_date(self.date,date) def get_date(self) : """returns a string representation of the date of the ordinance""" if self.date: - return _display.display(self.date) + return display.display(self.date) return u"" def get_date_object(self): @@ -1748,13 +1748,13 @@ class Address(DataObj): def set_date(self,text): """attempts to sets the date that the person lived at the address from the passed string""" - self.date = _parser.parse(text) + self.date = parser.parse(text) def get_date(self): """returns a string representation of the date that the person lived at the address""" if self.date: - return _display.display(self.date) + return display.display(self.date) return u"" def get_preferred_date(self):