Fix PEP8: E231 missing whitespace after '[:,]'

This commit is contained in:
stv
2014-11-08 20:18:29 -08:00
parent b388ab9db0
commit 500499b678
13 changed files with 23 additions and 22 deletions

View File

@@ -43,7 +43,7 @@ def platform_name():
@register.simple_tag(name="favicon_path")
def favicon_path(default=getattr(settings,'FAVICON_PATH', 'images/favicon.ico')):
def favicon_path(default=getattr(settings, 'FAVICON_PATH', 'images/favicon.ico')):
"""
Django template tag that outputs the configured favicon:
{% favicon_path %}

View File

@@ -123,8 +123,8 @@ class StubHttpRequestHandler(BaseHTTPRequestHandler, object):
# By default, `parse_qs` returns a list of values for each param
# For convenience, we replace lists of 1 element with just the element
return {
k:v[0] if len(v) == 1 else v
for k,v in urlparse.parse_qs(query).items()
key: value[0] if len(value) == 1 else value
for key, value in urlparse.parse_qs(query).items()
}
@lazy

View File

@@ -35,7 +35,7 @@ class StubLtiServiceTest(unittest.TestCase):
'launch_presentation_return_url': '',
'lis_outcome_service_url': 'http://localhost:8001/test_callback',
'lis_result_sourcedid': '',
'resource_link_id':'',
'resource_link_id': '',
}
def test_invalid_request_url(self):

View File

@@ -214,6 +214,7 @@ class StubXQueueService(StubHttpService):
except for 'default' and 'register_submission_url' which have special meaning
"""
return {
key:val for key, val in self.config.iteritems()
key: value
for key, value in self.config.iteritems()
if key not in self.NON_QUEUE_CONFIG_KEYS
}.items()

View File

@@ -21,7 +21,7 @@ or:
{ "molecule": "[100, 200]" },
]
}
values are (x,y) coordinates of centers of dragged images.
values are (x, y) coordinates of centers of dragged images.
"""
import json
@@ -77,7 +77,7 @@ class PositionsCompare(list):
list or string::
"abc" - target
[10, 20] - list of integers
[[10,20], 200] list of list and integer
[[10, 20], 200] list of list and integer
"""
def __eq__(self, other):
@@ -223,10 +223,10 @@ class DragAndDrop(object):
Examples:
- many draggables per position:
user ['1','2','2','2'] is 'anyof' equal to ['1', '2', '3']
user ['1', '2', '2', '2'] is 'anyof' equal to ['1', '2', '3']
- draggables can be placed in any order:
user ['1','2','3','4'] is 'anyof' equal to ['4', '2', '1', 3']
user ['1', '2', '3', '4'] is 'anyof' equal to ['4', '2', '1', 3']
'unordered_equal' is same as 'exact' but disregards on order
@@ -235,7 +235,7 @@ class DragAndDrop(object):
Equality functon depends on type of element. They declared in
PositionsCompare class. For position like targets
ids ("t1", "t2", etc..) it is string equality function. For coordinate
positions ([1,2] or [[1,2], 15]) it is coordinate_positions_compare
positions ([1, 2] or [[1, 2], 15]) it is coordinate_positions_compare
function (see docstrings in PositionsCompare class)
Args:
@@ -352,7 +352,7 @@ class DragAndDrop(object):
# correct_answer entries. If the draggable is mentioned in at least one
# correct_answer entry, the value is False.
# default to consider every user answer excess until proven otherwise.
self.excess_draggables = dict((users_draggable.keys()[0],True)
self.excess_draggables = dict((users_draggable.keys()[0], True)
for users_draggable in user_answer)
# Convert nested `user_answer` to flat format.
@@ -414,8 +414,8 @@ def grade(user_input, correct_answer):
'rule': 'anyof'
},
{
'draggables': ['l1_c','l8_c'],
'targets': ['t5_c','t6_c'],
'draggables': ['l1_c', 'l8_c'],
'targets': ['t5_c', 't6_c'],
'rule': 'anyof'
}
]

View File

@@ -103,7 +103,7 @@ class PeerGradingService(GradingService):
self._record_result('get_problem_list', result)
dog_stats_api.histogram(
self._metric_name('get_problem_list.result.length'),
len(result.get('problem_list',[]))
len(result.get('problem_list', [])),
)
return result

View File

@@ -198,7 +198,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
'success': success,
'rubric_html': self.get_rubric_html(system),
'error': error_message,
'student_response': data['student_answer'].replace("\n","<br/>")
'student_response': data['student_answer'].replace("\n", "<br/>"),
}
def save_assessment(self, data, _system):