mattdrayer/increment-edx-lint: Bump to v0.2.9 and address pylint/pep8 violations
* Fix paver violations to stablize edx-lint update * Parens, Line2Long * Fix missing docstrings * Fix PEP8 issues * Address PR feedback (thanks @nedbat!)
This commit is contained in:
@@ -173,9 +173,9 @@ def remove_transcripts_from_store(_step, subs_id):
|
||||
try:
|
||||
content = contentstore().find(content_location)
|
||||
contentstore().delete(content.location)
|
||||
print('Transcript file was removed from store.')
|
||||
print 'Transcript file was removed from store.'
|
||||
except NotFoundError:
|
||||
print('Transcript file was NOT found and not removed.')
|
||||
print 'Transcript file was NOT found and not removed.'
|
||||
|
||||
|
||||
@step('I enter a "([^"]+)" source to field number (\d+)$')
|
||||
|
||||
@@ -36,11 +36,11 @@ class Command(BaseCommand):
|
||||
|
||||
mstore = modulestore()
|
||||
|
||||
print("Cloning course {0} to {1}".format(source_course_id, dest_course_id))
|
||||
print "Cloning course {0} to {1}".format(source_course_id, dest_course_id)
|
||||
|
||||
with mstore.bulk_operations(dest_course_id):
|
||||
if mstore.clone_course(source_course_id, dest_course_id, ModuleStoreEnum.UserID.mgmt_command):
|
||||
print("copying User permissions...")
|
||||
print "copying User permissions..."
|
||||
# purposely avoids auth.add_user b/c it doesn't have a caller to authorize
|
||||
CourseInstructorRole(dest_course_id).add_users(
|
||||
*CourseInstructorRole(source_course_id).users_with_role()
|
||||
|
||||
@@ -23,13 +23,13 @@ class Command(BaseCommand):
|
||||
output_path = args[0]
|
||||
courses, failed_export_courses = export_courses_to_output_path(output_path)
|
||||
|
||||
print("=" * 80)
|
||||
print(u"=" * 30 + u"> Export summary")
|
||||
print(u"Total number of courses to export: {0}".format(len(courses)))
|
||||
print(u"Total number of courses which failed to export: {0}".format(len(failed_export_courses)))
|
||||
print(u"List of export failed courses ids:")
|
||||
print(u"\n".join(failed_export_courses))
|
||||
print("=" * 80)
|
||||
print "=" * 80
|
||||
print u"=" * 30 + u"> Export summary"
|
||||
print u"Total number of courses to export: {0}".format(len(courses))
|
||||
print u"Total number of courses which failed to export: {0}".format(len(failed_export_courses))
|
||||
print u"List of export failed courses ids:"
|
||||
print u"\n".join(failed_export_courses)
|
||||
print "=" * 80
|
||||
|
||||
|
||||
def export_courses_to_output_path(output_path):
|
||||
@@ -45,15 +45,15 @@ def export_courses_to_output_path(output_path):
|
||||
failed_export_courses = []
|
||||
|
||||
for course_id in course_ids:
|
||||
print(u"-" * 80)
|
||||
print(u"Exporting course id = {0} to {1}".format(course_id, output_path))
|
||||
print u"-" * 80
|
||||
print u"Exporting course id = {0} to {1}".format(course_id, output_path)
|
||||
try:
|
||||
course_dir = course_id.to_deprecated_string().replace('/', '...')
|
||||
export_course_to_xml(module_store, content_store, course_id, root_dir, course_dir)
|
||||
except Exception as err: # pylint: disable=broad-except
|
||||
failed_export_courses.append(unicode(course_id))
|
||||
print(u"=" * 30 + u"> Oops, failed to export {0}".format(course_id))
|
||||
print(u"Error:")
|
||||
print(err)
|
||||
print u"=" * 30 + u"> Oops, failed to export {0}".format(course_id)
|
||||
print u"Error:"
|
||||
print err
|
||||
|
||||
return courses, failed_export_courses
|
||||
|
||||
@@ -54,7 +54,7 @@ class Command(BaseCommand):
|
||||
finally:
|
||||
tar_file.close()
|
||||
|
||||
print("Created archive {0}".format(archive_name))
|
||||
print "Created archive {0}".format(archive_name)
|
||||
|
||||
except ValueError as err:
|
||||
raise CommandError(err)
|
||||
|
||||
@@ -111,7 +111,7 @@ class AuthTestCase(ContentStoreTestCase):
|
||||
reverse('signup'),
|
||||
)
|
||||
for page in pages:
|
||||
print("Checking '{0}'".format(page))
|
||||
print "Checking '{0}'".format(page)
|
||||
self.check_page_get(page, 200)
|
||||
|
||||
def test_create_account_errors(self):
|
||||
@@ -254,17 +254,17 @@ class AuthTestCase(ContentStoreTestCase):
|
||||
self.client = AjaxEnabledTestClient()
|
||||
|
||||
# Not logged in. Should redirect to login.
|
||||
print('Not logged in')
|
||||
print 'Not logged in'
|
||||
for page in auth_pages:
|
||||
print("Checking '{0}'".format(page))
|
||||
print "Checking '{0}'".format(page)
|
||||
self.check_page_get(page, expected=302)
|
||||
|
||||
# Logged in should work.
|
||||
self.login(self.email, self.pw)
|
||||
|
||||
print('Logged in')
|
||||
print 'Logged in'
|
||||
for page in simple_auth_pages:
|
||||
print("Checking '{0}'".format(page))
|
||||
print "Checking '{0}'".format(page)
|
||||
self.check_page_get(page, expected=200)
|
||||
|
||||
def test_index_auth(self):
|
||||
|
||||
Reference in New Issue
Block a user