1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """
24 LocationBase class for GRAMPS.
25 """
26
27
28
29
30
31
33 """
34 Base class for all things Address.
35 """
36
38 """
39 Create a LocationBase object, copying from the source object if it
40 exists.
41 """
42 if source:
43 self.street = source.street
44 self.city = source.city
45 self.county = source.county
46 self.state = source.state
47 self.country = source.country
48 self.postal = source.postal
49 self.phone = source.phone
50 else:
51 self.street = ""
52 self.city = ""
53 self.county = ""
54 self.state = ""
55 self.country = ""
56 self.postal = ""
57 self.phone = ""
58
60 """
61 Convert the object to a serialized tuple of data.
62 """
63 return (self.street, self.city, self.county, self.state,
64 self.country, self.postal, self.phone)
65
67 """
68 Convert a serialized tuple of data to an object.
69 """
70 (self.street, self.city, self.county, self.state, self.country,
71 self.postal, self.phone) = data
72 return self
73
75 """
76 Return the list of all textual attributes of the object.
77
78 @return: Returns the list of all textual attributes of the object.
79 @rtype: list
80 """
81 return [self.city, self.state, self.country, self.postal, self.phone]
82
84 """Set the street portion of the Location."""
85 self.street = val
86
88 """Return the street portion of the Location."""
89 return self.street
90
92 """Set the city name of the LocationBase object."""
93 self.city = data
94
96 """Return the city name of the LocationBase object."""
97 return self.city
98
99 - def set_postal_code(self, data):
100 """Set the postal code of the LocationBase object."""
101 self.postal = data
102
103 - def get_postal_code(self):
104 """Return the postal code of the LocationBase object."""
105 return self.postal
106
108 """Set the phone number of the LocationBase object."""
109 self.phone = data
110
112 """Return the phone number of the LocationBase object."""
113 return self.phone
114
116 """Set the state name of the LocationBase object."""
117 self.state = data
118
120 """Return the state name of the LocationBase object."""
121 return self.state
122
124 """Set the country name of the LocationBase object."""
125 self.country = data
126
128 """Return the country name of the LocationBase object."""
129 return self.country
130
132 """Set the county name of the LocationBase object."""
133 self.county = data
134
136 """Return the county name of the LocationBase object."""
137 return self.county
138