1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """creating links to online/installed documentation.
19 Integration with online and installed documentation for messages.
20 """
21
22 __version__ = "$Rev: 6125 $"
23
24 from flumotion.common import common, errors
25 from flumotion.common.i18n import getLL
26 from flumotion.configure import configure
27
28 from flumotion.common.i18n import N_, gettexter
29
30 T_ = gettexter()
31
32
53
54
55 -def getWebLink(section, anchor, version=None, projectURL=None):
56 """
57 Get a documentation link based on the parameters.
58
59 @param section: section, usually the name of the html file
60 @type section: string
61 @param anchor: name of the anchor, part of a section
62 @type anchor: string
63 @param version: optional, version to use. If this is not specified
64 the version from configure.version will be used
65 @type version: string
66 @param projectURL, url for the project this link belongs to.
67 @type projectURL: string
68 @returns: the constructed documentation link
69 @rtype: string
70 """
71 if version is None:
72 version = configure.version
73
74
75
76 versionTuple = version.split('.')
77 version = common.versionTupleToString(versionTuple[:3])
78
79 if projectURL is None:
80 projectURL = 'http://www.flumotion.net/doc/flumotion/manual'
81 if anchor:
82 anchor = '#%s' % anchor
83
84 return '%s/%s/%s/html/%s.html%s' % (
85 projectURL, getLL(), version, section, anchor)
86
87
97
98
100 """
101 Add link on how to change device permissions on Linux.
102 """
103 message.description = T_(N_("Learn how to change device permissions."))
104 message.section = 'section-flumotion-troubleshoot'
105 message.anchor = 'section-not-open'
106
107
109 """
110 Add text and link on how to install the given python module to the
111 given message.
112 """
113 message.description = T_(N_('Learn how to install GStreamer elements.'))
114 message.section = 'section-installing-gstreamer-plugins'
115