* src/GrampsCfg.py: update RelLib display

* src/GrampsGconfKeys.py: import os
* src/RelLib.py: change _parser to parser and _display to display


svn: r3575
This commit is contained in:
Don Allingham 2004-09-26 03:08:53 +00:00
parent 7f94d0fb51
commit c218d7c4f0
5 changed files with 19 additions and 9 deletions

View File

@ -1,4 +1,8 @@
2004-09-25 Don Allingham <dallingham@users.sourceforge.net>
* 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

View File

@ -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.

View File

@ -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))
#-------------------------------------------------------------------------
#

View File

@ -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)

View File

@ -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):