Trees | Indices | Help |
|
---|
|
1 # 2 # Gramps - a GTK+/GNOME based genealogy program 3 # 4 # Copyright (C) 2000-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: datebase.py 10103 2008-02-24 13:55:55Z acraphae $ 22 23 """ 24 DateBase class for GRAMPS. 25 """ 26 27 #------------------------------------------------------------------------ 28 # 29 # Python modules 30 # 31 #------------------------------------------------------------------------ 32 from types import InstanceType 33 34 #------------------------------------------------------------------------- 35 # 36 # GRAMPS modules 37 # 38 #------------------------------------------------------------------------- 39 from gen.lib.date import Date 40 41 #------------------------------------------------------------------------- 42 # 43 # Base classes 44 # 45 #-------------------------------------------------------------------------47 """ 48 Base class for storing date information. 49 """ 5010252 """ 53 Create a new DateBase, copying from source if not None. 54 55 @param source: Object used to initialize the new object 56 @type source: DateBase 57 """ 58 if source: 59 self.date = Date(source.date) 60 else: 61 self.date = Date()6264 """ 65 Convert the object to a serialized tuple of data. 66 """ 67 if self.date == None or (self.date.is_empty() and not self.date.text): 68 date = None 69 else: 70 date = self.date.serialize(no_text_date) 71 return date7274 """ 75 Convert a serialized tuple of data to an object. 76 """ 77 if data == None: 78 self.date = Date() 79 else: 80 self.date = InstanceType(Date) 81 self.date.unserialize(data)8284 """ 85 Return the L{Date} object associated with the DateBase. 86 87 @return: Returns a DateBase L{Date} instance. 88 @rtype: L{Date} 89 """ 90 if not self.date: 91 self.date = Date() 92 return self.date93
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Mar 9 21:53:14 2008 | http://epydoc.sourceforge.net |