Ticket #13760: remove-dupe-defaults.diff

File remove-dupe-defaults.diff, 12.7 KB (added by Adam Vandenberg, 14 years ago)

Remove duplicated default option values.

  • django/core/management/commands/createcachetable.py

    diff --git a/django/core/management/commands/createcachetable.py b/django/core/management/commands/createcachetable.py
    index 90172b6..a6628a0 100644
    a b class Command(LabelCommand):  
    1818    requires_model_validation = False
    1919
    2020    def handle_label(self, tablename, **options):
    21         alias = options.get('database', DEFAULT_DB_ALIAS)
     21        alias = options.get('database')
    2222        connection = connections[alias]
    2323        fields = (
    2424            # "key" is a reserved word in MySQL, so use "cache_key" instead.
  • django/core/management/commands/dbshell.py

    diff --git a/django/core/management/commands/dbshell.py b/django/core/management/commands/dbshell.py
    index a6b5427..7465920 100644
    a b class Command(BaseCommand):  
    1616    requires_model_validation = False
    1717
    1818    def handle(self, **options):
    19         connection = connections[options.get('database', DEFAULT_DB_ALIAS)]
     19        connection = connections[options.get('database')]
    2020        try:
    2121            connection.client.runshell()
    2222        except OSError:
  • django/core/management/commands/dumpdata.py

    diff --git a/django/core/management/commands/dumpdata.py b/django/core/management/commands/dumpdata.py
    index 706bf60..162135a 100644
    a b class Command(BaseCommand):  
    3030    def handle(self, *app_labels, **options):
    3131        from django.db.models import get_app, get_apps, get_models, get_model
    3232
    33         format = options.get('format','json')
    34         indent = options.get('indent',None)
    35         using = options.get('database', DEFAULT_DB_ALIAS)
     33        format = options.get('format')
     34        indent = options.get('indent')
     35        using = options.get('database')
    3636        connection = connections[using]
    37         excludes = options.get('exclude',[])
    38         show_traceback = options.get('traceback', False)
    39         use_natural_keys = options.get('use_natural_keys', False)
    40         use_base_manager = options.get('use_base_manager', False)
     37        excludes = options.get('exclude')
     38        show_traceback = options.get('traceback')
     39        use_natural_keys = options.get('use_natural_keys')
     40        use_base_manager = options.get('use_base_manager')
    4141
    4242        excluded_apps = set()
    4343        excluded_models = set()
  • django/core/management/commands/flush.py

    diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
    index bcadb96..4eb329a 100644
    a b class Command(NoArgsCommand):  
    2020    help = "Executes ``sqlflush`` on the current database."
    2121
    2222    def handle_noargs(self, **options):
    23         db = options.get('database', DEFAULT_DB_ALIAS)
     23        db = options.get('database')
    2424        connection = connections[db]
    25         verbosity = int(options.get('verbosity', 1))
     25        verbosity = int(options.get('verbosity'))
    2626        interactive = options.get('interactive')
    2727
    2828        self.style = no_style()
  • django/core/management/commands/inspectdb.py

    diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
    index e45f22c..27c4f0f 100644
    a b class Command(NoArgsCommand):  
    2525            raise CommandError("Database inspection isn't supported for the currently selected database backend.")
    2626
    2727    def handle_inspection(self, options):
    28         connection = connections[options.get('database', DEFAULT_DB_ALIAS)]
     28        connection = connections[options.get('database')]
    2929
    3030        table2model = lambda table_name: table_name.title().replace('_', '').replace(' ', '').replace('-', '')
    3131
  • django/core/management/commands/loaddata.py

    diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
    index 34f3543..2ca8db2 100644
    a b class Command(BaseCommand):  
    2929    )
    3030
    3131    def handle(self, *fixture_labels, **options):
    32         using = options.get('database', DEFAULT_DB_ALIAS)
     32        using = options.get('database')
    3333
    3434        connection = connections[using]
    3535        self.style = no_style()
    3636
    37         verbosity = int(options.get('verbosity', 1))
    38         show_traceback = options.get('traceback', False)
     37        verbosity = int(options.get('verbosity'))
     38        show_traceback = options.get('traceback')
    3939
    4040        # commit is a stealth option - it isn't really useful as
    4141        # a command line option, but it can be useful when invoking
  • django/core/management/commands/reset.py

    diff --git a/django/core/management/commands/reset.py b/django/core/management/commands/reset.py
    index 475fd25..916af7f 100644
    a b class Command(AppCommand):  
    2020    output_transaction = True
    2121
    2222    def handle_app(self, app, **options):
    23         using = options.get('database', DEFAULT_DB_ALIAS)
     23        using = options.get('database')
    2424        connection = connections[using]
    2525
    2626        app_name = app.__name__.split('.')[-2]
  • django/core/management/commands/runserver.py

    diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
    index 892250f..4dac111 100644
    a b class Command(BaseRunserverCommand):  
    112112        Serves admin media like old-school (deprecation pending).
    113113        """
    114114        handler = super(Command, self).get_handler(*args, **options)
    115         return AdminMediaHandler(handler, options.get('admin_media_path', ''))
     115        return AdminMediaHandler(handler, options.get('admin_media_path'))
  • django/core/management/commands/sql.py

    diff --git a/django/core/management/commands/sql.py b/django/core/management/commands/sql.py
    index 582bc8e..59b2e77 100644
    a b class Command(AppCommand):  
    1616    output_transaction = True
    1717
    1818    def handle_app(self, app, **options):
    19         return u'\n'.join(sql_create(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
     19        return u'\n'.join(sql_create(app, self.style, connections[options.get('database')])).encode('utf-8')
  • django/core/management/commands/sqlall.py

    diff --git a/django/core/management/commands/sqlall.py b/django/core/management/commands/sqlall.py
    index 8f3a38e..ab702bf 100644
    a b class Command(AppCommand):  
    1616    output_transaction = True
    1717
    1818    def handle_app(self, app, **options):
    19         return u'\n'.join(sql_all(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
     19        return u'\n'.join(sql_all(app, self.style, connections[options.get('database')])).encode('utf-8')
  • django/core/management/commands/sqlclear.py

    diff --git a/django/core/management/commands/sqlclear.py b/django/core/management/commands/sqlclear.py
    index c7e3a5e..b8f4913 100644
    a b class Command(AppCommand):  
    1616    output_transaction = True
    1717
    1818    def handle_app(self, app, **options):
    19         return u'\n'.join(sql_delete(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
     19        return u'\n'.join(sql_delete(app, self.style, connections[options.get('database')])).encode('utf-8')
  • django/core/management/commands/sqlcustom.py

    diff --git a/django/core/management/commands/sqlcustom.py b/django/core/management/commands/sqlcustom.py
    index d206b04..6a98456 100644
    a b class Command(AppCommand):  
    1616    output_transaction = True
    1717
    1818    def handle_app(self, app, **options):
    19         return u'\n'.join(sql_custom(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
     19        return u'\n'.join(sql_custom(app, self.style, connections[options.get('database')])).encode('utf-8')
  • django/core/management/commands/sqlflush.py

    diff --git a/django/core/management/commands/sqlflush.py b/django/core/management/commands/sqlflush.py
    index 004f0a5..19054fb 100644
    a b class Command(NoArgsCommand):  
    1616    output_transaction = True
    1717
    1818    def handle_noargs(self, **options):
    19         return u'\n'.join(sql_flush(self.style, connections[options.get('database', DEFAULT_DB_ALIAS)], only_django=True)).encode('utf-8')
     19        return u'\n'.join(sql_flush(self.style, connections[options.get('database')], only_django=True)).encode('utf-8')
  • django/core/management/commands/sqlindexes.py

    diff --git a/django/core/management/commands/sqlindexes.py b/django/core/management/commands/sqlindexes.py
    index c889f03..bf55b0d 100644
    a b class Command(AppCommand):  
    1717    output_transaction = True
    1818
    1919    def handle_app(self, app, **options):
    20         return u'\n'.join(sql_indexes(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
     20        return u'\n'.join(sql_indexes(app, self.style, connections[options.get('database')])).encode('utf-8')
  • django/core/management/commands/sqlreset.py

    diff --git a/django/core/management/commands/sqlreset.py b/django/core/management/commands/sqlreset.py
    index 13f40de..976b848 100644
    a b class Command(AppCommand):  
    1717    output_transaction = True
    1818
    1919    def handle_app(self, app, **options):
    20         return u'\n'.join(sql_reset(app, self.style, connections[options.get('database', DEFAULT_DB_ALIAS)])).encode('utf-8')
     20        return u'\n'.join(sql_reset(app, self.style, connections[options.get('database')])).encode('utf-8')
  • django/core/management/commands/sqlsequencereset.py

    diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py
    index aaab38b..6460f00 100644
    a b class Command(AppCommand):  
    1616    output_transaction = True
    1717
    1818    def handle_app(self, app, **options):
    19         connection = connections[options.get('database', DEFAULT_DB_ALIAS)]
     19        connection = connections[options.get('database')]
    2020        return u'\n'.join(connection.ops.sequence_reset_sql(self.style, models.get_models(app, include_auto_created=True))).encode('utf-8')
  • django/core/management/commands/syncdb.py

    diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py
    index 3c11a26..5602246 100644
    a b class Command(NoArgsCommand):  
    2222
    2323    def handle_noargs(self, **options):
    2424
    25         verbosity = int(options.get('verbosity', 1))
     25        verbosity = int(options.get('verbosity'))
    2626        interactive = options.get('interactive')
    27         show_traceback = options.get('traceback', False)
     27        show_traceback = options.get('traceback')
    2828
    2929        self.style = no_style()
    3030
    class Command(NoArgsCommand):  
    4747                if not msg.startswith('No module named') or 'management' not in msg:
    4848                    raise
    4949
    50         db = options.get('database', DEFAULT_DB_ALIAS)
     50        db = options.get('database')
    5151        connection = connections[db]
    5252        cursor = connection.cursor()
    5353
  • django/core/management/commands/test.py

    diff --git a/django/core/management/commands/test.py b/django/core/management/commands/test.py
    index 1431f00..c4924ba 100644
    a b class Command(BaseCommand):  
    1818        from django.conf import settings
    1919        from django.test.utils import get_runner
    2020
    21         verbosity = int(options.get('verbosity', 1))
    22         interactive = options.get('interactive', True)
    23         failfast = options.get('failfast', False)
     21        verbosity = int(options.get('verbosity'))
     22        interactive = options.get('interactive')
     23        failfast = options.get('failfast')
    2424        TestRunner = get_runner(settings)
    2525
    2626        if hasattr(TestRunner, 'func_name'):
  • django/core/management/commands/testserver.py

    diff --git a/django/core/management/commands/testserver.py b/django/core/management/commands/testserver.py
    index d3d9698..b0ff768 100644
    a b class Command(BaseCommand):  
    1919        from django.core.management import call_command
    2020        from django.db import connection
    2121
    22         verbosity = int(options.get('verbosity', 1))
    23         interactive = options.get('interactive', True)
     22        verbosity = int(options.get('verbosity'))
     23        interactive = options.get('interactive')
    2424        addrport = options.get('addrport')
    2525
    2626        # Create a test database.
Back to Top