Update the management commands to be compatible with Django 1.6+.
Review Request #8680 — Created Jan. 30, 2017 and submitted
Newer versions of Django switched to using ArgumentParser instead of OptionParser for arguments to management commands, and got rid of NoArgsCommand. While ArgumentParser and OptionParser are fairly compatible for most things, the changes to how options are registered in Django management commands were fairly extensive, making it harder to keep compatibility with both. This change introduces a compatibility class for management commands that allows the commands to code for the new style of argument registration, while providing compatibility with the OptionParsers used in Django 1.6. This can be used by projects that need to keep compatibility between the two. The management commands that ship with Djblets have been updated to use the new class and new style of argument registration.
Tested each command on Django 1.6, 1.8, and 1.10.
- Change Summary:
-
- Removed an old comment that shouldn't have been kept.
- Removed an extra blank line.
- Commit:
-
0ac324e7fc5a738c3be03384a6e08ff140343dc65489521e505a38fce29d0bd820ea5911e58752ae
- Diff:
-
Revision 2 (+188 -33)
-
Tool: Pyflakes Processed Files: djblets/siteconfig/management/commands/get-siteconfig.py djblets/siteconfig/management/commands/list-siteconfig.py djblets/siteconfig/management/commands/set-siteconfig.py djblets/util/compat/django/core/management/base.py djblets/extensions/management/commands/install-extension-media.py Ignored Files: djblets/util/compat/django/core/management/__init__.py Tool: PEP8 Style Checker Processed Files: djblets/siteconfig/management/commands/get-siteconfig.py djblets/siteconfig/management/commands/list-siteconfig.py djblets/siteconfig/management/commands/set-siteconfig.py djblets/util/compat/django/core/management/base.py djblets/extensions/management/commands/install-extension-media.py Ignored Files: djblets/util/compat/django/core/management/__init__.py