Merge "Use new translation setup for all python projects"

This commit is contained in:
Jenkins 2016-02-02 09:20:51 +00:00 committed by Gerrit Code Review
commit 5e96e9aeda
2 changed files with 21 additions and 75 deletions

View File

@ -74,34 +74,6 @@ function propose_training_guides {
# Propose updates for python projects # Propose updates for python projects
function propose_python { 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 project=$1
local modulename=$2 local modulename=$2
@ -209,20 +181,22 @@ case "$PROJECT" in
setup_horizon "$ZANATA_VERSION" setup_horizon "$ZANATA_VERSION"
propose_horizon propose_horizon
;; ;;
# New setup: all dashboard plugin repositories plus others python-*)
*-dashboard|*-ui|*-horizon|python-neutronclient|python-novaclient|oslo*) echo "project temporarily disabled"
exit 0
;;
networking-*|neutron-*)
echo "project temporarily disabled"
exit 0
;;
*)
# Common setup for python and django repositories
# ---- Python projects ---- # ---- 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) MODULENAME=$(get_modulename $PROJECT python)
if [ -n "$MODULENAME" ]; then if [ -n "$MODULENAME" ]; then
setup_django "$PROJECT" "$MODULENAME" "$ZANATA_VERSION" setup_django "$PROJECT" "$MODULENAME" "$ZANATA_VERSION"
setup_loglevel_vars setup_loglevel_vars
propose_python_new "$PROJECT" "$MODULENAME" propose_python "$PROJECT" "$MODULENAME"
fi fi
# ---- Django projects ---- # ---- Django projects ----
@ -232,22 +206,6 @@ case "$PROJECT" in
propose_django "$PROJECT" "$MODULENAME" propose_django "$PROJECT" "$MODULENAME"
fi 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 esac
# Filter out commits we do not want. # Filter out commits we do not want.

View File

@ -54,15 +54,17 @@ case "$PROJECT" in
setup_horizon "$ZANATA_VERSION" setup_horizon "$ZANATA_VERSION"
./run_tests.sh --makemessages -V ./run_tests.sh --makemessages -V
;; ;;
# New setup: all dashboard plugin repositories plus others python-*)
*-dashboard|*-ui|*-horizon|python-neutronclient|python-novaclient|oslo*) echo "project temporarily disabled"
exit 0
;;
networking-*|neutron-*)
echo "project temporarily disabled"
exit 0
;;
*)
# Common setup for python and django repositories
# ---- Python projects ---- # ---- 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) MODULENAME=$(get_modulename $PROJECT python)
if [ -n "$MODULENAME" ]; then if [ -n "$MODULENAME" ]; then
setup_django "$PROJECT" "$MODULENAME" "$ZANATA_VERSION" setup_django "$PROJECT" "$MODULENAME" "$ZANATA_VERSION"
@ -78,20 +80,6 @@ case "$PROJECT" in
extract_messages_django "$MODULENAME" extract_messages_django "$MODULENAME"
fi 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 esac
# Add all changed files to git. # Add all changed files to git.