Commit 10b76220 by Steve Strassmann

declare exports from course, component

parent b3cc9a11
# pylint: disable=W0401, W0511 # 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 # Disable warnings about import from wildcard
# All files below declare exports with __all__ # All files below declare exports with __all__
from .assets import * from .assets import *
from .checklist import * from .checklist import *
from .component import *
from .course import *
from .error import * from .error import *
from .item import * from .item import *
from .preview import * from .preview import *
......
...@@ -149,9 +149,9 @@ def import_course(request, org, course, name): ...@@ -149,9 +149,9 @@ def import_course(request, org, course, name):
location = get_location_and_verify_access(request, org, course, name) location = get_location_and_verify_access(request, org, course, name)
if request.method == 'POST': 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.'})) return HttpResponse(json.dumps({'ErrMsg': 'We only support uploading a .tar.gz file.'}))
data_root = path(settings.GITHUB_REPO_ROOT) data_root = path(settings.GITHUB_REPO_ROOT)
...@@ -161,7 +161,7 @@ def import_course(request, org, course, name): ...@@ -161,7 +161,7 @@ def import_course(request, org, course, name):
if not course_dir.isdir(): if not course_dir.isdir():
os.mkdir(course_dir) os.mkdir(course_dir)
temp_filepath = course_dir / filenames temp_filepath = course_dir / filename
logging.debug('importing course to {0}'.format(temp_filepath)) logging.debug('importing course to {0}'.format(temp_filepath))
......
...@@ -26,9 +26,15 @@ from models.settings.course_grading import CourseGradingModel ...@@ -26,9 +26,15 @@ from models.settings.course_grading import CourseGradingModel
from .requests import get_request_method, _xmodule_recurse from .requests import get_request_method, _xmodule_recurse
from .access import has_access from .access import has_access
# TODO: should explicitly enumerate exports with __all__ __all__ = ['OPEN_ENDED_COMPONENT_TYPES',
'ADVANCED_COMPONENT_POLICY_KEY',
# to install PIL on MacOSX: 'easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz' 'edit_subsection',
'edit_unit',
'assignment_type_update',
'create_draft',
'publish_draft',
'unpublish_unit',
'module_info']
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment