'Given a course id(old or new style), and an output_path folder.  Export the
corresponding course from mongo and put it directly in the folder.'

def handle(self, *args, **options):

    try:
        course_key = CourseKey.from_string(options['course_id'])
    except InvalidKeyError:
        try:
            course_key = SlashSeparatedCourseKey.from_deprecated_string(options['course_id'])
        except InvalidKeyError:
            raise CommandError(("Invalid    course_key:    '%s'." % options['course_id']))
    if (not modulestore().get_course(course_key)):
        raise CommandError(('Course    with    %s    key    not    found.' % options['course_id']))
    output_path = options['output_path']
    print 'Exporting    course    id    =    {0}    to    {1}'.format(course_key, output_path)
    if (not output_path.endswith('/')):
        output_path += '/'
    root_dir = os.path.dirname(output_path)
    course_dir = os.path.splitext(os.path.basename(output_path))[0]
    export_course_to_xml(modulestore(), contentstore(), course_key, root_dir, course_dir)
