Files
edx-platform/cms/djangoapps/contentstore/management/commands/xlint.py
M. Zulqarnain da970bf215 BOM-2369 (B): Pyupgrade on contentstore/management (#26758)
* pyupgrade on contentstore/management
2021-03-04 14:31:10 +05:00

35 lines
995 B
Python

"""
Verify the structure of courseware as to it's suitability for import
"""
from argparse import REMAINDER
from django.core.management.base import BaseCommand
from xmodule.modulestore.xml_importer import perform_xlint
class Command(BaseCommand):
"""Verify the structure of courseware as to its suitability for import"""
help = """
Verify the structure of courseware as to its suitability for import.
To run: manage.py cms <data directory> [<course dir>...]
"""
def add_arguments(self, parser):
parser.add_argument('data_dir')
parser.add_argument('source_dirs', nargs=REMAINDER)
def handle(self, *args, **options):
"""Execute the command"""
data_dir = options['data_dir']
source_dirs = options['source_dirs']
print("Importing. Data_dir={data}, source_dirs={courses}".format(
data=data_dir,
courses=source_dirs))
perform_xlint(data_dir, source_dirs, load_error_modules=False)