1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """
24 Url class for GRAMPS.
25 """
26
27
28
29
30
31
32 from warnings import warn
33
34
35
36
37
38
39 from gen.lib.secondaryobj import SecondaryObject
40 from gen.lib.privacybase import PrivacyBase
41 from gen.lib.urltype import UrlType
42
43
44
45
46
47
48 -class Url(SecondaryObject, PrivacyBase):
49 """
50 Contains information related to internet Uniform Resource Locators,
51 allowing gramps to store information about internet resources.
52 """
53
55 """Create a new URL instance, copying from the source if present."""
56 PrivacyBase.__init__(self, source)
57 if source:
58 self.path = source.path
59 self.desc = source.desc
60 self.type = source.type
61 else:
62 self.path = ""
63 self.desc = ""
64 self.type = UrlType()
65
68
70 (self.private, self.path, self.desc, type_value) = data
71 self.type.unserialize(type_value)
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.path, self.desc]
82
84 """Set the URL path."""
85 self.path = path
86
88 """Return the URL path."""
89 return self.path
90
92 """Set the description of the URL."""
93 self.desc = description
94
96 """Return the description of the URL."""
97 return self.desc
98
100 """
101 @param the_type: descriptive type of the Url
102 @type the_type: str
103 """
104 self.type.set(the_type)
105
107 """
108 @returns: the descriptive type of the Url
109 @rtype: str
110 """
111 return self.type
112
114 """Deprecated - use is_equal instead."""
115
116 warn( "Use is_equal instead of are_equal", DeprecationWarning, 2)
117 return self.is_equal(other)
118