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