コード例 #1
0
ファイル: initdb.py プロジェクト: shayanb/pootle
def save_build_versions():
    """Save the Pootle and Translate Toolkit build versions on the database.

    The build versions are used to upgrade only what has to be upgraded.
    """
    pootle_config = PootleConfig(ptl_build=CODE_PTL_BUILD_VERSION,
                                 ttk_build=CODE_TTK_BUILD_VERSION)
    pootle_config.save()
コード例 #2
0
ファイル: initdb.py プロジェクト: JeroenKnoops/pootle
def save_build_versions():
    """Save the Pootle and Translate Toolkit build versions on the database.

    The build versions are used to upgrade only what has to be upgraded.
    """
    pootle_config = PootleConfig(
        ptl_build=CODE_PTL_BUILD_VERSION,
        ttk_build=CODE_TTK_BUILD_VERSION
    )
    pootle_config.save()
コード例 #3
0
def ensure_pootle_config():
    """Ensure that the PootleConfig object exists, so the code can use it."""
    from pootle_app.models import PootleConfig

    try:
        PootleConfig.objects.get_current()
        logging.info("No need to migrate old build versions.")
    except Exception:
        from pootle_app.models.pootle_config import (get_legacy_ptl_build,
                                                     get_legacy_ttk_build)

        # Copy the Pootle and Translate Toolkit build versions.
        pootle_config = PootleConfig(
            ptl_build=get_legacy_ptl_build(),
            ttk_build=get_legacy_ttk_build(),
        )
        pootle_config.save()
        logging.info("Succesfully migrated old build versions to new "
                     "PootleConfig.")
コード例 #4
0
ファイル: __init__.py プロジェクト: atassumer/pootle
def ensure_pootle_config():
    """Ensure that the PootleConfig object exists, so the code can use it."""
    from pootle_app.models import PootleConfig

    try:
        PootleConfig.objects.get_current()
        logging.info("No need to migrate old build versions.")
    except Exception:
        from pootle_app.models.pootle_config import (get_legacy_ptl_build,
                                                     get_legacy_ttk_build)

        # Copy the Pootle and Translate Toolkit build versions.
        pootle_config = PootleConfig(
            ptl_build=get_legacy_ptl_build(),
            ttk_build=get_legacy_ttk_build(),
        )
        pootle_config.save()
        logging.info("Succesfully migrated old build versions to new "
                     "PootleConfig.")