diff --git a/cms/djangoapps/contentstore/views/__init__.py b/cms/djangoapps/contentstore/views/__init__.py index 0da8a15707..8a1ebc4dff 100644 --- a/cms/djangoapps/contentstore/views/__init__.py +++ b/cms/djangoapps/contentstore/views/__init__.py @@ -1,15 +1,11 @@ # pylint: disable=W0401, W0511 -# TODO: component.py should explicitly enumerate exports with __all__ -from .component import * - -# TODO: course.py should explicitly enumerate exports with __all__ -from .course import * - # Disable warnings about import from wildcard # All files below declare exports with __all__ from .assets import * from .checklist import * +from .component import * +from .course import * from .error import * from .item import * from .preview import * diff --git a/cms/djangoapps/contentstore/views/assets.py b/cms/djangoapps/contentstore/views/assets.py index 0ae09fbd70..1e818f607a 100644 --- a/cms/djangoapps/contentstore/views/assets.py +++ b/cms/djangoapps/contentstore/views/assets.py @@ -149,9 +149,9 @@ def import_course(request, org, course, name): location = get_location_and_verify_access(request, org, course, name) if request.method == 'POST': - filenames = request.FILES['course-data'].name + filename = request.FILES['course-data'].name - if not filenames.endswith('.tar.gz'): + if not filename.endswith('.tar.gz'): return HttpResponse(json.dumps({'ErrMsg': 'We only support uploading a .tar.gz file.'})) data_root = path(settings.GITHUB_REPO_ROOT) @@ -161,7 +161,7 @@ def import_course(request, org, course, name): if not course_dir.isdir(): os.mkdir(course_dir) - temp_filepath = course_dir / filenames + temp_filepath = course_dir / filename logging.debug('importing course to {0}'.format(temp_filepath)) diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 18253925e1..7d014448ba 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -26,9 +26,15 @@ from models.settings.course_grading import CourseGradingModel from .requests import get_request_method, _xmodule_recurse from .access import has_access -# TODO: should explicitly enumerate exports with __all__ - -# to install PIL on MacOSX: 'easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz' +__all__ = ['OPEN_ENDED_COMPONENT_TYPES', + 'ADVANCED_COMPONENT_POLICY_KEY', + 'edit_subsection', + 'edit_unit', + 'assignment_type_update', + 'create_draft', + 'publish_draft', + 'unpublish_unit', + 'module_info'] log = logging.getLogger(__name__)