summaryrefslogtreecommitdiff
path: root/openstack_dashboard/management
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@sheep.art.pl>2017-03-15 18:41:19 +0100
committerRadomir Dopieralski <openstack@sheep.art.pl>2017-03-17 16:55:18 +0100
commitc3b6fc761e067525dd3ffba352f8262878223584 (patch)
treedc2c456ce0126051b3abaf4bc2dce2642828b373 /openstack_dashboard/management
parent4187837434d4501fddb2f72b91f27ab0a8288305 (diff)
downloadhorizon-c3b6fc761e067525dd3ffba352f8262878223584.tar.gz
Make extract_messages quiet in pep8 test
The additional extract_messages call in the pep8 tox environment generates a lot of meaningless output, that then makes it difficult to spot actual failures and warnings. This patch makes the Django command respect the verbosity setting and call the setup.py command with a quiet flag if low verbosity is requested, considerably decreasing the amount of useless output. It then sets that verbosity to low in the corresponding tox environment. Change-Id: I2976250a23e800fbb582726299670b57199b58a7
Diffstat (limited to 'openstack_dashboard/management')
-rw-r--r--openstack_dashboard/management/commands/extract_messages.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/openstack_dashboard/management/commands/extract_messages.py b/openstack_dashboard/management/commands/extract_messages.py
index f015f26b3..95049e8c9 100644
--- a/openstack_dashboard/management/commands/extract_messages.py
+++ b/openstack_dashboard/management/commands/extract_messages.py
@@ -37,11 +37,13 @@ class Command(BaseCommand):
"polluting the source code"))
def handle(self, *args, **options):
- cmd = ('python setup.py extract_messages -F babel-{domain}.cfg '
+ cmd = ('python setup.py {quiet} extract_messages '
+ '-F babel-{domain}.cfg '
'-o {module}/locale/{domain}.pot')
distribution = Distribution()
distribution.parse_config_files(distribution.find_config_files())
+ quiet = '-q' if int(options['verbosity']) == 0 else ''
if options['check_only']:
cmd += " ; rm {module}/locale/{domain}.pot"
@@ -53,5 +55,5 @@ class Command(BaseCommand):
with open(potfile, 'wb') as f:
f.write(b'')
- call(cmd.format(module=module, domain=domain, potfile=potfile),
- shell=True)
+ call(cmd.format(module=module, domain=domain, potfile=potfile,
+ quiet=quiet), shell=True)