diff --git a/common/djangoapps/cache_toolbox/core.py b/common/djangoapps/cache_toolbox/core.py index a9c7002aa6bbb4d6f6a8cf15d158dc8590cfe6e4..9a7be940b894602384c1c131f3332464c22888b1 100644 --- a/common/djangoapps/cache_toolbox/core.py +++ b/common/djangoapps/cache_toolbox/core.py @@ -12,7 +12,6 @@ from django.core.cache import cache from django.db import DEFAULT_DB_ALIAS from . import app_settings -from xmodule.contentstore.content import StaticContent def get_instance(model, instance_or_pk, timeout=None, using=None): diff --git a/common/djangoapps/course_groups/cohorts.py b/common/djangoapps/course_groups/cohorts.py index 7924012bfe2de38137285721c68465d6bed8a751..d2c7e3a782f5e619e16b4fd0ec941af74bc6063f 100644 --- a/common/djangoapps/course_groups/cohorts.py +++ b/common/djangoapps/course_groups/cohorts.py @@ -3,7 +3,6 @@ This file contains the logic for cohort groups, as exposed internally to the forums, and to the cohort admin views. """ -from django.contrib.auth.models import User from django.http import Http404 import logging import random @@ -27,7 +26,7 @@ def local_random(): """ # ironic, isn't it? global _local_random - + if _local_random is None: _local_random = random.Random() diff --git a/common/djangoapps/course_groups/views.py b/common/djangoapps/course_groups/views.py index 6d5ac43fb067c69b97b130c7119d9d373b02cc8c..764f6c301d1471a8b1399d81b7b9f180f2109a48 100644 --- a/common/djangoapps/course_groups/views.py +++ b/common/djangoapps/course_groups/views.py @@ -1,24 +1,18 @@ from django_future.csrf import ensure_csrf_cookie -from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.contrib.auth.models import User -from django.core.context_processors import csrf from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse -from django.http import HttpResponse, HttpResponseForbidden, Http404 -from django.shortcuts import redirect +from django.http import HttpResponse import json import logging import re from courseware.courses import get_course_with_access -from mitxmako.shortcuts import render_to_response, render_to_string +from mitxmako.shortcuts import render_to_response -from .models import CourseUserGroup from . import cohorts -import track.views - log = logging.getLogger(__name__) diff --git a/common/djangoapps/mitxmako/makoloader.py b/common/djangoapps/mitxmako/makoloader.py index 6b6b31d4642cecae2191f6cd2f2b99c637b82960..06ae2219e642d5e0b24355e816c07cad3320da87 100644 --- a/common/djangoapps/mitxmako/makoloader.py +++ b/common/djangoapps/mitxmako/makoloader.py @@ -7,7 +7,6 @@ from django.template.loaders.filesystem import Loader as FilesystemLoader from django.template.loaders.app_directories import Loader as AppDirectoriesLoader from mitxmako.template import Template -import mitxmako.middleware import tempdir diff --git a/common/djangoapps/status/status.py b/common/djangoapps/status/status.py index deacd9c6319a4467a9277fd856f4546f52375535..b3ffd6a84c67afadf701149f073e00d34dfb6af4 100644 --- a/common/djangoapps/status/status.py +++ b/common/djangoapps/status/status.py @@ -6,7 +6,6 @@ from django.conf import settings import json import logging import os -import sys log = logging.getLogger(__name__) diff --git a/common/djangoapps/student/management/commands/6002exportusers.py b/common/djangoapps/student/management/commands/6002exportusers.py index 31d8092d3f8d43d742fb044853fd783bb47dccdd..a92bb0a60c30f873fb28e467cbb3170a96b53afa 100644 --- a/common/djangoapps/student/management/commands/6002exportusers.py +++ b/common/djangoapps/student/management/commands/6002exportusers.py @@ -11,12 +11,7 @@ import datetime import json -import os.path - -from lxml import etree - from django.core.management.base import BaseCommand -from django.conf import settings from django.contrib.auth.models import User from student.models import UserProfile diff --git a/common/djangoapps/student/management/commands/6002importusers.py b/common/djangoapps/student/management/commands/6002importusers.py index 64be84d91019b756f586655cdd5a97ad9855d197..1f98bd75225d2c84ab998367819cd2069caf8b29 100644 --- a/common/djangoapps/student/management/commands/6002importusers.py +++ b/common/djangoapps/student/management/commands/6002importusers.py @@ -3,17 +3,11 @@ ## See export for more info -import datetime import json import dateutil.parser -import os.path - -from lxml import etree - from django.core.management.base import BaseCommand -from django.conf import settings from django.contrib.auth.models import User from student.models import UserProfile diff --git a/common/djangoapps/student/management/commands/assigngroups.py b/common/djangoapps/student/management/commands/assigngroups.py index 5269c8690eb4ee2b5095c13ace87038a5e80ad5c..3e36bf3129ab94addfe94121906e3d12cbf7f5b0 100644 --- a/common/djangoapps/student/management/commands/assigngroups.py +++ b/common/djangoapps/student/management/commands/assigngroups.py @@ -1,9 +1,4 @@ -import os.path - -from lxml import etree - from django.core.management.base import BaseCommand -from django.conf import settings from django.contrib.auth.models import User import mitxmako.middleware as middleware diff --git a/common/djangoapps/student/management/commands/create_random_users.py b/common/djangoapps/student/management/commands/create_random_users.py index 70374d02f2feb73864789bc31b749847d55377fb..3000c86601552eab0744a44b6b748d2d87d309ae 100644 --- a/common/djangoapps/student/management/commands/create_random_users.py +++ b/common/djangoapps/student/management/commands/create_random_users.py @@ -2,9 +2,7 @@ ## A script to create some dummy users from django.core.management.base import BaseCommand -from django.conf import settings -from django.contrib.auth.models import User -from student.models import UserProfile, CourseEnrollment +from student.models import CourseEnrollment from student.views import _do_create_account, get_random_post_override diff --git a/common/djangoapps/student/management/commands/emaillist.py b/common/djangoapps/student/management/commands/emaillist.py index 4011c41bd2f01f9d438c15ce66d0a32baeee773b..d3911927accd08c0ee78425a27ccc2a7d146e795 100644 --- a/common/djangoapps/student/management/commands/emaillist.py +++ b/common/djangoapps/student/management/commands/emaillist.py @@ -1,9 +1,4 @@ -import os.path - -from lxml import etree - from django.core.management.base import BaseCommand -from django.conf import settings from django.contrib.auth.models import User import mitxmako.middleware as middleware diff --git a/common/djangoapps/student/management/commands/massemail.py b/common/djangoapps/student/management/commands/massemail.py index c6f6e5f6d44a7e9021ffcc2c3a42424bb36f54fd..1bb65fd169d4e50097b92070b0545eaebf3b1fc5 100644 --- a/common/djangoapps/student/management/commands/massemail.py +++ b/common/djangoapps/student/management/commands/massemail.py @@ -1,9 +1,4 @@ -import os.path - -from lxml import etree - from django.core.management.base import BaseCommand -from django.conf import settings from django.contrib.auth.models import User import mitxmako.middleware as middleware diff --git a/common/djangoapps/student/management/commands/massemailtxt.py b/common/djangoapps/student/management/commands/massemailtxt.py index 4ea75f972b09904f39dac6f9eee40efc5e622c8a..fec354e974b75bea913867196b42b89cce710657 100644 --- a/common/djangoapps/student/management/commands/massemailtxt.py +++ b/common/djangoapps/student/management/commands/massemailtxt.py @@ -1,11 +1,8 @@ import os.path import time -from lxml import etree - from django.core.management.base import BaseCommand from django.conf import settings -from django.contrib.auth.models import User import mitxmako.middleware as middleware diff --git a/common/djangoapps/student/management/commands/pearson_dump.py b/common/djangoapps/student/management/commands/pearson_dump.py index 2aade8cf5f242d4b3516c658df2faef6b93a5536..0c9e215f77fe209a795c1d576af5dd583c0fb469 100644 --- a/common/djangoapps/student/management/commands/pearson_dump.py +++ b/common/djangoapps/student/management/commands/pearson_dump.py @@ -2,7 +2,7 @@ from optparse import make_option from json import dump from datetime import datetime -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand from student.models import TestCenterRegistration diff --git a/common/djangoapps/student/management/commands/pearson_import_conf_zip.py b/common/djangoapps/student/management/commands/pearson_import_conf_zip.py index 2339383719562f813b49aee3cae67847ee696284..1e06a0931acb237f9b3f6a770c72a781ceee7369 100644 --- a/common/djangoapps/student/management/commands/pearson_import_conf_zip.py +++ b/common/djangoapps/student/management/commands/pearson_import_conf_zip.py @@ -3,11 +3,8 @@ import csv from zipfile import ZipFile, is_zipfile from time import strptime, strftime -from collections import OrderedDict from datetime import datetime -from os.path import isdir -from optparse import make_option -from dogapi import dog_http_api, dog_stats_api +from dogapi import dog_http_api from django.core.management.base import BaseCommand, CommandError from django.conf import settings diff --git a/common/djangoapps/student/management/commands/tests/test_pearson.py b/common/djangoapps/student/management/commands/tests/test_pearson.py index 65d628fba048ab7b4b3c4116739c71d1b1cb2e8f..ca6e20673bfa35d833e67cbc5a8343789998ae3c 100644 --- a/common/djangoapps/student/management/commands/tests/test_pearson.py +++ b/common/djangoapps/student/management/commands/tests/test_pearson.py @@ -14,7 +14,7 @@ from django.test import TestCase from django.core.management import call_command from nose.plugins.skip import SkipTest -from student.models import User, TestCenterRegistration, TestCenterUser, get_testcenter_registration +from student.models import User, TestCenterUser, get_testcenter_registration log = logging.getLogger(__name__) diff --git a/common/djangoapps/student/management/commands/userinfo.py b/common/djangoapps/student/management/commands/userinfo.py index e45899528464c06f2fe0583867d5c2d4fc7a1caa..5467db1733a868ed8105aa09466778b639e23bef 100644 --- a/common/djangoapps/student/management/commands/userinfo.py +++ b/common/djangoapps/student/management/commands/userinfo.py @@ -1,9 +1,4 @@ -import os.path - -from lxml import etree - from django.core.management.base import BaseCommand -from django.conf import settings from django.contrib.auth.models import User import mitxmako.middleware as middleware diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index f129f1b4b1da069444e1c340356898dcd283ede5..de3e52b0800eea75b58df8383dfa8f17843956d3 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -4,7 +4,6 @@ import json import logging import random import string -import sys import urllib import uuid import time @@ -20,9 +19,9 @@ from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.core.validators import validate_email, validate_slug, ValidationError from django.db import IntegrityError, transaction -from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed, HttpResponseRedirect, Http404 +from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed, Http404 from django.shortcuts import redirect -from django_future.csrf import ensure_csrf_cookie, csrf_exempt +from django_future.csrf import ensure_csrf_cookie from django.utils.http import cookie_date from mitxmako.shortcuts import render_to_response, render_to_string @@ -39,14 +38,11 @@ from certificates.models import CertificateStatuses, certificate_status_for_stud from xmodule.course_module import CourseDescriptor from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.django import modulestore -from xmodule.modulestore import Location from collections import namedtuple from courseware.courses import get_courses, sort_by_announcement from courseware.access import has_access -from courseware.views import get_module_for_descriptor, jump_to -from courseware.model_data import ModelDataCache from statsd import statsd from pytz import UTC diff --git a/common/djangoapps/terrain/browser.py b/common/djangoapps/terrain/browser.py index d2a9480b352715e93b553f197008b0301f66af3e..d237edc4b7731c4a9ddcb9fe2595bb2f85b0bdcd 100644 --- a/common/djangoapps/terrain/browser.py +++ b/common/djangoapps/terrain/browser.py @@ -4,7 +4,6 @@ Browser set up for acceptance tests. #pylint: disable=E1101 #pylint: disable=W0613 -#pylint: disable=W0611 from lettuce import before, after, world from splinter.browser import Browser @@ -15,8 +14,9 @@ from selenium.common.exceptions import WebDriverException # Let the LMS and CMS do their one-time setup # For example, setting up mongo caches -from lms import one_time_startup -from cms import one_time_startup +# These names aren't used, but do important work on import. +from lms import one_time_startup # pylint: disable=W0611 +from cms import one_time_startup # pylint: disable=W0611 # There is an import issue when using django-staticfiles with lettuce # Lettuce assumes that we are using django.contrib.staticfiles, diff --git a/common/djangoapps/terrain/course_helpers.py b/common/djangoapps/terrain/course_helpers.py index fc666d7904331c9dd21eec560bc213618b7fc5b2..fbc9409e7b45989ec8dd08c60c74ce7b26fdc7a7 100644 --- a/common/djangoapps/terrain/course_helpers.py +++ b/common/djangoapps/terrain/course_helpers.py @@ -1,7 +1,7 @@ # pylint: disable=C0111 # pylint: disable=W0621 -from lettuce import world, step +from lettuce import world from .factories import * from django.conf import settings from django.http import HttpRequest @@ -15,7 +15,6 @@ from xmodule.templates import update_templates from bs4 import BeautifulSoup import os.path from urllib import quote_plus -from lettuce.django import django_url @world.absorb diff --git a/common/djangoapps/terrain/steps.py b/common/djangoapps/terrain/steps.py index 6e512982b7a15510db987b0859bba60e607c2b28..f31be894f9a2d459dcd6b7fb262d43cbe694f453 100644 --- a/common/djangoapps/terrain/steps.py +++ b/common/djangoapps/terrain/steps.py @@ -15,7 +15,7 @@ from lettuce import world, step from .course_helpers import * from .ui_helpers import * from lettuce.django import django_url -from nose.tools import assert_equals, assert_in +from nose.tools import assert_equals from logging import getLogger logger = getLogger(__name__) diff --git a/common/djangoapps/track/middleware.py b/common/djangoapps/track/middleware.py index 52d914aeef705d5dde542a9d4d325a7b9fd9f734..7fc02d9969f26b47b7e6a8450c83ef4cb198cc81 100644 --- a/common/djangoapps/track/middleware.py +++ b/common/djangoapps/track/middleware.py @@ -1,7 +1,5 @@ import json -from django.conf import settings - import views diff --git a/common/djangoapps/util/models.py b/common/djangoapps/util/models.py index 71a836239075aa6e6e4ecb700e9c42c95c022d91..6b2021999398416a78191ac543b7e0e34d86bc2c 100644 --- a/common/djangoapps/util/models.py +++ b/common/djangoapps/util/models.py @@ -1,3 +1 @@ -from django.db import models - # Create your models here. diff --git a/common/djangoapps/util/tests/test_memcache.py b/common/djangoapps/util/tests/test_memcache.py index de8d352c3899ccca95603e160dbf6954fc313bd9..60b3a0d0cc21a05c178df3bd8dc9ea44556fc6f1 100644 --- a/common/djangoapps/util/tests/test_memcache.py +++ b/common/djangoapps/util/tests/test_memcache.py @@ -4,7 +4,6 @@ Tests for memcache in util app from django.test import TestCase from django.core.cache import get_cache -from django.conf import settings from util.memcache import safe_key diff --git a/common/djangoapps/util/tests/test_submit_feedback.py b/common/djangoapps/util/tests/test_submit_feedback.py index b66d3d642b2b3b9cb873b2d77944e2c5571f3d7a..6461ffa8b781f8c1f13b9756c9015a1cdd1800e8 100644 --- a/common/djangoapps/util/tests/test_submit_feedback.py +++ b/common/djangoapps/util/tests/test_submit_feedback.py @@ -1,6 +1,5 @@ """Tests for the Zendesk""" -from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.http import Http404 from django.test import TestCase diff --git a/common/djangoapps/util/views.py b/common/djangoapps/util/views.py index aa592d25e825b588561d302a6afeac8a773a7fdd..851202caec5c388cb375675d4544bed7e7af23bb 100644 --- a/common/djangoapps/util/views.py +++ b/common/djangoapps/util/views.py @@ -1,20 +1,12 @@ -import datetime import json import logging -import pprint import sys from django.conf import settings -from django.contrib.auth.models import User -from django.core.context_processors import csrf -from django.core.mail import send_mail from django.core.validators import ValidationError, validate_email -from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseNotAllowed, HttpResponseServerError -from django.shortcuts import redirect -from django_future.csrf import ensure_csrf_cookie +from django.http import Http404, HttpResponse, HttpResponseNotAllowed from dogapi import dog_stats_api -from mitxmako.shortcuts import render_to_response, render_to_string -from urllib import urlencode +from mitxmako.shortcuts import render_to_response import zendesk import calc diff --git a/common/lib/capa/capa/checker.py b/common/lib/capa/capa/checker.py index 15358aac9e44ae80e9b14ef363a85dc87b124a85..87cf68d2306f6056b1c5874a1c9f3335625f5631 100755 --- a/common/lib/capa/capa/checker.py +++ b/common/lib/capa/capa/checker.py @@ -10,7 +10,6 @@ import sys from path import path from cStringIO import StringIO -from collections import defaultdict from .calc import UndefinedVariable from .capa_problem import LoncapaProblem diff --git a/common/lib/capa/capa/customrender.py b/common/lib/capa/capa/customrender.py index 60d3ce578b9d7de25db6b6f34743f7730257cc38..9d7ff719accec8cd67e30408c898e8118fc1e144 100644 --- a/common/lib/capa/capa/customrender.py +++ b/common/lib/capa/capa/customrender.py @@ -10,8 +10,6 @@ from .registry import TagRegistry import logging import re -import shlex # for splitting quoted strings -import json from lxml import etree import xml.sax.saxutils as saxutils diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 80227490dad17c5f47db0df7d5ca71cd159672fd..be70e3866cd3c038c5198ea457fb8d27e77f0f53 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -11,7 +11,6 @@ Used by capa_problem.py # standard library imports import abc import cgi -import hashlib import inspect import json import logging diff --git a/common/lib/capa/capa/tests/test_html_render.py b/common/lib/capa/capa/tests/test_html_render.py index 62605b48f591f4ac0b26b4f254ee096c47efa3a9..9bc326d7b924afbfc3b00ac7504b6f7dbb93ab59 100644 --- a/common/lib/capa/capa/tests/test_html_render.py +++ b/common/lib/capa/capa/tests/test_html_render.py @@ -2,7 +2,6 @@ import unittest from lxml import etree import os import textwrap -import json import mock diff --git a/common/lib/capa/capa/util.py b/common/lib/capa/capa/util.py index ec43da6093f5d7d35ed613536f8683c85ed9d22d..433e99171d0c09d10945910f730158c713ee75f4 100644 --- a/common/lib/capa/capa/util.py +++ b/common/lib/capa/capa/util.py @@ -1,4 +1,4 @@ -from calc import evaluator, UndefinedVariable +from calc import evaluator from cmath import isinf #----------------------------------------------------------------------------- diff --git a/common/lib/chem/chem/chemcalc.py b/common/lib/chem/chem/chemcalc.py index 5b8000504497550a2045f9e5c25b45ce985336c2..612e63c0f0d8029178a28711e574099f9d2fef30 100644 --- a/common/lib/chem/chem/chemcalc.py +++ b/common/lib/chem/chem/chemcalc.py @@ -1,16 +1,7 @@ from __future__ import division -import copy from fractions import Fraction -import logging -import math -import operator -import re -import numpy -import numbers -import scipy.constants - -from pyparsing import (Literal, Keyword, Word, nums, StringEnd, Optional, - Forward, OneOrMore, ParseException) + +from pyparsing import (Literal, StringEnd, OneOrMore, ParseException) import nltk from nltk.tree import Tree diff --git a/common/lib/symmath/symmath/formula.py b/common/lib/symmath/symmath/formula.py index 8369baa27cfb1596a302811f94af2578c35d6758..a926d9ae4595d0852c3d11e1e26ff13e26a8d235 100644 --- a/common/lib/symmath/symmath/formula.py +++ b/common/lib/symmath/symmath/formula.py @@ -10,7 +10,6 @@ # Provides sympy representation. import os -import sys import string import re import logging @@ -25,8 +24,7 @@ from sympy.physics.quantum.state import * # from sympy.core.operations import LatticeOp # import sympy.physics.quantum.qubit -import urllib -from xml.sax.saxutils import escape, unescape +from xml.sax.saxutils import unescape import sympy import unicodedata from lxml import etree diff --git a/common/lib/symmath/symmath/symmath_check.py b/common/lib/symmath/symmath/symmath_check.py index 65a17883f5edab3838b066651328adb4eed7cbe7..3f09ebf659a55aac4c632ba1b1401ff91c6e6131 100644 --- a/common/lib/symmath/symmath/symmath_check.py +++ b/common/lib/symmath/symmath/symmath_check.py @@ -8,10 +8,6 @@ # # Takes in math expressions given as Presentation MathML (from ASCIIMathML), converts to Content MathML using SnuggleTeX -import os -import sys -import string -import re import traceback from .formula import * import logging diff --git a/common/lib/xmodule/xmodule/modulestore/tests/factories.py b/common/lib/xmodule/xmodule/modulestore/tests/factories.py index 99c5ec2c9100f6f73341c8290eb5b7ca769f401c..0a62849d8d072c586c6a2d01ac9f1e2641643c29 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/factories.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/factories.py @@ -1,5 +1,4 @@ from factory import Factory, lazy_attribute_sequence, lazy_attribute -from time import gmtime from uuid import uuid4 from xmodule.modulestore import Location from xmodule.modulestore.django import modulestore diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py index 469eedac05122407e2264b57fff82503a968f695..1e2035075a8a81dfc033fd3def14b15eaad4b2f6 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py @@ -1,6 +1,6 @@ -from nose.tools import assert_equals, assert_raises, assert_not_equals, with_setup +from nose.tools import assert_equals, assert_raises -from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem +from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.search import path_to_location diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py index 07e6124537869c34e4197d6dab76c5559cb70d67..c5ef0d751af7e750eb9d00147479981c9be0ef7c 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py @@ -1,6 +1,5 @@ import pymongo -from mock import Mock from nose.tools import assert_equals, assert_raises, assert_not_equals, assert_false from pprint import pprint diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py index 01be4c61ab085661fb09a9ff9ce71df73b2e5269..9fc438d4c0bc17dafaec2c48d4c752f7dd8d527a 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py @@ -1,13 +1,10 @@ import json import logging from lxml import etree -from lxml.html import rewrite_links from xmodule.timeinfo import TimeInfo from xmodule.capa_module import ComplexEncoder -from xmodule.editing_module import EditingDescriptor from xmodule.progress import Progress from xmodule.stringify import stringify_children -from xmodule.xml_module import XmlDescriptor import self_assessment_module import open_ended_module from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py index 3e3f943cd73387a013b64954d3d1a2a5acbf2aad..6857876703edf5595fc5f43201faa481b4930b5b 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py @@ -3,7 +3,6 @@ import json import logging import requests from requests.exceptions import RequestException, ConnectionError, HTTPError -import sys from .combined_open_ended_rubric import CombinedOpenEndedRubric from lxml import etree diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_image_submission.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_image_submission.py index 2eb95022690914741f658e617496d095f7a8a45b..ea5c3b352770f3eb7f4ae7ea662ffcb1c1ea64e6 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_image_submission.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_image_submission.py @@ -14,9 +14,7 @@ from urlparse import urlparse import requests from boto.s3.connection import S3Connection from boto.s3.key import Key -import pickle import logging -import re log = logging.getLogger(__name__) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py index 1e5b1b233b5ab8b6894022b595971e84237a3ab3..2ac55a83187d6abefda77fac959e0e5703a2bbf5 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py @@ -11,10 +11,8 @@ from lxml import etree import capa.xqueue_interface as xqueue_interface from xmodule.capa_module import ComplexEncoder -from xmodule.editing_module import EditingDescriptor from xmodule.progress import Progress from xmodule.stringify import stringify_children -from xmodule.xml_module import XmlDescriptor from capa.util import * import openendedchild diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index b5d4e1b676e5027627978135d2b83a163fa3d216..4f524d2cd7f142e3fbf45cfa492b0e201320aae2 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -3,14 +3,8 @@ import logging from lxml.html.clean import Cleaner, autolink_html import re -from xmodule.capa_module import ComplexEncoder import open_ended_image_submission -from xmodule.editing_module import EditingDescriptor -from xmodule.html_checker import check_html from xmodule.progress import Progress -from xmodule.stringify import stringify_children -from xmodule.xml_module import XmlDescriptor -from xmodule.modulestore import Location from capa.util import * from .peer_grading_service import PeerGradingService, MockPeerGradingService import controller_query_service diff --git a/common/lib/xmodule/xmodule/progress.py b/common/lib/xmodule/xmodule/progress.py index 7adbb02646e3cb6725bd87854dce9c2ec9cda427..bad5105fd0f4c19b11930770a4c996c8bd252eb7 100644 --- a/common/lib/xmodule/xmodule/progress.py +++ b/common/lib/xmodule/xmodule/progress.py @@ -13,7 +13,6 @@ For most subclassing needs, you should only need to reimplement frac() and __str__(). ''' -from collections import namedtuple import numbers diff --git a/common/lib/xmodule/xmodule/schematic_module.py b/common/lib/xmodule/xmodule/schematic_module.py index d15d629c24d1c32b901c3e535cc2e090b656d7fa..83bcc5351d66b6a0e30c495f043a576dd638c4b0 100644 --- a/common/lib/xmodule/xmodule/schematic_module.py +++ b/common/lib/xmodule/xmodule/schematic_module.py @@ -1,4 +1,3 @@ -import json from .x_module import XModule, XModuleDescriptor diff --git a/common/lib/xmodule/xmodule/template_module.py b/common/lib/xmodule/xmodule/template_module.py index 9a9666c0b6fcb1d8f22d34bd6dd9ca711904d3eb..bf8f616913cadf3e68dc304aa1b767cbc10fe716 100644 --- a/common/lib/xmodule/xmodule/template_module.py +++ b/common/lib/xmodule/xmodule/template_module.py @@ -3,7 +3,6 @@ from xmodule.raw_module import RawDescriptor from lxml import etree from mako.template import Template from xmodule.modulestore.django import modulestore -import logging class CustomTagModule(XModule): diff --git a/common/lib/xmodule/xmodule/tests/test_html_module.py b/common/lib/xmodule/xmodule/tests/test_html_module.py index e0a49ed98f671319702648f6bca66913a999573d..4fe02423787e4ece942f9d4947f2c29f96b87cca 100644 --- a/common/lib/xmodule/xmodule/tests/test_html_module.py +++ b/common/lib/xmodule/xmodule/tests/test_html_module.py @@ -3,7 +3,6 @@ import unittest from mock import Mock from xmodule.html_module import HtmlModule -from xmodule.modulestore import Location from . import get_test_system diff --git a/common/lib/xmodule/xmodule/tests/test_peer_grading.py b/common/lib/xmodule/xmodule/tests/test_peer_grading.py index 3e1a578118734e73f4e1cb14ea5661563af419e6..c386f77e9ba1777fd60af58aa741336ae5391178 100644 --- a/common/lib/xmodule/xmodule/tests/test_peer_grading.py +++ b/common/lib/xmodule/xmodule/tests/test_peer_grading.py @@ -2,10 +2,6 @@ import unittest from xmodule.modulestore import Location from .import get_test_system from test_util_open_ended import MockQueryDict, DummyModulestore -import json - -from xmodule.peer_grading_module import PeerGradingModule, PeerGradingDescriptor -from xmodule.open_ended_grading_classes.grading_service_module import GradingServiceError import logging diff --git a/common/lib/xmodule/xmodule/tests/test_randomize_module.py b/common/lib/xmodule/xmodule/tests/test_randomize_module.py index 81935c4013e1663aad9692d4fc9f5d3fd6fde5e5..81ba45b56c082fd8ea72698c349b7207e347fbfa 100644 --- a/common/lib/xmodule/xmodule/tests/test_randomize_module.py +++ b/common/lib/xmodule/xmodule/tests/test_randomize_module.py @@ -1,11 +1,6 @@ import unittest -from time import strptime -from fs.memoryfs import MemoryFS - -from mock import Mock, patch - -from xmodule.modulestore.xml import ImportSystem, XMLModuleStore +from .test_course_module import DummySystem as DummyImportSystem ORG = 'test_org' COURSE = 'test_course' @@ -13,9 +8,6 @@ COURSE = 'test_course' START = '2013-01-01T01:00:00' -from .test_course_module import DummySystem as DummyImportSystem - - class RandomizeModuleTestCase(unittest.TestCase): """Make sure the randomize module works""" @staticmethod diff --git a/common/lib/xmodule/xmodule/tests/test_stringify.py b/common/lib/xmodule/xmodule/tests/test_stringify.py index e44b93b0b8dbb74c66b84a5ef518779fabca1d43..6c2e44eed51970142a3670ff0eda5ecf9efdfd31 100644 --- a/common/lib/xmodule/xmodule/tests/test_stringify.py +++ b/common/lib/xmodule/xmodule/tests/test_stringify.py @@ -1,4 +1,4 @@ -from nose.tools import assert_equals, assert_true, assert_false +from nose.tools import assert_equals from lxml import etree from xmodule.stringify import stringify_children diff --git a/common/lib/xmodule/xmodule/tests/test_util_open_ended.py b/common/lib/xmodule/xmodule/tests/test_util_open_ended.py index 9dbb17ae2f883876cd467b148d59f075129126e2..63fb4631c98208860fbf1a3ba0e885f86b93db37 100644 --- a/common/lib/xmodule/xmodule/tests/test_util_open_ended.py +++ b/common/lib/xmodule/xmodule/tests/test_util_open_ended.py @@ -1,6 +1,6 @@ from .import get_test_system from xmodule.modulestore import Location -from xmodule.modulestore.xml import ImportSystem, XMLModuleStore +from xmodule.modulestore.xml import XMLModuleStore from xmodule.tests.test_export import DATA_DIR OPEN_ENDED_GRADING_INTERFACE = { diff --git a/common/lib/xmodule/xmodule/timelimit_module.py b/common/lib/xmodule/xmodule/timelimit_module.py index 6be14e7574c72880616c132d9b7a42c5941a4dc2..9446176f01e4b1b04e81a0d5250e6d2db3de7437 100644 --- a/common/lib/xmodule/xmodule/timelimit_module.py +++ b/common/lib/xmodule/xmodule/timelimit_module.py @@ -1,4 +1,3 @@ -import json import logging from lxml import etree