From 55de42d19c0e18047240c369a7955e4aed275b0f Mon Sep 17 00:00:00 2001 From: stv Date: Sun, 9 Nov 2014 12:31:50 -0800 Subject: [PATCH] Fix PEP8: E122 continuation line missing indentation or outdented --- .../commands/clear_collectstatic_cache.py | 3 +-- .../management/commands/6002exportusers.py | 5 ++--- .../management/commands/6002importusers.py | 5 ++--- .../management/commands/assigngroups.py | 18 +++++++++--------- .../student/management/commands/emaillist.py | 3 +-- .../management/commands/sync_user_info.py | 5 +---- .../student/management/commands/userinfo.py | 5 ++--- .../lib/xmodule/xmodule/annotatable_module.py | 7 ++++--- common/lib/xmodule/xmodule/mako_module.py | 9 ++++++--- docs/shared/conf.py | 12 ++++++------ 10 files changed, 34 insertions(+), 38 deletions(-) diff --git a/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py b/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py index 60b7c58047..076204c31e 100644 --- a/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py +++ b/common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py @@ -7,8 +7,7 @@ from django.core.cache import get_cache class Command(NoArgsCommand): - help = \ -'''Import the specified data directory into the default ModuleStore''' + help = 'Import the specified data directory into the default ModuleStore' def handle_noargs(self, **options): staticfiles_cache = get_cache('staticfiles') diff --git a/common/djangoapps/student/management/commands/6002exportusers.py b/common/djangoapps/student/management/commands/6002exportusers.py index a36d6e84c6..0cb2b2ffee 100644 --- a/common/djangoapps/student/management/commands/6002exportusers.py +++ b/common/djangoapps/student/management/commands/6002exportusers.py @@ -18,14 +18,13 @@ from student.models import UserProfile class Command(BaseCommand): - help = \ -'''Exports all users and user profiles. + help = """Exports all users and user profiles. Caveat: Should be looked over before any run for schema changes. Current version grabs user_keys from django.contrib.auth.models.User and up_keys -from student.userprofile. ''' +from student.userprofile.""" def handle(self, *args, **options): users = list(User.objects.all()) diff --git a/common/djangoapps/student/management/commands/6002importusers.py b/common/djangoapps/student/management/commands/6002importusers.py index 93d86dfc05..17b4c2069b 100644 --- a/common/djangoapps/student/management/commands/6002importusers.py +++ b/common/djangoapps/student/management/commands/6002importusers.py @@ -39,14 +39,13 @@ def import_user(u): class Command(BaseCommand): - help = \ -'''Exports all users and user profiles. + help = """Exports all users and user profiles. Caveat: Should be looked over before any run for schema changes. Current version grabs user_keys from django.contrib.auth.models.User and up_keys -from student.userprofile. ''' +from student.userprofile.""" def handle(self, *args, **options): extracted = json.load(open('transfer_users.txt')) diff --git a/common/djangoapps/student/management/commands/assigngroups.py b/common/djangoapps/student/management/commands/assigngroups.py index cbd5cfad22..3c6df5b3ba 100644 --- a/common/djangoapps/student/management/commands/assigngroups.py +++ b/common/djangoapps/student/management/commands/assigngroups.py @@ -6,6 +6,7 @@ from student.models import UserTestGroup import random import sys import datetime +from textwrap import dedent import json from pytz import UTC @@ -25,16 +26,15 @@ def group_from_value(groups, v): class Command(BaseCommand): - help = \ -''' Assign users to test groups. Takes a list -of groups: -a:0.3,b:0.4,c:0.3 file.txt "Testing something" -Will assign each user to group a, b, or c with -probability 0.3, 0.4, 0.3. Probabilities must -add up to 1. + help = dedent("""\ + Assign users to test groups. Takes a list of groups: + a:0.3,b:0.4,c:0.3 file.txt "Testing something" + Will assign each user to group a, b, or c with + probability 0.3, 0.4, 0.3. Probabilities must + add up to 1. -Will log what happened to file.txt. -''' + Will log what happened to file.txt. + """) def handle(self, *args, **options): if len(args) != 3: diff --git a/common/djangoapps/student/management/commands/emaillist.py b/common/djangoapps/student/management/commands/emaillist.py index e69b072db2..8a74aafbcf 100644 --- a/common/djangoapps/student/management/commands/emaillist.py +++ b/common/djangoapps/student/management/commands/emaillist.py @@ -3,8 +3,7 @@ from django.contrib.auth.models import User class Command(BaseCommand): - help = \ -''' Extract an e-mail list of all active students. ''' + help = 'Extract an e-mail list of all active students.' def handle(self, *args, **options): #text = open(args[0]).read() diff --git a/common/djangoapps/student/management/commands/sync_user_info.py b/common/djangoapps/student/management/commands/sync_user_info.py index d7fdd3323f..7d239b2e09 100644 --- a/common/djangoapps/student/management/commands/sync_user_info.py +++ b/common/djangoapps/student/management/commands/sync_user_info.py @@ -8,10 +8,7 @@ import lms.lib.comment_client as cc class Command(BaseCommand): - help = \ -''' -Sync all user ids, usernames, and emails to the discussion -service''' + help = 'Sync all user ids, usernames, and emails to the discussion service' def handle(self, *args, **options): for user in User.objects.all().iterator(): diff --git a/common/djangoapps/student/management/commands/userinfo.py b/common/djangoapps/student/management/commands/userinfo.py index 8656fb9183..263b86ef78 100644 --- a/common/djangoapps/student/management/commands/userinfo.py +++ b/common/djangoapps/student/management/commands/userinfo.py @@ -7,9 +7,8 @@ from student.models import UserProfile class Command(BaseCommand): - help = \ -''' Extract full user information into a JSON file. -Pass a single filename.''' + help = """Extract full user information into a JSON file. +Pass a single filename.""" def handle(self, *args, **options): f = open(args[0], 'w') diff --git a/common/lib/xmodule/xmodule/annotatable_module.py b/common/lib/xmodule/xmodule/annotatable_module.py index 471b00bc8c..9c27357dc0 100644 --- a/common/lib/xmodule/xmodule/annotatable_module.py +++ b/common/lib/xmodule/xmodule/annotatable_module.py @@ -15,9 +15,10 @@ _ = lambda text: text class AnnotatableFields(object): - data = String(help=_("XML data for the annotation"), scope=Scope.content, - default=textwrap.dedent( - """\ + data = String( + help=_("XML data for the annotation"), + scope=Scope.content, + default=textwrap.dedent("""

Enter your (optional) instructions for the exercise in HTML format.

diff --git a/common/lib/xmodule/xmodule/mako_module.py b/common/lib/xmodule/xmodule/mako_module.py index ecbac28d86..7718cb341e 100644 --- a/common/lib/xmodule/xmodule/mako_module.py +++ b/common/lib/xmodule/xmodule/mako_module.py @@ -23,9 +23,12 @@ class MakoModuleDescriptor(XModuleDescriptor): def __init__(self, *args, **kwargs): super(MakoModuleDescriptor, self).__init__(*args, **kwargs) if getattr(self.runtime, 'render_template', None) is None: - raise TypeError('{runtime} must have a render_template function' - ' in order to use a MakoDescriptor'.format( - runtime=self.runtime)) + raise TypeError( + '{runtime} must have a render_template function' + ' in order to use a MakoDescriptor'.format( + runtime=self.runtime, + ) + ) def get_context(self): """ diff --git a/docs/shared/conf.py b/docs/shared/conf.py index cb1e5f6c45..3a7960b20b 100644 --- a/docs/shared/conf.py +++ b/docs/shared/conf.py @@ -196,14 +196,14 @@ htmlhelp_basename = 'edxdoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples