コード例 #1
0
    return os.path.abspath(os.path.join(curdir, '..'))


# Weblate version
VERSION = '2.14'

# Version string without suffix
VERSION_BASE = VERSION.replace('-dev', '')

# User-Agent string to use
USER_AGENT = 'Weblate/{0}'.format(VERSION)

# Grab some information from git
try:
    # Describe current checkout
    GIT_VERSION = GitRepository(get_root_dir()).describe()
except (RepositoryException, OSError):
    # Import failed or git has troubles reading
    # repo (eg. swallow clone)
    GIT_VERSION = VERSION


def get_doc_url(page, anchor=''):
    """Return URL to documentation."""
    # Should we use tagged release or latest version
    if '-dev' in VERSION:
        version = 'latest'
    else:
        version = 'weblate-{0}'.format(VERSION)
    # Generate URL
    url = 'https://docs.weblate.org/en/{0}/{1}.html'.format(version, page)
コード例 #2
0
    return os.path.abspath(os.path.join(curdir, '..'))


# Weblate version
VERSION = '2.20'

# Version string without suffix
VERSION_BASE = VERSION.replace('-dev', '')

# User-Agent string to use
USER_AGENT = 'Weblate/{0}'.format(VERSION)

# Grab some information from git
try:
    # Describe current checkout
    GIT_VERSION = GitRepository(get_root_dir(), local=True).describe()
except (RepositoryException, OSError):
    # Import failed or git has troubles reading
    # repo (eg. swallow clone)
    GIT_VERSION = VERSION


def get_doc_url(page, anchor=''):
    """Return URL to documentation."""
    # Should we use tagged release or latest version
    if '-dev' in VERSION:
        version = 'latest'
    else:
        version = 'weblate-{0}'.format(VERSION)
    # Generate URL
    url = 'https://docs.weblate.org/en/{0}/{1}.html'.format(version, page)