declare exports from course, component

This commit is contained in:
Steve Strassmann
2013-05-13 15:06:52 -04:00
parent b3cc9a1174
commit 10b7622018
3 changed files with 14 additions and 12 deletions

View File

@@ -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 *

View File

@@ -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))

View File

@@ -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__)