diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 0a09bd8a0427596e2e0503325b445c07e3c04b46..b438676e2395fb2b306b03837e4481fe1ce03e11 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -2,15 +2,15 @@ import json import logging from collections import defaultdict -from django.http import ( HttpResponse, HttpResponseBadRequest, - HttpResponseForbidden ) +from django.http import (HttpResponse, HttpResponseBadRequest, + HttpResponseForbidden) from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django.core.exceptions import PermissionDenied from django_future.csrf import ensure_csrf_cookie from django.conf import settings -from xmodule.modulestore.exceptions import ( ItemNotFoundError, - InvalidLocationError ) +from xmodule.modulestore.exceptions import (ItemNotFoundError, + InvalidLocationError) from mitxmako.shortcuts import render_to_response from xmodule.modulestore import Location @@ -21,8 +21,8 @@ from xblock.fields import Scope from util.json_request import expect_json, JsonResponse from contentstore.module_info_model import get_module_info, set_module_info -from contentstore.utils import ( get_modulestore, get_lms_link_for_item, - compute_unit_state, UnitState, get_course_for_item ) +from contentstore.utils import (get_modulestore, get_lms_link_for_item, + compute_unit_state, UnitState, get_course_for_item) from models.settings.course_grading import CourseGradingModel diff --git a/common/lib/xmodule/xmodule/modulestore/xml_importer.py b/common/lib/xmodule/xmodule/modulestore/xml_importer.py index cd34d294a78e95cda39640ffe62f58398ce9dcd1..a9a7601e334fb152bd6fae43a4d548e8ff182c4c 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/xml_importer.py @@ -25,7 +25,7 @@ def import_static_content(modules, course_loc, course_data_path, static_content_ verbose = True - for dirname, dirnames, filenames in os.walk(static_dir): + for dirname, _, filenames in os.walk(static_dir): for filename in filenames: try: diff --git a/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py b/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py index 666922a2707989ce0d6394763a161590dba5b58b..bdd1913ef39bc88eaa2bfeb783be58ae577cd132 100644 --- a/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py +++ b/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py @@ -99,7 +99,7 @@ class TestXBlockWrapper(object): if depth == 0: runtime.get_module.side_effect = lambda x: self.leaf_module(HtmlDescriptor) else: - runtime.get_module.side_effect = lambda x: self.container_module(VerticalDescriptor, depth-1) + runtime.get_module.side_effect = lambda x: self.container_module(VerticalDescriptor, depth - 1) runtime.position = 2 return runtime @@ -188,9 +188,9 @@ class TestStudioView(TestXBlockWrapper): # Test that for all of the Descriptors listed in CONTAINER_XMODULES # render the same thing using studio_view as they do using get_html, under the following conditions: - # a) All of its descendents are xmodules - # b) Some of its descendents are xmodules and some are xblocks - # c) All of its descendents are xblocks + # a) All of its descendants are xmodules + # b) Some of its descendants are xmodules and some are xblocks + # c) All of its descendants are xblocks def test_studio_view_container_node(self): for descriptor_cls in CONTAINER_XMODULES: yield self.check_studio_view_container_node_xmodules_only, descriptor_cls