pep8 compliance
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
# TODO: replace asterisks, should explicitly enumerate imports instead
|
||||
|
||||
from assets import *
|
||||
from checklist import *
|
||||
from component import *
|
||||
|
||||
@@ -25,6 +25,8 @@ from models.settings.course_grading import CourseGradingModel
|
||||
from requests import get_request_method, _xmodule_recurse
|
||||
from access import has_access, get_location_and_verify_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'
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -17,13 +17,15 @@ from contentstore.utils import get_lms_link_for_item, add_open_ended_panel_tab,
|
||||
from models.settings.course_details import CourseDetails, CourseSettingsEncoder
|
||||
from models.settings.course_grading import CourseGradingModel
|
||||
from models.settings.course_metadata import CourseMetadata
|
||||
from component import OPEN_ENDED_COMPONENT_TYPES, ADVANCED_COMPONENT_POLICY_KEY
|
||||
from auth.authz import create_all_course_groups
|
||||
from util.json_request import expect_json
|
||||
|
||||
from access import has_access, get_location_and_verify_access
|
||||
from requests import get_request_method
|
||||
from tabs import initialize_course_tabs
|
||||
from component import OPEN_ENDED_COMPONENT_TYPES, ADVANCED_COMPONENT_POLICY_KEY
|
||||
|
||||
# TODO: should explicitly enumerate exports with __all__
|
||||
|
||||
@login_required
|
||||
@ensure_csrf_cookie
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging, sys
|
||||
import logging
|
||||
import sys
|
||||
from functools import partial
|
||||
|
||||
from django.http import HttpResponse, Http404, HttpResponseBadRequest, HttpResponseForbidden
|
||||
@@ -25,6 +26,7 @@ __all__ = ['preview_dispatch', 'preview_component']
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@login_required
|
||||
def preview_dispatch(request, preview_id, location, dispatch=None):
|
||||
"""
|
||||
@@ -58,6 +60,7 @@ def preview_dispatch(request, preview_id, location, dispatch=None):
|
||||
|
||||
return HttpResponse(ajax_return)
|
||||
|
||||
|
||||
@login_required
|
||||
def preview_component(request, location):
|
||||
# TODO (vshnayder): change name from id to location in coffee+html as well.
|
||||
@@ -72,7 +75,6 @@ def preview_component(request, location):
|
||||
})
|
||||
|
||||
|
||||
|
||||
def preview_module_system(request, preview_id, descriptor):
|
||||
"""
|
||||
Returns a ModuleSystem for the specified descriptor that is specialized for
|
||||
@@ -104,6 +106,7 @@ def preview_module_system(request, preview_id, descriptor):
|
||||
xblock_model_data=preview_model_data,
|
||||
)
|
||||
|
||||
|
||||
def get_preview_module(request, preview_id, descriptor):
|
||||
"""
|
||||
Returns a preview XModule at the specified location. The preview_data is chosen arbitrarily
|
||||
@@ -159,6 +162,7 @@ def load_preview_module(request, preview_id, descriptor):
|
||||
|
||||
return module
|
||||
|
||||
|
||||
def get_module_previews(request, descriptor):
|
||||
"""
|
||||
Returns a list of preview XModule html contents. One preview is returned for each
|
||||
@@ -171,4 +175,3 @@ def get_module_previews(request, descriptor):
|
||||
module = load_preview_module(request, str(idx), descriptor)
|
||||
preview_html.append(module.get_html())
|
||||
return preview_html
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ def create_json_response(errmsg=None):
|
||||
resp = HttpResponse(json.dumps({'Status': 'Failed', 'ErrMsg': errmsg}))
|
||||
else:
|
||||
resp = HttpResponse(json.dumps({'Status': 'OK'}))
|
||||
|
||||
return resp
|
||||
|
||||
def render_from_lms(template_name, dictionary, context=None, namespace='main'):
|
||||
|
||||
Reference in New Issue
Block a user