コード例 #1
0
ファイル: __init__.py プロジェクト: beck/weblate
# User-Agent string to use
USER_AGENT = 'Weblate/{0}'.format(VERSION)

# Are we running git
RUNNING_GIT = is_running_git()
GIT_RELEASE = False
GIT_VERSION = VERSION

# Grab some information from git
if RUNNING_GIT:
    try:
        # Describe current checkout
        GIT_VERSION = GitRepository(get_root_dir()).describe()

        # Check if we're close to release tag
        parts = GIT_VERSION.split('-')
        GIT_RELEASE = (len(parts) <= 2 or int(parts[2]) < 20)
        del parts

        # Mark version as devel if it is
        if not GIT_RELEASE:
            VERSION += '-dev'
    except (RepositoryException, OSError):
        # Import failed or git has troubles reading
        # repo (eg. swallow clone)
        RUNNING_GIT = False


def get_doc_url(page, anchor=''):
    '''
    Return URL to documentation.
コード例 #2
0
ファイル: __init__.py プロジェクト: electrolinux/weblate
# User-Agent string to use
USER_AGENT = 'Weblate/{0}'.format(VERSION)

# Are we running git
RUNNING_GIT = is_running_git()
GIT_RELEASE = False
GIT_VERSION = VERSION

# Grab some information from git
if RUNNING_GIT:
    try:
        # Describe current checkout
        GIT_VERSION = GitRepository(get_root_dir()).describe()

        # Check if we're close to release tag
        parts = GIT_VERSION.split('-')
        GIT_RELEASE = (len(parts) <= 2 or int(parts[2]) < 20)
        del parts

        # Mark version as devel if it is
        if not GIT_RELEASE:
            VERSION += '-dev'
    except (RepositoryException, OSError):
        # Import failed or git has troubles reading
        # repo (eg. swallow clone)
        RUNNING_GIT = False


def get_doc_url(page, anchor=''):
    '''
    Return URL to documentation.
コード例 #3
0
ファイル: __init__.py プロジェクト: nblock/weblate
# User-Agent string to use
USER_AGENT = "Weblate/{0}".format(VERSION)

# Are we running git
RUNNING_GIT = is_running_git()
GIT_RELEASE = False
GIT_VERSION = VERSION

# Grab some information from git
if RUNNING_GIT:
    try:
        # Describe current checkout
        GIT_VERSION = GitRepository(get_root_dir()).describe()

        # Check if we're close to release tag
        parts = GIT_VERSION.split("-")
        GIT_RELEASE = len(parts) <= 2 or int(parts[2]) < 20
        del parts

        # Mark version as devel if it is
        if not GIT_RELEASE:
            VERSION += "-dev"
    except (RepositoryException, OSError):
        # Import failed or git has troubles reading
        # repo (eg. swallow clone)
        RUNNING_GIT = False


def get_doc_url(page, anchor=""):
    """
    Return URL to documentation.