From 00ae488960e4044c21a8867b0786ecdec0b4ec3f Mon Sep 17 00:00:00 2001 From: stv Date: Sat, 8 Nov 2014 20:23:00 -0800 Subject: [PATCH] Fix PEP8: E225 missing whitespace around operator --- cms/envs/test.py | 4 ++-- common/djangoapps/terrain/stubs/ora.py | 2 +- common/lib/capa/capa/safe_exec/safe_exec.py | 2 +- .../open_ended_grading_classes/combined_open_ended_rubric.py | 4 ++-- common/lib/xmodule/xmodule/tests/test_video.py | 4 ++-- lms/djangoapps/courseware/masquerade.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cms/envs/test.py b/cms/envs/test.py index f06140c5f8..36b9e54e29 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -69,9 +69,9 @@ STATICFILES_DIRS += [ # If we don't add these settings, then Django templates that can't # find pipelined assets will raise a ValueError. # http://stackoverflow.com/questions/12816941/unit-testing-with-django-pipeline -STATICFILES_STORAGE='pipeline.storage.NonPackagingPipelineStorage' +STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage' STATIC_URL = "/static/" -PIPELINE_ENABLED=False +PIPELINE_ENABLED = False # Update module store settings per defaults for tests update_module_store_settings( diff --git a/common/djangoapps/terrain/stubs/ora.py b/common/djangoapps/terrain/stubs/ora.py index 1edf93c484..8efc5be4aa 100644 --- a/common/djangoapps/terrain/stubs/ora.py +++ b/common/djangoapps/terrain/stubs/ora.py @@ -45,7 +45,7 @@ class StudentState(object): @property def num_pending(self): - return max(self.INITIAL_ESSAYS_AVAILABLE- self.num_graded, 0) + return max(self.INITIAL_ESSAYS_AVAILABLE - self.num_graded, 0) @property def num_required(self): diff --git a/common/lib/capa/capa/safe_exec/safe_exec.py b/common/lib/capa/capa/safe_exec/safe_exec.py index b25f7b47a2..b57afbcd0d 100644 --- a/common/lib/capa/capa/safe_exec/safe_exec.py +++ b/common/lib/capa/capa/safe_exec/safe_exec.py @@ -21,7 +21,7 @@ random.Random = random_module.Random sys.modules['random'] = random """ -ASSUMED_IMPORTS=[ +ASSUMED_IMPORTS = [ ("numpy", "numpy"), ("math", "math"), ("scipy", "scipy"), diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py index 0a4641f66d..de90378f6c 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py @@ -236,7 +236,7 @@ class CombinedOpenEndedRubric(object): rubric_categories[i]['options'][j]['grader_types'].append(grader_type) #Grab the score and add it to the actual scores. J will be the score for the selected #grader type - if len(actual_scores)<=i: + if len(actual_scores) <= i: #Initialize a new list in the list of lists actual_scores.append([j]) else: @@ -249,7 +249,7 @@ class CombinedOpenEndedRubric(object): for (i, a) in enumerate(actual_scores): if int(a) == max_scores[i]: correct.append(1) - elif int(a)==0: + elif int(a) == 0: correct.append(0) else: correct.append(.5) diff --git a/common/lib/xmodule/xmodule/tests/test_video.py b/common/lib/xmodule/xmodule/tests/test_video.py index 8763c15225..f27cb6c2dc 100644 --- a/common/lib/xmodule/xmodule/tests/test_video.py +++ b/common/lib/xmodule/xmodule/tests/test_video.py @@ -566,7 +566,7 @@ class VideoCdnTest(unittest.TestCase): original_video_url = "http://www.original_video.com/original_video.mp4" cdn_response_video_url = "http://www.cdn_video.com/cdn_video.mp4" cdn_response_content = '{{"sources":["{cdn_url}"]}}'.format(cdn_url=cdn_response_video_url) - cdn_response.return_value=Mock(status_code=200, content=cdn_response_content) + cdn_response.return_value = Mock(status_code=200, content=cdn_response_content) fake_cdn_url = 'http://fake_cdn.com/' self.assertEqual( get_video_from_cdn(fake_cdn_url, original_video_url), @@ -579,6 +579,6 @@ class VideoCdnTest(unittest.TestCase): Test if no alternative video in CDN exists. """ original_video_url = "http://www.original_video.com/original_video.mp4" - cdn_response.return_value=Mock(status_code=404) + cdn_response.return_value = Mock(status_code=404) fake_cdn_url = 'http://fake_cdn.com/' self.assertIsNone(get_video_from_cdn(fake_cdn_url, original_video_url)) diff --git a/lms/djangoapps/courseware/masquerade.py b/lms/djangoapps/courseware/masquerade.py index a044e89d91..41a868cc9b 100644 --- a/lms/djangoapps/courseware/masquerade.py +++ b/lms/djangoapps/courseware/masquerade.py @@ -62,4 +62,4 @@ def is_masquerading_as_student(user): Return True if user is masquerading as a student, False otherwise ''' masq = getattr(user, 'masquerade_as_student', False) - return masq==True + return masq is True