1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """
24 Location class for GRAMPS.
25 """
26
27
28
29
30
31
32 from gen.lib.secondaryobj import SecondaryObject
33 from gen.lib.locationbase import LocationBase
34
35
36
37
38
39
40 -class Location(SecondaryObject, LocationBase):
41 """
42 Provide information about a place.
43
44 The data including city, county, state, and country.
45 Multiple Location objects can represent the same place, since names
46 of citys, countys, states, and even countries can change with time.
47 """
48
50 """
51 Create a Location object, copying from the source object if it exists.
52 """
53 LocationBase.__init__(self, source)
54 if source:
55 self.parish = source.parish
56 else:
57 self.parish = ""
58
60 """
61 Convert the object to a serialized tuple of data.
62 """
63 return (LocationBase.serialize(self), self.parish)
64
66 """
67 Convert a serialized tuple of data to an object.
68 """
69 (lbase, self.parish) = data
70 LocationBase.unserialize(self, lbase)
71 return self
72
74 """
75 Return the list of all textual attributes of the object.
76
77 @return: Returns the list of all textual attributes of the object.
78 @rtype: list
79 """
80 return [self.parish] + LocationBase.get_text_data_list(self)
81
83 return not self.city and not self.county and not self.state and \
84 not self.country and not self.postal and not self.phone
85
87 """Set the religious parish name."""
88 self.parish = data
89
91 """Get the religious parish name."""
92 return self.parish
93