lms.djangoapps.courseware.management.commands package#

Submodules#

lms.djangoapps.courseware.management.commands.clean_xml module#

Contains functions that handle XML course data

class lms.djangoapps.courseware.management.commands.clean_xml.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)#

The actual logic of the command. Subclasses must implement this method.

help = 'Imports specified course, validates it, then exports it in a canonical format.'#
lms.djangoapps.courseware.management.commands.clean_xml.check_roundtrip(course_dir)#

Check that import->export leaves the course the same

lms.djangoapps.courseware.management.commands.clean_xml.export(course, export_dir)#

Export the specified course to course_dir. Creates dir if it doesn’t exist. Overwrites files, does not clean out dir beforehand.

lms.djangoapps.courseware.management.commands.clean_xml.import_with_checks(course_dir)#
lms.djangoapps.courseware.management.commands.clean_xml.traverse_tree(course)#

Load every block in course. Return bool success value.

lms.djangoapps.courseware.management.commands.dump_course_ids module#

Dump the course_ids available to the lms.

Output is UTF-8 encoded by default.

class lms.djangoapps.courseware.management.commands.dump_course_ids.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)#

The actual logic of the command. Subclasses must implement this method.

help = 'Dump the course_ids available to the lms.\n\nOutput is UTF-8 encoded by default.'#

lms.djangoapps.courseware.management.commands.dump_course_ids_with_filter module#

Dump the course_ids available to the lms, excluding courses that have ended prior to the given date.

Output is UTF-8 encoded by default. The output format is one course_id per line.

class lms.djangoapps.courseware.management.commands.dump_course_ids_with_filter.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)#

The actual logic of the command. Subclasses must implement this method.

help = 'Dump the course_ids available to the lms, excluding courses\nthat have ended prior to the given date.\n\nOutput is UTF-8 encoded by default.\nThe output format is one course_id per line.'#

lms.djangoapps.courseware.management.commands.dump_course_structure module#

Dump the structure of a course as a JSON object.

The resulting JSON object has one entry for each block in the course:

{
“$block_url”: {

“category”: “$block_category”, “children”: [$block_children_urls… ], “metadata”: {$block_metadata}

},

“$block_url”: …. …

}

class lms.djangoapps.courseware.management.commands.dump_course_structure.Command(stdout=None, stderr=None, no_color=False, force_color=False)#

Bases: BaseCommand

add_arguments(parser)#

Entry point for subclassed commands to add custom arguments.

handle(*args, **options)#

The actual logic of the command. Subclasses must implement this method.

help = 'Dump the structure of a course as a JSON object.\n\nThe resulting JSON object has one entry for each block in the course:\n\n{\n  "$block_url": {\n    "category": "$block_category",\n    "children": [$block_children_urls... ],\n    "metadata": {$block_metadata}\n  },\n\n  "$block_url": ....\n  ...\n}'#
lms.djangoapps.courseware.management.commands.dump_course_structure.dump_block(block, destination=None, inherited=False, defaults=False)#

Add the block and all its children to the destination dictionary in as a flat structure.

Module contents#