Package gen :: Package lib :: Module placebase
[frames] | no frames]

Source Code for Module gen.lib.placebase

 1  # 
 2  # Gramps - a GTK+/GNOME based genealogy program 
 3  # 
 4  # Copyright (C) 2000-2005  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: placebase.py 10103 2008-02-24 13:55:55Z acraphae $ 
22   
23  """ 
24  PlaceBase class for GRAMPS. 
25  """ 
26   
27  #------------------------------------------------------------------------- 
28  # 
29  # PlaceBase class 
30  # 
31  #------------------------------------------------------------------------- 
32 -class PlaceBase:
33 """ 34 Base class for place-aware objects. 35 """
36 - def __init__(self, source=None):
37 """ 38 Initialize a PlaceBase. 39 40 If the source is not None, then object is initialized from values of 41 the source object. 42 43 @param source: Object used to initialize the new object 44 @type source: PlaceBase 45 """ 46 if source: 47 self.place = source.place 48 else: 49 self.place = ""
50
51 - def set_place_handle(self, place_handle):
52 """ 53 Set the database handle for L{Place} associated with the object. 54 55 @param place_handle: L{Place} database handle 56 @type place_handle: str 57 """ 58 self.place = place_handle
59
60 - def get_place_handle(self):
61 """ 62 Return the database handle of the L{Place} assocated with the Event. 63 64 @returns: L{Place} database handle 65 @rtype: str 66 """ 67 return self.place
68