Exemplo n.º 1
0
def getWebLink(section, anchor, version=None, projectURL=None):
    """
    Get a documentation link based on the parameters.

    @param section: section, usually the name of the html file
    @type  section: string
    @param  anchor: name of the anchor, part of a section
    @type   anchor: string
    @param  version: optional, version to use. If this is not specified
                     the version from configure.version will be used
    @type   version: string
    @param  projectURL, url for the project this link belongs to.
    @type   projectURL: string
    @returns: the constructed documentation link
    @rtype: string
    """
    if version is None:
        version = configure.version

    # FIXME: if the version has a nano, do something sensible, like
    # drop the nano or always link to trunk version
    versionTuple = version.split('.')
    version = common.versionTupleToString(versionTuple[:3])

    if projectURL is None:
        projectURL = 'http://www.flumotion.net/doc/flumotion/manual'
    if anchor:
        anchor = '#%s' % anchor

    return '%s/%s/%s/html/%s.html%s' % (projectURL, getLL(), version, section,
                                        anchor)
Exemplo n.º 2
0
def getWebLink(section, anchor, version=None, projectURL=None):
    """
    Get a documentation link based on the parameters.

    @param section: section, usually the name of the html file
    @type  section: string
    @param  anchor: name of the anchor, part of a section
    @type   anchor: string
    @param  version: optional, version to use. If this is not specified
                     the version from configure.version will be used
    @type   version: string
    @param  projectURL, url for the project this link belongs to.
    @type   projectURL: string
    @returns: the constructed documentation link
    @rtype: string
    """
    if version is None:
        version = configure.version

    # FIXME: if the version has a nano, do something sensible, like
    # drop the nano or always link to trunk version
    versionTuple = version.split('.')
    version = common.versionTupleToString(versionTuple[:3])

    if projectURL is None:
        projectURL = 'http://www.flumotion.net/doc/flumotion/manual'
    if anchor:
        anchor = '#%s' % anchor

    return '%s/%s/%s/html/%s.html%s' % (
        projectURL, getLL(), version, section, anchor)
Exemplo n.º 3
0
        def fetchTranslations():
            if not self.gettextDomain:
                return defer.succeed(None)

            def haveBundle(localedatadir):
                localeDir = os.path.join(localedatadir, 'locale')
                self.debug("Loading locales for %s from %s" % (
                    self.gettextDomain, localeDir))
                gettext.bindtextdomain(self.gettextDomain, localeDir)
                locale.bindtextdomain(self.gettextDomain, localeDir)

            lang = getLL()
            self.debug("loading bundle for %s locales" % lang)
            bundleName = '%s-locale-%s' % (self.gettextDomain, lang)
            d = self.admin.bundleLoader.getBundleByName(bundleName)
            d.addCallbacks(haveBundle, lambda _: None)
            return d
Exemplo n.º 4
0
        def fetchTranslations():
            if not self.gettextDomain:
                return defer.succeed(None)

            def haveBundle(localedatadir):
                localeDir = os.path.join(localedatadir, 'locale')
                self.debug("Loading locales for %s from %s" %
                           (self.gettextDomain, localeDir))
                gettext.bindtextdomain(self.gettextDomain, localeDir)
                locale.bindtextdomain(self.gettextDomain, localeDir)

            lang = getLL()
            self.debug("loading bundle for %s locales" % lang)
            bundleName = '%s-locale-%s' % (self.gettextDomain, lang)
            d = self.admin.bundleLoader.getBundleByName(bundleName)
            d.addCallbacks(haveBundle, lambda _: None)
            return d