From 886852f13ffee9ebb94f0e048f98ad8e58f10eb6 Mon Sep 17 00:00:00 2001 From: Frank Kloeker Date: Thu, 5 Apr 2018 14:54:28 +0200 Subject: [PATCH] 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 --- horizon/management/commands/pull_catalog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/horizon/management/commands/pull_catalog.py b/horizon/management/commands/pull_catalog.py index 285e441b9e..5eb530c4d1 100644 --- a/horizon/management/commands/pull_catalog.py +++ b/horizon/management/commands/pull_catalog.py @@ -23,10 +23,10 @@ ZANATA_LOCALES_URL = ("https://translate.openstack.org/rest/project" DOMAINS = ['django', 'djangojs'] MODULES = ['horizon', 'openstack_dashboard'] PROJECT = 'horizon' -VERSION = 'master', +BRANCH = 'master', POFILE = "{module}/locale/{locale}/LC_MESSAGES/{domain}.po" 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): @@ -58,8 +58,8 @@ class Command(BaseCommand): "strings from e.g. 'openstack_dashboard'. " "The default modules are 'horizon' and " "'openstack_dashboard'")) - parser.add_argument('-v', '--version', type=str, default=VERSION, - help=("The version of the project to extract " + parser.add_argument('-b', '--branch', type=str, default=BRANCH, + help=("The branch of the project to extract " "strings from e.g. 'horizon'. The default " "is 'master'")) @@ -80,7 +80,7 @@ class Command(BaseCommand): new_po = requests.get((POFILE_URL).format( language=language, project=options['project'], - version=options['version'], + branch=options['branch'], module=module, domain=domain))