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
This commit is contained in:
Andreas Jaeger 2016-01-31 11:13:38 +01:00
parent e2b56b7f59
commit 5738b0dba5
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.