Trees | Indices | Help |
|
---|
|
1 # 2 # Gramps - a GTK+/GNOME based genealogy program 3 # 4 # Copyright (C) 2004-2006 Donald N. Allingham 5 # 6 # This program is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; either version 2 of the License, or 9 # (at your option) any later version. 10 # 11 # This program is distributed in the hope that it will be useful, 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 # GNU General Public License for more details. 15 # 16 # You should have received a copy of the GNU General Public License 17 # along with this program; if not, write to the Free Software 18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 # 20 21 # $Id: _DateUtils.py 10094 2008-02-22 10:50:06Z acraphae $ 22 23 """ 24 Class handling language-specific selection for date parser and displayer. 25 """ 26 27 #------------------------------------------------------------------------- 28 # 29 # GRAMPS modules 30 # 31 #------------------------------------------------------------------------- 32 from DateHandler import LANG_TO_DISPLAY, LANG, parser, displayer 33 34 #-------------------------------------------------------------- 35 # 36 # Convenience functions 37 # 38 #--------------------------------------------------------------40 """ 41 Return the lists supported formats for date parsers and displayers. 42 """ 43 try: 44 return LANG_TO_DISPLAY[LANG].formats 45 except: 46 return LANG_TO_DISPLAY["C"].formats47 5355 """ 56 Set the date of the DateBase instance. 57 58 The date is parsed into a Date instance. 59 60 @param date_base: The DateBase instance to set the date to. 61 @type date_base: DateBase 62 @param text: The text to use for the text string in date 63 @type text: str 64 65 """ 66 parser.set_date(date_base.get_date_object(), text)6769 """ 70 Return a string representation of the date of the DateBase instance. 71 72 This representation is based off the default date display format 73 determined by the locale's DateDisplay instance. 74 @return: Returns a string representing the DateBase date 75 @rtype: str 76 77 """ 78 return displayer.display(date_base.get_date_object())7981 """ 82 Return a string representation of the date of the DateBase instance. 83 84 This representation is based off the default date display format 85 determined by the locale's DateDisplay instance. The date is 86 enclosed in quotes if the Date is not a valid date. 87 88 @return: Returns a string representing the DateBase date 89 @rtype: str 90 91 """ 92 return displayer.quote_display(date_base.get_date_object())93
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Mar 9 21:53:20 2008 | http://epydoc.sourceforge.net |