Changeset 9110
- Timestamp:
- 10/02/08 07:57:13 (3 months ago)
- Files:
-
- django/trunk/django/core/management/base.py (modified) (2 diffs)
- django/trunk/django/core/management/commands/flush.py (modified) (1 diff)
- django/trunk/django/core/management/commands/loaddata.py (modified) (5 diffs)
- django/trunk/django/core/management/commands/makemessages.py (modified) (1 diff)
- django/trunk/django/core/management/commands/syncdb.py (modified) (3 diffs)
- django/trunk/django/core/management/commands/test.py (modified) (2 diffs)
- django/trunk/django/core/management/commands/testserver.py (modified) (1 diff)
- django/trunk/docs/ref/django-admin.txt (modified) (11 diffs)
- django/trunk/docs/ref/signals.txt (modified) (1 diff)
- django/trunk/tests/runtests.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/management/base.py
r9082 r9110 122 122 # Metadata about this command. 123 123 option_list = ( 124 make_option('-v', '--verbosity', action='store', dest='verbosity', default='1', 125 type='choice', choices=['0', '1', '2'], 126 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'), 124 127 make_option('--settings', 125 128 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.'), … … 210 213 translation.activate('en-us') 211 214 except ImportError, e: 212 # If settings should be available, but aren't, 215 # If settings should be available, but aren't, 213 216 # raise the error and quit. 214 217 sys.stderr.write(self.style.ERROR(str('Error: %s\n' % e))) django/trunk/django/core/management/commands/flush.py
r8223 r9110 5 5 class Command(NoArgsCommand): 6 6 option_list = NoArgsCommand.option_list + ( 7 make_option('--verbosity', action='store', dest='verbosity', default='1',8 type='choice', choices=['0', '1', '2'],9 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),10 7 make_option('--noinput', action='store_false', dest='interactive', default=True, 11 8 help='Tells Django to NOT prompt the user for input of any kind.'), django/trunk/django/core/management/commands/loaddata.py
r8336 r9110 11 11 12 12 class Command(BaseCommand): 13 option_list = BaseCommand.option_list + (14 make_option('--verbosity', action='store', dest='verbosity', default='1',15 type='choice', choices=['0', '1', '2'],16 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),17 )18 13 help = 'Installs the named fixture(s) in the database.' 19 14 args = "fixture [fixture ...]" … … 29 24 verbosity = int(options.get('verbosity', 1)) 30 25 show_traceback = options.get('traceback', False) 31 32 # commit is a stealth option - it isn't really useful as 26 27 # commit is a stealth option - it isn't really useful as 33 28 # a command line option, but it can be useful when invoking 34 # loaddata from within another script. 29 # loaddata from within another script. 35 30 # If commit=True, loaddata will use its own transaction; 36 31 # if commit=False, the data load SQL will become part of 37 32 # the transaction in place when loaddata was invoked. 38 33 commit = options.get('commit', True) 39 34 40 35 # Keep a count of the installed objects and fixtures 41 36 fixture_count = 0 … … 152 147 transaction.leave_transaction_management() 153 148 return 154 149 155 150 # If we found even one object in a fixture, we need to reset the 156 151 # database sequences. … … 162 157 for line in sequence_sql: 163 158 cursor.execute(line) 164 159 165 160 if commit: 166 161 transaction.commit() … … 173 168 if verbosity > 0: 174 169 print "Installed %d object(s) from %d fixture(s)" % (object_count, fixture_count) 175 170 176 171 # Close the DB connection. This is required as a workaround for an 177 172 # edge case in MySQL: if the same connection is used to django/trunk/django/core/management/commands/makemessages.py
r8576 r9110 171 171 make_option('--domain', '-d', default='django', dest='domain', 172 172 help='The domain of the message files (default: "django").'), 173 make_option('--verbosity', '-v', action='store', dest='verbosity',174 default='1', type='choice', choices=['0', '1', '2'],175 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),176 173 make_option('--all', '-a', action='store_true', dest='all', 177 174 default=False, help='Reexamines all source code and templates for new translation strings and updates all message files for all available languages.'), django/trunk/django/core/management/commands/syncdb.py
r8296 r9110 11 11 class Command(NoArgsCommand): 12 12 option_list = NoArgsCommand.option_list + ( 13 make_option('--verbosity', action='store', dest='verbosity', default='1',14 type='choice', choices=['0', '1', '2'],15 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),16 13 make_option('--noinput', action='store_false', dest='interactive', default=True, 17 14 help='Tells Django to NOT prompt the user for input of any kind.'), … … 42 39 # can do this is to check the text of the exception. Note that 43 40 # we're a bit broad in how we check the text, because different 44 # Python implementations may not use the same text. 41 # Python implementations may not use the same text. 45 42 # CPython uses the text "No module named management" 46 43 # PyPy uses "No module named myproject.myapp.management" … … 100 97 # to do at this point. 101 98 emit_post_sync_signal(created_models, verbosity, interactive) 102 99 103 100 # The connection may have been closed by a syncdb handler. 104 101 cursor = connection.cursor() 105 102 106 103 # Install custom SQL for the app (but only if this 107 104 # is a model we've just created) django/trunk/django/core/management/commands/test.py
r8046 r9110 5 5 class Command(BaseCommand): 6 6 option_list = BaseCommand.option_list + ( 7 make_option('--verbosity', action='store', dest='verbosity', default='1',8 type='choice', choices=['0', '1', '2'],9 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'),10 7 make_option('--noinput', action='store_false', dest='interactive', default=True, 11 8 help='Tells Django to NOT prompt the user for input of any kind.'), … … 21 18 verbosity = int(options.get('verbosity', 1)) 22 19 interactive = options.get('interactive', True) 23 20 24 21 test_path = settings.TEST_RUNNER.split('.') 25 22 # Allow for Python 2.5 relative paths django/trunk/django/core/management/commands/testserver.py
r8296 r9110 5 5 class Command(BaseCommand): 6 6 option_list = BaseCommand.option_list + ( 7 make_option('--verbosity', action='store', dest='verbosity', default='1', 8 type='choice', choices=['0', '1', '2'], 9 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'), 10 make_option('--addrport', action='store', dest='addrport', 7 make_option('--addrport', action='store', dest='addrport', 11 8 type='string', default='', 12 9 help='port number or ipaddr:port to run the server on'), django/trunk/docs/ref/django-admin.txt
r8987 r9110 86 86 87 87 Use ``--verbosity`` to specify the amount of notification and debug information 88 that ``django-admin.py`` should print to the console. 89 90 * ``0`` means no output. 91 * ``1`` means normal output (default). 92 * ``2`` means verbose output. 93 88 that ``django-admin.py`` should print to the console. For more details, see the 89 documentation for the :ref:`default options for django-admin.py <django-admin-verbosity>`. 94 90 95 91 Available subcommands 96 92 ===================== 97 93 98 cleanup 94 cleanup 99 95 ------- 100 96 … … 123 119 django-admin.py compilemessages --locale=br_PT 124 120 125 createcachetable 121 createcachetable 126 122 ---------------- 127 123 … … 134 130 --------------- 135 131 136 .. django-admin:: createsuperuser 132 .. django-admin:: createsuperuser 137 133 138 134 .. versionadded:: 1.0 … … 183 179 184 180 Displays differences between the current settings file and Django's default 185 settings. 181 settings. 186 182 187 183 Settings that don't appear in the defaults are followed by ``"###"``. For … … 368 364 defer checking of row constraints until a transaction is committed. 369 365 370 --verbosity371 ~~~~~~~~~~~372 373 Use ``--verbosity`` to specify the amount of notification and debug information374 that ``django-admin.py`` should print to the console.375 376 * ``0`` means no output.377 * ``1`` means normal output (default).378 * ``2`` means verbose output.379 380 Example usage::381 382 django-admin.py loaddata --verbosity=2383 384 366 makemessages 385 367 ------------ … … 434 416 Currently supported: 435 417 436 * ``django`` for all ``*.py`` and ``*.html`` files (default) 418 * ``django`` for all ``*.py`` and ``*.html`` files (default) 437 419 * ``djangojs`` for ``*.js`` files 438 439 --verbosity440 ~~~~~~~~~~~441 442 Use ``--verbosity`` or ``-v`` to specify the amount of notification and debug443 information that ``django-admin.py`` should print to the console.444 445 * ``0`` means no output.446 * ``1`` means normal output (default).447 * ``2`` means verbose output.448 449 Example usage::450 451 django-admin.py makemessages --verbosity=2452 420 453 421 reset <appname appname ...> … … 686 654 data files. 687 655 688 --verbosity689 ~~~~~~~~~~~690 691 Use ``--verbosity`` to specify the amount of notification and debug information692 that ``django-admin.py`` should print to the console.693 694 * ``0`` means no output.695 * ``1`` means normal output (default).696 * ``2`` means verbose output.697 698 Example usage::699 700 django-admin.py syncdb --verbosity=2701 702 656 --noinput 703 657 ~~~~~~~~~ … … 719 673 "Are you sure?" confirmation messages. This is useful if ``django-admin.py`` 720 674 is being executed as an unattended, automated script. 721 722 --verbosity723 ~~~~~~~~~~~724 725 Use ``--verbosity`` to specify the amount of notification and debug information726 that ``django-admin.py`` should print to the console.727 728 * ``0`` means no output.729 * ``1`` means normal output (default).730 * ``2`` means verbose output.731 732 Example usage::733 734 django-admin.py test --verbosity=2735 675 736 676 testserver <fixture fixture ...> … … 794 734 django-admin.py testserver --addrport 1.2.3.4:7000 test 795 735 796 --verbosity797 ~~~~~~~~~~~798 799 Use ``--verbosity`` to specify the amount of notification and debug information800 that ``django-admin.py`` should print to the console.801 802 * ``0`` means no output.803 * ``1`` means normal output (default).804 * ``2`` means verbose output.805 806 Example usage::807 808 django-admin.py testserver --verbosity=2809 810 736 validate 811 737 -------- … … 862 788 output a full stack trace whenever an exception is raised. 863 789 790 .. _django-admin-verbosity: 791 792 --verbosity 793 ----------- 794 795 Example usage:: 796 797 django-admin.py syncdb --verbosity 2 798 799 Use ``--verbosity`` to specify the amount of notification and debug information 800 that ``django-admin.py`` should print to the console. 801 802 * ``0`` means no output. 803 * ``1`` means normal output (default). 804 * ``2`` means verbose output. 805 864 806 Extra niceties 865 807 ============== … … 888 830 889 831 890 See :ref:`howto-custom-management-commands` for how to add customized actions. 832 See :ref:`howto-custom-management-commands` for how to add customized actions. django/trunk/docs/ref/signals.txt
r8977 r9110 213 213 ``verbosity`` 214 214 Indicates how much information manage.py is printing on screen. See 215 the :djadminopt:`--verbosity` `flag for details.215 the :djadminopt:`--verbosity` flag for details. 216 216 217 217 Functions which listen for :data:`post_syncdb` should adjust what they django/trunk/tests/runtests.py
r8731 r9110 143 143 extra_tests.append(InvalidModelTestCase(model_label)) 144 144 try: 145 # Invalid models are not working apps, so we cannot pass them into 145 # Invalid models are not working apps, so we cannot pass them into 146 146 # the test runner with the other test_labels 147 147 test_labels.remove(model_name) 148 148 except ValueError: 149 149 pass 150 150 151 151 # Run the test suite, including the extra validation tests. 152 152 from django.test.simple import run_tests
