diff options
author | Jelle van der Waa <jelle@vdwaa.nl> | 2018-01-01 18:38:15 +0100 |
---|---|---|
committer | Jelle van der Waa <jelle@vdwaa.nl> | 2018-04-08 12:51:19 +0200 |
commit | 2b42b8c465a40e9e0ee424beac5a9a1a0ce3fe09 (patch) | |
tree | 68cb094f8dcd4eb7225037bb18ff088bee23e7c5 /devel | |
parent | 13eccfe63c7543eb5c3934c580dc6899a9913446 (diff) | |
download | archweb-2b42b8c465a40e9e0ee424beac5a9a1a0ce3fe09.tar.gz archweb-2b42b8c465a40e9e0ee424beac5a9a1a0ce3fe09.zip |
reporead: Fix compatibility with Django 1.9
Django 1.9 removed the option_list and requires an add_arguments to be
overloaded to specify the arguments.
Diffstat (limited to 'devel')
-rw-r--r-- | devel/management/commands/reporead.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 3c24b5d3..01fb926c 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -48,14 +48,22 @@ logging.addLevelName(TRACE, 'TRACE') logger = logging.getLogger() class Command(BaseCommand): - option_list = BaseCommand.option_list + ( - make_option('-f', '--force', action='store_true', dest='force', default=False, - help='Force a re-import of data for all packages instead of only new ones. Will not touch the \'last updated\' value.'), - make_option('--filesonly', action='store_true', dest='filesonly', default=False, - help='Load filelists if they are outdated, but will not add or remove any packages. Will not touch the \'last updated\' value.'), - ) help = "Runs a package repository import for the given arch and file." - args = "<arch> <filename>" + missing_args_message = 'missing arch and file.' + + def add_arguments(self, parser): + parser.add_argument('args', nargs='*', help='<arch> <filename>') + parser.add_argument('--force', + action='store_true', + dest='force', + default=False, + help='Force a re-import of data for all packages instead of only new ones. Will not touch the \'last updated\' value.') + + parser.add_argument('--filesonly', + action='store_true', + dest='filesonly', + default=False, + help='Load filelists if they are outdated, but will not add or remove any packages. Will not touch the \'last updated\' value.') def handle(self, arch=None, filename=None, **options): if not arch: |