Files
edx-platform/lms/djangoapps/courseware/management/commands/dump_course_ids.py
Feanil Patel 9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00

28 lines
727 B
Python

"""
Dump the course_ids available to the lms.
Output is UTF-8 encoded by default.
"""
from textwrap import dedent
from django.core.management.base import BaseCommand
from six import text_type
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
class Command(BaseCommand):
help = dedent(__doc__).strip()
def add_arguments(self, parser):
parser.add_argument('--modulestore',
default='default',
help='name of the modulestore to use')
def handle(self, *args, **options):
output = '\n'.join(text_type(course_overview.id) for course_overview in CourseOverview.get_all_courses()) + '\n'
return output