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

Source Code for Module gen.lib.researcher

  1  # 
  2  # Gramps - a GTK+/GNOME based genealogy program 
  3  # 
  4  # Copyright (C) 2000-2007  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: researcher.py 10103 2008-02-24 13:55:55Z acraphae $ 
 22   
 23  """ 
 24  Researcher informaiton for GRAMPS. 
 25  """ 
 26   
 27  #------------------------------------------------------------------------- 
 28  # 
 29  # GRAMPS modules 
 30  # 
 31  #------------------------------------------------------------------------- 
 32  from gen.lib.locationbase import LocationBase 
 33   
 34  #------------------------------------------------------------------------- 
 35  # 
 36  #  
 37  # 
 38  #------------------------------------------------------------------------- 
39 -class Researcher(LocationBase):
40 """Contains the information about the owner of the database.""" 41
42 - def __init__(self, source=None):
43 """ 44 Initialize the Researcher object, copying from the source if provided. 45 """ 46 47 LocationBase.__init__(self, source) 48 if source: 49 self.name = source.name 50 self.addr = source.addr 51 self.email = source.email 52 else: 53 self.name = "" 54 self.addr = "" 55 self.email = ""
56
57 - def serialize(self):
58 """ 59 Convert the object to a serialized tuple of data. 60 """ 61 return (LocationBase.serialize(self), 62 self.name, self.addr, self.email)
63
64 - def unserialize(self, data):
65 """ 66 Convert a serialized tuple of data to an object. 67 """ 68 (location, self.name, self.addr, self.email) = data 69 LocationBase.unserialize(self, location) 70 71 return self
72
73 - def set_name(self, data):
74 """Set the database owner's name.""" 75 self.name = data
76
77 - def get_name(self):
78 """Return the database owner's name.""" 79 return self.name
80
81 - def set_address(self, data):
82 """Set the database owner's address.""" 83 self.addr = data
84
85 - def get_address(self):
86 """Return the database owner's address.""" 87 return self.addr
88
89 - def set_email(self, data):
90 """ Set the database owner's email.""" 91 self.email = data
92
93 - def get_email(self):
94 """Return the database owner's email.""" 95 return self.email
96
97 - def set_from(self, other_researcher):
98 """Set all attributes from another instance.""" 99 self.street = other_researcher.street 100 self.city = other_researcher.city 101 self.county = other_researcher.county 102 self.state = other_researcher.state 103 self.country = other_researcher.country 104 self.postal = other_researcher.postal 105 self.phone = other_researcher.phone 106 107 self.name = other_researcher.name 108 self.addr = other_researcher.addr 109 self.email = other_researcher.email
110