Fix PEP8: E126 continuation line over-indented
for hanging indent
This commit is contained in:
@@ -52,19 +52,13 @@ def see_a_multi_step_component(step, category):
|
||||
world.wait_for(lambda _: len(world.css_find(selector)) == len(step.hashes))
|
||||
|
||||
for idx, step_hash in enumerate(step.hashes):
|
||||
|
||||
if category == 'HTML':
|
||||
html_matcher = {
|
||||
'Text':
|
||||
'\n \n',
|
||||
'Announcement':
|
||||
'<p> Words of encouragement! This is a short note that most students will read. </p>',
|
||||
'Zooming Image':
|
||||
'<h2>ZOOMING DIAGRAMS</h2>',
|
||||
'E-text Written in LaTeX':
|
||||
'<h2>Example: E-text page</h2>',
|
||||
'Raw HTML':
|
||||
'<p>This template is similar to the Text template. The only difference is',
|
||||
'Text': '\n \n',
|
||||
'Announcement': '<p> Words of encouragement! This is a short note that most students will read. </p>',
|
||||
'Zooming Image': '<h2>ZOOMING DIAGRAMS</h2>',
|
||||
'E-text Written in LaTeX': '<h2>Example: E-text page</h2>',
|
||||
'Raw HTML': '<p>This template is similar to the Text template. The only difference is',
|
||||
}
|
||||
actual_html = world.css_html(selector, index=idx)
|
||||
assert_in(html_matcher[step_hash['Component']], actual_html)
|
||||
|
||||
@@ -190,8 +190,8 @@ def _upload_asset(request, course_key):
|
||||
|
||||
# first let's see if a thumbnail can be created
|
||||
(thumbnail_content, thumbnail_location) = contentstore().generate_thumbnail(
|
||||
content,
|
||||
tempfile_path=tempfile_path
|
||||
content,
|
||||
tempfile_path=tempfile_path,
|
||||
)
|
||||
|
||||
# delete cached thumbnail even if one couldn't be created this time (else
|
||||
|
||||
@@ -387,10 +387,13 @@ def course_listing(request):
|
||||
'run': uca.course_key.run,
|
||||
'is_failed': True if uca.state == CourseRerunUIStateManager.State.FAILED else False,
|
||||
'is_in_progress': True if uca.state == CourseRerunUIStateManager.State.IN_PROGRESS else False,
|
||||
'dismiss_link':
|
||||
reverse_course_url('course_notifications_handler', uca.course_key, kwargs={
|
||||
'dismiss_link': reverse_course_url(
|
||||
'course_notifications_handler',
|
||||
uca.course_key,
|
||||
kwargs={
|
||||
'action_state_id': uca.id,
|
||||
}) if uca.state == CourseRerunUIStateManager.State.FAILED else ''
|
||||
},
|
||||
) if uca.state == CourseRerunUIStateManager.State.FAILED else ''
|
||||
}
|
||||
|
||||
# remove any courses in courses that are also in the in_process_course_actions list
|
||||
@@ -456,10 +459,13 @@ def course_index(request, course_key):
|
||||
'rerun_notification_id': current_action.id if current_action else None,
|
||||
'course_release_date': course_release_date,
|
||||
'settings_url': settings_url,
|
||||
'notification_dismiss_url':
|
||||
reverse_course_url('course_notifications_handler', current_action.course_key, kwargs={
|
||||
'notification_dismiss_url': reverse_course_url(
|
||||
'course_notifications_handler',
|
||||
current_action.course_key,
|
||||
kwargs={
|
||||
'action_state_id': current_action.id,
|
||||
}) if current_action else None,
|
||||
},
|
||||
) if current_action else None,
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -24,15 +24,13 @@ class UserStandingMiddleware(object):
|
||||
else:
|
||||
if user_account.account_status == UserStanding.ACCOUNT_DISABLED:
|
||||
msg = _(
|
||||
'Your account has been disabled. If you believe '
|
||||
'this was done in error, please contact us at '
|
||||
'{link_start}{support_email}{link_end}'
|
||||
'Your account has been disabled. If you believe '
|
||||
'this was done in error, please contact us at '
|
||||
'{support_email}'
|
||||
).format(
|
||||
support_email=settings.DEFAULT_FEEDBACK_EMAIL,
|
||||
link_start=u'<a href="mailto:{address}?subject={subject_line}">'.format(
|
||||
address=settings.DEFAULT_FEEDBACK_EMAIL,
|
||||
subject_line=_('Disabled Account'),
|
||||
),
|
||||
link_end=u'</a>'
|
||||
support_email=u'<a href="mailto:{address}?subject={subject_line}">{address}</a>'.format(
|
||||
address=settings.DEFAULT_FEEDBACK_EMAIL,
|
||||
subject_line=_('Disabled Account'),
|
||||
),
|
||||
)
|
||||
return HttpResponseForbidden(msg)
|
||||
|
||||
@@ -24,15 +24,20 @@ class TagRegistry(object):
|
||||
if len(cls.tags) == 0:
|
||||
raise ValueError("No tags specified for class {0}".format(cls.__name__))
|
||||
|
||||
for t in cls.tags:
|
||||
if t in self._mapping:
|
||||
other_cls = self._mapping[t]
|
||||
for tag in cls.tags:
|
||||
if tag in self._mapping:
|
||||
other_cls = self._mapping[tag]
|
||||
if cls == other_cls:
|
||||
# registering the same class multiple times seems silly, but ok
|
||||
continue
|
||||
raise ValueError("Tag {0} already registered by class {1}."
|
||||
" Can't register for class {2}"
|
||||
.format(t, other_cls.__name__, cls.__name__))
|
||||
raise ValueError(
|
||||
"Tag {0} already registered by class {1}."
|
||||
" Can't register for class {2}".format(
|
||||
tag,
|
||||
other_cls.__name__,
|
||||
cls.__name__,
|
||||
)
|
||||
)
|
||||
|
||||
# Ok, should be good to change state now.
|
||||
for t in cls.tags:
|
||||
|
||||
@@ -368,7 +368,8 @@ class DragAndDrop(object):
|
||||
if draggable_name in answer['draggables']:
|
||||
user_groups_data.append(draggable_name)
|
||||
user_positions_data.append(
|
||||
draggable_dict[draggable_name])
|
||||
draggable_dict[draggable_name]
|
||||
)
|
||||
# proved that this is not excess
|
||||
self.excess_draggables[draggable_name] = False
|
||||
|
||||
|
||||
@@ -57,15 +57,25 @@ class MockStaffGradingService(object):
|
||||
|
||||
def get_problem_list(self, course_id, grader_id):
|
||||
self.cnt += 1
|
||||
return {'success': True,
|
||||
'problem_list': [
|
||||
json.dumps({'location': 'i4x://MITx/3.091x/problem/open_ended_demo1',
|
||||
'problem_name': "Problem 1", 'num_graded': 3, 'num_pending': 5,
|
||||
'min_for_ml': 10}),
|
||||
json.dumps({'location': 'i4x://MITx/3.091x/problem/open_ended_demo2',
|
||||
'problem_name': "Problem 2", 'num_graded': 1, 'num_pending': 5,
|
||||
'min_for_ml': 10})
|
||||
]}
|
||||
return {
|
||||
'success': True,
|
||||
'problem_list': [
|
||||
json.dumps({
|
||||
'location': 'i4x://MITx/3.091x/problem/open_ended_demo1',
|
||||
'problem_name': "Problem 1",
|
||||
'num_graded': 3,
|
||||
'num_pending': 5,
|
||||
'min_for_ml': 10,
|
||||
}),
|
||||
json.dumps({
|
||||
'location': 'i4x://MITx/3.091x/problem/open_ended_demo2',
|
||||
'problem_name': "Problem 2",
|
||||
'num_graded': 1,
|
||||
'num_pending': 5,
|
||||
'min_for_ml': 10,
|
||||
}),
|
||||
],
|
||||
}
|
||||
|
||||
def save_grade(self, course_id, grader_id, submission_id, score, feedback, skipped, rubric_scores,
|
||||
submission_flagged):
|
||||
|
||||
Reference in New Issue
Block a user