Author: russellm
Date: 2008-10-02 07:57:13 -0500 (Thu, 02 Oct 2008)
New Revision: 9110

Modified:
   django/trunk/django/core/management/base.py
   django/trunk/django/core/management/commands/flush.py
   django/trunk/django/core/management/commands/loaddata.py
   django/trunk/django/core/management/commands/makemessages.py
   django/trunk/django/core/management/commands/syncdb.py
   django/trunk/django/core/management/commands/test.py
   django/trunk/django/core/management/commands/testserver.py
   django/trunk/docs/ref/django-admin.txt
   django/trunk/docs/ref/signals.txt
   django/trunk/tests/runtests.py
Log:
Promoted --verbosity to be a top level option for all management commands. Also 
added -v as a consistent short form of --verbosity. This is mostly to save 
Malcolm's poor arthritic fingers.


Modified: django/trunk/django/core/management/base.py
===================================================================
--- django/trunk/django/core/management/base.py 2008-10-01 17:26:40 UTC (rev 
9109)
+++ django/trunk/django/core/management/base.py 2008-10-02 12:57:13 UTC (rev 
9110)
@@ -121,6 +121,9 @@
     """
     # Metadata about this command.
     option_list = (
+        make_option('-v', '--verbosity', action='store', dest='verbosity', 
default='1',
+            type='choice', choices=['0', '1', '2'],
+            help='Verbosity level; 0=minimal output, 1=normal output, 2=all 
output'),
         make_option('--settings',
             help='The Python path to a settings module, e.g. 
"myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE 
environment variable will be used.'),
         make_option('--pythonpath',
@@ -209,7 +212,7 @@
                 from django.utils import translation
                 translation.activate('en-us')
             except ImportError, e:
-                # If settings should be available, but aren't, 
+                # If settings should be available, but aren't,
                 # raise the error and quit.
                 sys.stderr.write(self.style.ERROR(str('Error: %s\n' % e)))
                 sys.exit(1)

Modified: django/trunk/django/core/management/commands/flush.py
===================================================================
--- django/trunk/django/core/management/commands/flush.py       2008-10-01 
17:26:40 UTC (rev 9109)
+++ django/trunk/django/core/management/commands/flush.py       2008-10-02 
12:57:13 UTC (rev 9110)
@@ -4,9 +4,6 @@
 
 class Command(NoArgsCommand):
     option_list = NoArgsCommand.option_list + (
-        make_option('--verbosity', action='store', dest='verbosity', 
default='1',
-            type='choice', choices=['0', '1', '2'],
-            help='Verbosity level; 0=minimal output, 1=normal output, 2=all 
output'),
         make_option('--noinput', action='store_false', dest='interactive', 
default=True,
             help='Tells Django to NOT prompt the user for input of any kind.'),
     )

Modified: django/trunk/django/core/management/commands/loaddata.py
===================================================================
--- django/trunk/django/core/management/commands/loaddata.py    2008-10-01 
17:26:40 UTC (rev 9109)
+++ django/trunk/django/core/management/commands/loaddata.py    2008-10-02 
12:57:13 UTC (rev 9110)
@@ -10,11 +10,6 @@
     from sets import Set as set   # Python 2.3 fallback
 
 class Command(BaseCommand):
-    option_list = BaseCommand.option_list + (
-        make_option('--verbosity', action='store', dest='verbosity', 
default='1',
-            type='choice', choices=['0', '1', '2'],
-            help='Verbosity level; 0=minimal output, 1=normal output, 2=all 
output'),
-    )
     help = 'Installs the named fixture(s) in the database.'
     args = "fixture [fixture ...]"
 
@@ -28,15 +23,15 @@
 
         verbosity = int(options.get('verbosity', 1))
         show_traceback = options.get('traceback', False)
-        
-        # commit is a stealth option - it isn't really useful as 
+
+        # commit is a stealth option - it isn't really useful as
         # a command line option, but it can be useful when invoking
-        # loaddata from within another script. 
+        # loaddata from within another script.
         # If commit=True, loaddata will use its own transaction;
         # if commit=False, the data load SQL will become part of
         # the transaction in place when loaddata was invoked.
         commit = options.get('commit', True)
-        
+
         # Keep a count of the installed objects and fixtures
         fixture_count = 0
         object_count = 0
@@ -151,7 +146,7 @@
             transaction.rollback()
             transaction.leave_transaction_management()
             return
-            
+
         # If we found even one object in a fixture, we need to reset the
         # database sequences.
         if object_count > 0:
@@ -161,7 +156,7 @@
                     print "Resetting sequences"
                 for line in sequence_sql:
                     cursor.execute(line)
-        
+
         if commit:
             transaction.commit()
             transaction.leave_transaction_management()
@@ -172,7 +167,7 @@
         else:
             if verbosity > 0:
                 print "Installed %d object(s) from %d fixture(s)" % 
(object_count, fixture_count)
-                
+
         # Close the DB connection. This is required as a workaround for an
         # edge case in MySQL: if the same connection is used to
         # create tables, load data, and query, the query can return

Modified: django/trunk/django/core/management/commands/makemessages.py
===================================================================
--- django/trunk/django/core/management/commands/makemessages.py        
2008-10-01 17:26:40 UTC (rev 9109)
+++ django/trunk/django/core/management/commands/makemessages.py        
2008-10-02 12:57:13 UTC (rev 9110)
@@ -170,9 +170,6 @@
             help='Creates or updates the message files only for the given 
locale (e.g. pt_BR).'),
         make_option('--domain', '-d', default='django', dest='domain',
             help='The domain of the message files (default: "django").'),
-        make_option('--verbosity', '-v', action='store', dest='verbosity',
-            default='1', type='choice', choices=['0', '1', '2'],
-            help='Verbosity level; 0=minimal output, 1=normal output, 2=all 
output'),
         make_option('--all', '-a', action='store_true', dest='all',
             default=False, help='Reexamines all source code and templates for 
new translation strings and updates all message files for all available 
languages.'),
         make_option('--extension', '-e', dest='extensions',

Modified: django/trunk/django/core/management/commands/syncdb.py
===================================================================
--- django/trunk/django/core/management/commands/syncdb.py      2008-10-01 
17:26:40 UTC (rev 9109)
+++ django/trunk/django/core/management/commands/syncdb.py      2008-10-02 
12:57:13 UTC (rev 9110)
@@ -10,9 +10,6 @@
 
 class Command(NoArgsCommand):
     option_list = NoArgsCommand.option_list + (
-        make_option('--verbosity', action='store', dest='verbosity', 
default='1',
-            type='choice', choices=['0', '1', '2'],
-            help='Verbosity level; 0=minimal output, 1=normal output, 2=all 
output'),
         make_option('--noinput', action='store_false', dest='interactive', 
default=True,
             help='Tells Django to NOT prompt the user for input of any kind.'),
     )
@@ -41,7 +38,7 @@
                 # but raises an ImportError for some reason. The only way we
                 # can do this is to check the text of the exception. Note that
                 # we're a bit broad in how we check the text, because different
-                # Python implementations may not use the same text. 
+                # Python implementations may not use the same text.
                 # CPython uses the text "No module named management"
                 # PyPy uses "No module named myproject.myapp.management"
                 msg = exc.args[0]
@@ -99,10 +96,10 @@
         # Send the post_syncdb signal, so individual apps can do whatever they 
need
         # to do at this point.
         emit_post_sync_signal(created_models, verbosity, interactive)
-        
+
         # The connection may have been closed by a syncdb handler.
         cursor = connection.cursor()
-        
+
         # Install custom SQL for the app (but only if this
         # is a model we've just created)
         for app in models.get_apps():

Modified: django/trunk/django/core/management/commands/test.py
===================================================================
--- django/trunk/django/core/management/commands/test.py        2008-10-01 
17:26:40 UTC (rev 9109)
+++ django/trunk/django/core/management/commands/test.py        2008-10-02 
12:57:13 UTC (rev 9110)
@@ -4,9 +4,6 @@
 
 class Command(BaseCommand):
     option_list = BaseCommand.option_list + (
-        make_option('--verbosity', action='store', dest='verbosity', 
default='1',
-            type='choice', choices=['0', '1', '2'],
-            help='Verbosity level; 0=minimal output, 1=normal output, 2=all 
output'),
         make_option('--noinput', action='store_false', dest='interactive', 
default=True,
             help='Tells Django to NOT prompt the user for input of any kind.'),
     )
@@ -20,7 +17,7 @@
 
         verbosity = int(options.get('verbosity', 1))
         interactive = options.get('interactive', True)
-    
+
         test_path = settings.TEST_RUNNER.split('.')
         # Allow for Python 2.5 relative paths
         if len(test_path) > 1:

Modified: django/trunk/django/core/management/commands/testserver.py
===================================================================
--- django/trunk/django/core/management/commands/testserver.py  2008-10-01 
17:26:40 UTC (rev 9109)
+++ django/trunk/django/core/management/commands/testserver.py  2008-10-02 
12:57:13 UTC (rev 9110)
@@ -4,10 +4,7 @@
 
 class Command(BaseCommand):
     option_list = BaseCommand.option_list + (
-        make_option('--verbosity', action='store', dest='verbosity', 
default='1',
-            type='choice', choices=['0', '1', '2'],
-            help='Verbosity level; 0=minimal output, 1=normal output, 2=all 
output'),
-        make_option('--addrport', action='store', dest='addrport', 
+        make_option('--addrport', action='store', dest='addrport',
             type='string', default='',
             help='port number or ipaddr:port to run the server on'),
     )

Modified: django/trunk/docs/ref/django-admin.txt
===================================================================
--- django/trunk/docs/ref/django-admin.txt      2008-10-01 17:26:40 UTC (rev 
9109)
+++ django/trunk/docs/ref/django-admin.txt      2008-10-02 12:57:13 UTC (rev 
9110)
@@ -85,17 +85,13 @@
 .. django-admin-option:: --verbosity <amount>
 
 Use ``--verbosity`` to specify the amount of notification and debug information
-that ``django-admin.py`` should print to the console.
+that ``django-admin.py`` should print to the console. For more details, see the
+documentation for the :ref:`default options for django-admin.py 
<django-admin-verbosity>`.
 
-    * ``0`` means no output.
-    * ``1`` means normal output (default).
-    * ``2`` means verbose output.
-
-
 Available subcommands
 =====================
 
-cleanup 
+cleanup
 -------
 
 .. versionadded:: 1.0
@@ -122,7 +118,7 @@
 
     django-admin.py compilemessages --locale=br_PT
 
-createcachetable 
+createcachetable
 ----------------
 
 .. django-admin:: createcachetable <tablename>
@@ -133,7 +129,7 @@
 createsuperuser
 ---------------
 
-.. django-admin:: createsuperuser 
+.. django-admin:: createsuperuser
 
 .. versionadded:: 1.0
 
@@ -182,7 +178,7 @@
 .. django-admin:: diffsettings
 
 Displays differences between the current settings file and Django's default
-settings. 
+settings.
 
 Settings that don't appear in the defaults are followed by ``"###"``. For
 example, the default settings don't define ``ROOT_URLCONF``, so
@@ -367,20 +363,6 @@
     references in your data files - MySQL doesn't provide a mechanism to
     defer checking of row constraints until a transaction is committed.
 
---verbosity
-~~~~~~~~~~~
-
-Use ``--verbosity`` to specify the amount of notification and debug information
-that ``django-admin.py`` should print to the console.
-
-       * ``0`` means no output.
-       * ``1`` means normal output (default).
-       * ``2`` means verbose output.
-
-Example usage::
-
-    django-admin.py loaddata --verbosity=2
-
 makemessages
 ------------
 
@@ -433,23 +415,9 @@
 Use the ``--domain`` or ``-d`` option to change the domain of the messages 
files.
 Currently supported:
 
-       * ``django`` for all ``*.py`` and ``*.html`` files (default) 
+       * ``django`` for all ``*.py`` and ``*.html`` files (default)
        * ``djangojs`` for ``*.js`` files
 
---verbosity
-~~~~~~~~~~~
-
-Use ``--verbosity`` or ``-v`` to specify the amount of notification and debug
-information that ``django-admin.py`` should print to the console.
-
-       * ``0`` means no output.
-       * ``1`` means normal output (default).
-       * ``2`` means verbose output.
-
-Example usage::
-
-    django-admin.py makemessages --verbosity=2
-
 reset <appname appname ...>
 ---------------------------
 
@@ -685,20 +653,6 @@
 documentation for ``loaddata`` for details on the specification of fixture
 data files.
 
---verbosity
-~~~~~~~~~~~
-
-Use ``--verbosity`` to specify the amount of notification and debug information
-that ``django-admin.py`` should print to the console.
-
-       * ``0`` means no output.
-       * ``1`` means normal output (default).
-       * ``2`` means verbose output.
-
-Example usage::
-
-    django-admin.py syncdb --verbosity=2
-
 --noinput
 ~~~~~~~~~
 
@@ -719,20 +673,6 @@
 "Are you sure?" confirmation messages. This is useful if ``django-admin.py``
 is being executed as an unattended, automated script.
 
---verbosity
-~~~~~~~~~~~
-
-Use ``--verbosity`` to specify the amount of notification and debug information
-that ``django-admin.py`` should print to the console.
-
-       * ``0`` means no output.
-       * ``1`` means normal output (default).
-       * ``2`` means verbose output.
-
-Example usage::
-
-    django-admin.py test --verbosity=2
-
 testserver <fixture fixture ...>
 --------------------------------
 
@@ -793,20 +733,6 @@
 
     django-admin.py testserver --addrport 1.2.3.4:7000 test
 
---verbosity
-~~~~~~~~~~~
-
-Use ``--verbosity`` to specify the amount of notification and debug information
-that ``django-admin.py`` should print to the console.
-
-       * ``0`` means no output.
-       * ``1`` means normal output (default).
-       * ``2`` means verbose output.
-
-Example usage::
-
-    django-admin.py testserver --verbosity=2
-
 validate
 --------
 
@@ -861,6 +787,22 @@
 error occurs. If you specify ``--traceback``, ``django-admin.py``  will
 output a full stack trace whenever an exception is raised.
 
+.. _django-admin-verbosity:
+
+--verbosity
+-----------
+
+Example usage::
+
+    django-admin.py syncdb --verbosity 2
+
+Use ``--verbosity`` to specify the amount of notification and debug information
+that ``django-admin.py`` should print to the console.
+
+    * ``0`` means no output.
+    * ``1`` means normal output (default).
+    * ``2`` means verbose output.
+
 Extra niceties
 ==============
 
@@ -887,4 +829,4 @@
 
 
 
-See :ref:`howto-custom-management-commands` for how to add customized actions. 
+See :ref:`howto-custom-management-commands` for how to add customized actions.

Modified: django/trunk/docs/ref/signals.txt
===================================================================
--- django/trunk/docs/ref/signals.txt   2008-10-01 17:26:40 UTC (rev 9109)
+++ django/trunk/docs/ref/signals.txt   2008-10-02 12:57:13 UTC (rev 9110)
@@ -212,7 +212,7 @@
 
     ``verbosity``
         Indicates how much information manage.py is printing on screen. See
-        the :djadminopt:`--verbosity`` flag for details.
+        the :djadminopt:`--verbosity` flag for details.
 
         Functions which listen for :data:`post_syncdb` should adjust what they
         output to the screen based on the value of this argument.

Modified: django/trunk/tests/runtests.py
===================================================================
--- django/trunk/tests/runtests.py      2008-10-01 17:26:40 UTC (rev 9109)
+++ django/trunk/tests/runtests.py      2008-10-02 12:57:13 UTC (rev 9110)
@@ -142,12 +142,12 @@
         if not test_labels or model_name in test_labels:
             extra_tests.append(InvalidModelTestCase(model_label))
             try:
-                # Invalid models are not working apps, so we cannot pass them 
into 
+                # Invalid models are not working apps, so we cannot pass them 
into
                 # the test runner with the other test_labels
                 test_labels.remove(model_name)
             except ValueError:
                 pass
-    
+
     # Run the test suite, including the extra validation tests.
     from django.test.simple import run_tests
     failures = run_tests(test_labels, verbosity=verbosity, 
interactive=interactive, extra_tests=extra_tests)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to