Commit 7a6a5cc5 authored by Michal Čihař's avatar Michal Čihař

Add management command to list required versions

parent a882d340
...@@ -102,6 +102,13 @@ list_ignored_checks ...@@ -102,6 +102,13 @@ list_ignored_checks
Lists most frequently ignored checks. This can be useful for tuning your setup, Lists most frequently ignored checks. This can be useful for tuning your setup,
if users have to ignore too many of consistency checks. if users have to ignore too many of consistency checks.
list_versions
-------------
.. django-admin:: list_versions
Lists versions of Weblate dependencies.
loadpo <project|project/subproject> loadpo <project|project/subproject>
----------------------------------- -----------------------------------
......
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django.core.management.base import BaseCommand
from trans.requirements import get_versions
class Command(BaseCommand):
help = 'lists versions of required software components'
def handle(self, *args, **options):
'''
Prints versions of dependencies.
'''
for version in get_versions():
print ' * %s %s' % (
version[0],
version[2],
)
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
Tests for management commands. Tests for management commands.
""" """
from django.test import TestCase
from trans.tests.models import RepoTestCase from trans.tests.models import RepoTestCase
from django.core.management import call_command from django.core.management import call_command
from django.core.management.base import CommandError from django.core.management.base import CommandError
...@@ -116,6 +117,11 @@ class ImportProjectTest(RepoTestCase): ...@@ -116,6 +117,11 @@ class ImportProjectTest(RepoTestCase):
) )
class BasicCommandTest(TestCase):
def test_versions(self):
call_command('list_versions')
class PeriodicCommandTest(RepoTestCase): class PeriodicCommandTest(RepoTestCase):
def setUp(self): def setUp(self):
super(PeriodicCommandTest, self).setUp() super(PeriodicCommandTest, self).setUp()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment