Rename pull_catalog args from version to branch

It was a very bad idea to name the argument to fetch a specific
version from Zanata as 'version'.

At the moment I get this error mesage:
argparse.ArgumentError: argument --version: conflicting option string(s): --version

Change-Id: I662a218a2713fcefd3a624a4cc2a907a7fc1434b
This commit is contained in:
Frank Kloeker 2018-04-05 14:54:28 +02:00
parent 91e659f172
commit 886852f13f

View File

@ -23,10 +23,10 @@ ZANATA_LOCALES_URL = ("https://translate.openstack.org/rest/project"
DOMAINS = ['django', 'djangojs'] DOMAINS = ['django', 'djangojs']
MODULES = ['horizon', 'openstack_dashboard'] MODULES = ['horizon', 'openstack_dashboard']
PROJECT = 'horizon' PROJECT = 'horizon'
VERSION = 'master', BRANCH = 'master',
POFILE = "{module}/locale/{locale}/LC_MESSAGES/{domain}.po" POFILE = "{module}/locale/{locale}/LC_MESSAGES/{domain}.po"
POFILE_URL = ("https://translate.openstack.org/rest/file/translation/{project}" POFILE_URL = ("https://translate.openstack.org/rest/file/translation/{project}"
"/{version}/{language}/po?docId={module}%2Flocale%2F{domain}") "/{branch}/{language}/po?docId={module}%2Flocale%2F{domain}")
class Command(BaseCommand): class Command(BaseCommand):
@ -58,8 +58,8 @@ class Command(BaseCommand):
"strings from e.g. 'openstack_dashboard'. " "strings from e.g. 'openstack_dashboard'. "
"The default modules are 'horizon' and " "The default modules are 'horizon' and "
"'openstack_dashboard'")) "'openstack_dashboard'"))
parser.add_argument('-v', '--version', type=str, default=VERSION, parser.add_argument('-b', '--branch', type=str, default=BRANCH,
help=("The version of the project to extract " help=("The branch of the project to extract "
"strings from e.g. 'horizon'. The default " "strings from e.g. 'horizon'. The default "
"is 'master'")) "is 'master'"))
@ -80,7 +80,7 @@ class Command(BaseCommand):
new_po = requests.get((POFILE_URL).format( new_po = requests.get((POFILE_URL).format(
language=language, language=language,
project=options['project'], project=options['project'],
version=options['version'], branch=options['branch'],
module=module, module=module,
domain=domain)) domain=domain))