From 5738b0dba55e98ed19dc081296c3f6e99de88ae4 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sun, 31 Jan 2016 11:13:38 +0100 Subject: [PATCH] Use new translation setup for all python projects Use the new translation setup for all python projects. This now uses it for most python projects and those will just work without any change with the new setup since for them modulename and reponame are the same. For example for nova, both are "nova". In addition, enable new setup for vmware-nsx and ironic-inspector - the projects are ready now. Note this change temporarily disables python-novaclient and python-neutronclient - instead of making the script complicated, we wait until all python projects are ready and then reenable all. This also removes the old propose_python function that is not needed anymore and renames propose_python_new to propose_python. Remove also some outdated comments. Story: 2000452 Change-Id: I5b89f7b168a862773282dc0400763b1a94ea9e10 --- jenkins/scripts/propose_translation_update.sh | 64 ++++--------------- .../scripts/upstream_translation_update.sh | 32 +++------- 2 files changed, 21 insertions(+), 75 deletions(-) diff --git a/jenkins/scripts/propose_translation_update.sh b/jenkins/scripts/propose_translation_update.sh index eca2f3ebaf..7939a97725 100755 --- a/jenkins/scripts/propose_translation_update.sh +++ b/jenkins/scripts/propose_translation_update.sh @@ -74,34 +74,6 @@ function propose_training_guides { # Propose updates for python projects function propose_python { - - # Pull updated translations from Zanata - pull_from_zanata "$PROJECT" - - # Extract all messages from project, including log messages. - extract_messages "$PROJECT" - extract_messages_log "$PROJECT" - - # Now add all changed files to git. - # Note we add them here to not have to differentiate in the functions - # between new files and files already under git control. - git add $PROJECT/locale/* - - # Remove obsolete files. - cleanup_po_files "$PROJECT" - - # Compress downloaded po files, this needs to be done after - # cleanup_po_files since that function needs to have information the - # number of untranslated strings. - compress_po_files "$PROJECT" - - # Some files were changed, add changed files again to git, so that we - # can run git diff properly. - git add $PROJECT/locale/* -} - -# TODO(amotoki): Finally this should replace current propose_python. -function propose_python_new { local project=$1 local modulename=$2 @@ -209,20 +181,22 @@ case "$PROJECT" in setup_horizon "$ZANATA_VERSION" propose_horizon ;; - # New setup: all dashboard plugin repositories plus others - *-dashboard|*-ui|*-horizon|python-neutronclient|python-novaclient|oslo*) + python-*) + echo "project temporarily disabled" + exit 0 + ;; + networking-*|neutron-*) + echo "project temporarily disabled" + exit 0 + ;; + *) + # Common setup for python and django repositories # ---- Python projects ---- - # NOTE: At now POT file == $modulename/locale/$modulename.pot - # so this script works. - # TODO(amotoki): - # * Move POT/PO file to $modulename/locale/$modulename.pot - # * Update setup.cfg (babel related) - # * Rename Zanata resource MODULENAME=$(get_modulename $PROJECT python) if [ -n "$MODULENAME" ]; then setup_django "$PROJECT" "$MODULENAME" "$ZANATA_VERSION" setup_loglevel_vars - propose_python_new "$PROJECT" "$MODULENAME" + propose_python "$PROJECT" "$MODULENAME" fi # ---- Django projects ---- @@ -232,22 +206,6 @@ case "$PROJECT" in propose_django "$PROJECT" "$MODULENAME" fi ;; - python-*) - echo "project temporarily disabled" - exit 0 - ;; - ironic-inspector|networking-*|neutron-*|vmware-nsx) - echo "project temporarily disabled" - exit 0 - ;; - *) - # Project specific setup. - setup_project "$PROJECT" "$ZANATA_VERSION" - # Setup some global vars which will be used in the rest of the - # script. - setup_loglevel_vars - propose_python - ;; esac # Filter out commits we do not want. diff --git a/jenkins/scripts/upstream_translation_update.sh b/jenkins/scripts/upstream_translation_update.sh index 28eeb9a2a7..e522fd7cb4 100755 --- a/jenkins/scripts/upstream_translation_update.sh +++ b/jenkins/scripts/upstream_translation_update.sh @@ -54,15 +54,17 @@ case "$PROJECT" in setup_horizon "$ZANATA_VERSION" ./run_tests.sh --makemessages -V ;; - # New setup: all dashboard plugin repositories plus others - *-dashboard|*-ui|*-horizon|python-neutronclient|python-novaclient|oslo*) + python-*) + echo "project temporarily disabled" + exit 0 + ;; + networking-*|neutron-*) + echo "project temporarily disabled" + exit 0 + ;; + *) + # Common setup for python and django repositories # ---- Python projects ---- - # NOTE: At now POT file == $modulename/locale/$modulename.pot - # so this script works. - # TODO(amotoki): - # * Move POT/PO file to $modulename/locale/$modulename.pot - # * Update setup.cfg (babel related) - # * Rename Zanata resource MODULENAME=$(get_modulename $PROJECT python) if [ -n "$MODULENAME" ]; then setup_django "$PROJECT" "$MODULENAME" "$ZANATA_VERSION" @@ -78,20 +80,6 @@ case "$PROJECT" in extract_messages_django "$MODULENAME" fi ;; - python-*) - echo "project temporarily disabled" - exit 0 - ;; - ironic-inspector|networking-*|neutron-*|vmware-nsx) - echo "project temporarily disabled" - exit 0 - ;; - *) - setup_project "$PROJECT" "$ZANATA_VERSION" - setup_loglevel_vars - extract_messages "$PROJECT" - extract_messages_log "$PROJECT" - ;; esac # Add all changed files to git.