Commit 3eec09b8 by Ned Batchelder

Merge pull request #216 from edx/ned/remove-unused-imports

Ned/remove unused imports
parents d06a9a20 e775852e
from contentstore.utils import get_modulestore, get_url_reverse
from contentstore.tests.test_course_settings import CourseTestCase from contentstore.tests.test_course_settings import CourseTestCase
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
......
...@@ -153,9 +153,9 @@ class CourseDetails(object): ...@@ -153,9 +153,9 @@ class CourseDetails(object):
if not raw_video: if not raw_video:
return None return None
keystring_matcher = re.search('(?<=embed/)[a-zA-Z0-9_-]+', raw_video) keystring_matcher = re.search(r'(?<=embed/)[a-zA-Z0-9_-]+', raw_video)
if keystring_matcher is None: if keystring_matcher is None:
keystring_matcher = re.search('<?=\d+:[a-zA-Z0-9_-]+', raw_video) keystring_matcher = re.search(r'<?=\d+:[a-zA-Z0-9_-]+', raw_video)
if keystring_matcher: if keystring_matcher:
return keystring_matcher.group(0) return keystring_matcher.group(0)
......
from xmodule.modulestore import Location from xmodule.modulestore import Location
from contentstore.utils import get_modulestore from contentstore.utils import get_modulestore
from xmodule.x_module import XModuleDescriptor
from xmodule.modulestore.inheritance import own_metadata from xmodule.modulestore.inheritance import own_metadata
from xblock.core import Scope from xblock.core import Scope
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
......
...@@ -21,7 +21,7 @@ Longer TODO: ...@@ -21,7 +21,7 @@ Longer TODO:
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=W0401, W0614 # pylint: disable=W0401, W0611, W0614
import sys import sys
import lms.envs.common import lms.envs.common
......
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
# FORCE_SCRIPT_NAME = '/cms' # FORCE_SCRIPT_NAME = '/cms'
from .common import * from .common import *
from logsettings import get_logger_config
from .dev import * from .dev import *
import socket
MITX_FEATURES['AUTH_USE_MIT_CERTIFICATES'] = True MITX_FEATURES['AUTH_USE_MIT_CERTIFICATES'] = True
......
from django.conf import settings from django.conf import settings
from django.conf.urls import patterns, include, url from django.conf.urls import patterns, include, url
# Import this file so it can do its work, even though we don't use the name.
# pylint: disable=W0611
from . import one_time_startup from . import one_time_startup
# Uncomment the next two lines to enable the admin: # Uncomment the next two lines to enable the admin:
......
...@@ -12,7 +12,6 @@ from django.core.cache import cache ...@@ -12,7 +12,6 @@ from django.core.cache import cache
from django.db import DEFAULT_DB_ALIAS from django.db import DEFAULT_DB_ALIAS
from . import app_settings from . import app_settings
from xmodule.contentstore.content import StaticContent
def get_instance(model, instance_or_pk, timeout=None, using=None): def get_instance(model, instance_or_pk, timeout=None, using=None):
......
...@@ -3,7 +3,6 @@ This file contains the logic for cohort groups, as exposed internally to the ...@@ -3,7 +3,6 @@ This file contains the logic for cohort groups, as exposed internally to the
forums, and to the cohort admin views. forums, and to the cohort admin views.
""" """
from django.contrib.auth.models import User
from django.http import Http404 from django.http import Http404
import logging import logging
import random import random
...@@ -27,7 +26,7 @@ def local_random(): ...@@ -27,7 +26,7 @@ def local_random():
""" """
# ironic, isn't it? # ironic, isn't it?
global _local_random global _local_random
if _local_random is None: if _local_random is None:
_local_random = random.Random() _local_random = random.Random()
......
from django_future.csrf import ensure_csrf_cookie 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.views.decorators.http import require_POST
from django.contrib.auth.models import User 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.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseForbidden, Http404 from django.http import HttpResponse
from django.shortcuts import redirect
import json import json
import logging import logging
import re import re
from courseware.courses import get_course_with_access 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 from . import cohorts
import track.views
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -7,7 +7,6 @@ from django.template.loaders.filesystem import Loader as FilesystemLoader ...@@ -7,7 +7,6 @@ from django.template.loaders.filesystem import Loader as FilesystemLoader
from django.template.loaders.app_directories import Loader as AppDirectoriesLoader from django.template.loaders.app_directories import Loader as AppDirectoriesLoader
from mitxmako.template import Template from mitxmako.template import Template
import mitxmako.middleware
import tempdir import tempdir
......
...@@ -6,7 +6,6 @@ from django.conf import settings ...@@ -6,7 +6,6 @@ from django.conf import settings
import json import json
import logging import logging
import os import os
import sys
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -11,12 +11,7 @@ ...@@ -11,12 +11,7 @@
import datetime import datetime
import json import json
import os.path
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from student.models import UserProfile from student.models import UserProfile
......
...@@ -3,17 +3,11 @@ ...@@ -3,17 +3,11 @@
## See export for more info ## See export for more info
import datetime
import json import json
import dateutil.parser import dateutil.parser
import os.path
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from student.models import UserProfile from student.models import UserProfile
......
import os.path
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
import mitxmako.middleware as middleware import mitxmako.middleware as middleware
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
## A script to create some dummy users ## A script to create some dummy users
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings from student.models import CourseEnrollment
from django.contrib.auth.models import User
from student.models import UserProfile, CourseEnrollment
from student.views import _do_create_account, get_random_post_override from student.views import _do_create_account, get_random_post_override
......
import os.path
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
import mitxmako.middleware as middleware import mitxmako.middleware as middleware
......
import os.path
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
import mitxmako.middleware as middleware import mitxmako.middleware as middleware
......
import os.path import os.path
import time import time
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings from django.conf import settings
from django.contrib.auth.models import User
import mitxmako.middleware as middleware import mitxmako.middleware as middleware
......
...@@ -2,7 +2,7 @@ from optparse import make_option ...@@ -2,7 +2,7 @@ from optparse import make_option
from json import dump from json import dump
from datetime import datetime from datetime import datetime
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand
from student.models import TestCenterRegistration from student.models import TestCenterRegistration
......
...@@ -3,11 +3,8 @@ import csv ...@@ -3,11 +3,8 @@ import csv
from zipfile import ZipFile, is_zipfile from zipfile import ZipFile, is_zipfile
from time import strptime, strftime from time import strptime, strftime
from collections import OrderedDict
from datetime import datetime from datetime import datetime
from os.path import isdir from dogapi import dog_http_api
from optparse import make_option
from dogapi import dog_http_api, dog_stats_api
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from django.conf import settings from django.conf import settings
......
...@@ -26,7 +26,7 @@ class Command(BaseCommand): ...@@ -26,7 +26,7 @@ class Command(BaseCommand):
raise CommandError('Usage is set_staff {0}'.format(self.args)) raise CommandError('Usage is set_staff {0}'.format(self.args))
for user in args: for user in args:
if re.match('[^@]+@[^@]+\.[^@]+', user): if re.match(r'[^@]+@[^@]+\.[^@]+', user):
try: try:
v = User.objects.get(email=user) v = User.objects.get(email=user)
except: except:
......
...@@ -14,7 +14,7 @@ from django.test import TestCase ...@@ -14,7 +14,7 @@ from django.test import TestCase
from django.core.management import call_command from django.core.management import call_command
from nose.plugins.skip import SkipTest 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__) log = logging.getLogger(__name__)
......
import os.path
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
import mitxmako.middleware as middleware import mitxmako.middleware as middleware
......
...@@ -3,8 +3,8 @@ import feedparser ...@@ -3,8 +3,8 @@ import feedparser
import json import json
import logging import logging
import random import random
import re
import string import string
import sys
import urllib import urllib
import uuid import uuid
import time import time
...@@ -20,9 +20,9 @@ from django.core.mail import send_mail ...@@ -20,9 +20,9 @@ from django.core.mail import send_mail
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.core.validators import validate_email, validate_slug, ValidationError from django.core.validators import validate_email, validate_slug, ValidationError
from django.db import IntegrityError, transaction 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.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 django.utils.http import cookie_date
from mitxmako.shortcuts import render_to_response, render_to_string from mitxmako.shortcuts import render_to_response, render_to_string
...@@ -39,14 +39,11 @@ from certificates.models import CertificateStatuses, certificate_status_for_stud ...@@ -39,14 +39,11 @@ from certificates.models import CertificateStatuses, certificate_status_for_stud
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore import Location
from collections import namedtuple from collections import namedtuple
from courseware.courses import get_courses, sort_by_announcement from courseware.courses import get_courses, sort_by_announcement
from courseware.access import has_access 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 statsd import statsd
from pytz import UTC from pytz import UTC
...@@ -99,9 +96,8 @@ def course_from_id(course_id): ...@@ -99,9 +96,8 @@ def course_from_id(course_id):
course_loc = CourseDescriptor.id_to_location(course_id) course_loc = CourseDescriptor.id_to_location(course_id)
return modulestore().get_instance(course_id, course_loc) return modulestore().get_instance(course_id, course_loc)
import re day_pattern = re.compile(r'\s\d+,\s')
day_pattern = re.compile('\s\d+,\s') multimonth_pattern = re.compile(r'\s?\-\s?\S+\s')
multimonth_pattern = re.compile('\s?\-\s?\S+\s')
def get_date_for_press(publish_date): def get_date_for_press(publish_date):
......
...@@ -4,7 +4,6 @@ Browser set up for acceptance tests. ...@@ -4,7 +4,6 @@ Browser set up for acceptance tests.
#pylint: disable=E1101 #pylint: disable=E1101
#pylint: disable=W0613 #pylint: disable=W0613
#pylint: disable=W0611
from lettuce import before, after, world from lettuce import before, after, world
from splinter.browser import Browser from splinter.browser import Browser
...@@ -15,8 +14,9 @@ from selenium.common.exceptions import WebDriverException ...@@ -15,8 +14,9 @@ from selenium.common.exceptions import WebDriverException
# Let the LMS and CMS do their one-time setup # Let the LMS and CMS do their one-time setup
# For example, setting up mongo caches # For example, setting up mongo caches
from lms import one_time_startup # These names aren't used, but do important work on import.
from cms import one_time_startup 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 # There is an import issue when using django-staticfiles with lettuce
# Lettuce assumes that we are using django.contrib.staticfiles, # Lettuce assumes that we are using django.contrib.staticfiles,
......
# pylint: disable=C0111 # pylint: disable=C0111
# pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world
from .factories import * from .factories import *
from django.conf import settings from django.conf import settings
from django.http import HttpRequest from django.http import HttpRequest
...@@ -15,7 +15,6 @@ from xmodule.templates import update_templates ...@@ -15,7 +15,6 @@ from xmodule.templates import update_templates
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
import os.path import os.path
from urllib import quote_plus from urllib import quote_plus
from lettuce.django import django_url
@world.absorb @world.absorb
......
...@@ -15,13 +15,13 @@ from lettuce import world, step ...@@ -15,13 +15,13 @@ from lettuce import world, step
from .course_helpers import * from .course_helpers import *
from .ui_helpers import * from .ui_helpers import *
from lettuce.django import django_url from lettuce.django import django_url
from nose.tools import assert_equals, assert_in from nose.tools import assert_equals
from logging import getLogger from logging import getLogger
logger = getLogger(__name__) logger = getLogger(__name__)
@step(u'I wait (?:for )?"(\d+)" seconds?$') @step(r'I wait (?:for )?"(\d+)" seconds?$')
def wait(step, seconds): def wait(step, seconds):
world.wait(seconds) world.wait(seconds)
......
import json import json
from django.conf import settings
import views import views
......
from django.db import models
# Create your models here. # Create your models here.
...@@ -4,7 +4,6 @@ Tests for memcache in util app ...@@ -4,7 +4,6 @@ Tests for memcache in util app
from django.test import TestCase from django.test import TestCase
from django.core.cache import get_cache from django.core.cache import get_cache
from django.conf import settings
from util.memcache import safe_key from util.memcache import safe_key
......
"""Tests for the Zendesk""" """Tests for the Zendesk"""
from django.conf import settings
from django.contrib.auth.models import AnonymousUser from django.contrib.auth.models import AnonymousUser
from django.http import Http404 from django.http import Http404
from django.test import TestCase from django.test import TestCase
......
import datetime
import json import json
import logging import logging
import pprint
import sys import sys
from django.conf import settings 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.core.validators import ValidationError, validate_email
from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseNotAllowed, HttpResponseServerError from django.http import Http404, HttpResponse, HttpResponseNotAllowed
from django.shortcuts import redirect
from django_future.csrf import ensure_csrf_cookie
from dogapi import dog_stats_api from dogapi import dog_stats_api
from mitxmako.shortcuts import render_to_response, render_to_string from mitxmako.shortcuts import render_to_response
from urllib import urlencode
import zendesk import zendesk
import calc import calc
......
...@@ -103,8 +103,8 @@ class LoncapaProblem(object): ...@@ -103,8 +103,8 @@ class LoncapaProblem(object):
self.input_state = state.get('input_state', {}) self.input_state = state.get('input_state', {})
# Convert startouttext and endouttext to proper <text></text> # Convert startouttext and endouttext to proper <text></text>
problem_text = re.sub("startouttext\s*/", "text", problem_text) problem_text = re.sub(r"startouttext\s*/", "text", problem_text)
problem_text = re.sub("endouttext\s*/", "/text", problem_text) problem_text = re.sub(r"endouttext\s*/", "/text", problem_text)
self.problem_text = problem_text self.problem_text = problem_text
# parse problem XML file into an element tree # parse problem XML file into an element tree
......
...@@ -10,7 +10,6 @@ import sys ...@@ -10,7 +10,6 @@ import sys
from path import path from path import path
from cStringIO import StringIO from cStringIO import StringIO
from collections import defaultdict
from calc import UndefinedVariable from calc import UndefinedVariable
from capa.capa_problem import LoncapaProblem from capa.capa_problem import LoncapaProblem
......
...@@ -10,8 +10,6 @@ from .registry import TagRegistry ...@@ -10,8 +10,6 @@ from .registry import TagRegistry
import logging import logging
import re import re
import shlex # for splitting quoted strings
import json
from lxml import etree from lxml import etree
import xml.sax.saxutils as saxutils import xml.sax.saxutils as saxutils
...@@ -28,7 +26,7 @@ class MathRenderer(object): ...@@ -28,7 +26,7 @@ class MathRenderer(object):
tags = ['math'] tags = ['math']
def __init__(self, system, xml): def __init__(self, system, xml):
''' r'''
Render math using latex-like formatting. Render math using latex-like formatting.
Examples: Examples:
...@@ -43,7 +41,7 @@ class MathRenderer(object): ...@@ -43,7 +41,7 @@ class MathRenderer(object):
self.system = system self.system = system
self.xml = xml self.xml = xml
mathstr = re.sub('\$(.*)\$', r'[mathjaxinline]\1[/mathjaxinline]', xml.text) mathstr = re.sub(r'\$(.*)\$', r'[mathjaxinline]\1[/mathjaxinline]', xml.text)
mtag = 'mathjax' mtag = 'mathjax'
if not r'\displaystyle' in mathstr: if not r'\displaystyle' in mathstr:
mtag += 'inline' mtag += 'inline'
......
...@@ -856,7 +856,7 @@ class ImageInput(InputTypeBase): ...@@ -856,7 +856,7 @@ class ImageInput(InputTypeBase):
""" """
if value is of the form [x,y] then parse it and send along coordinates of previous answer if value is of the form [x,y] then parse it and send along coordinates of previous answer
""" """
m = re.match('\[([0-9]+),([0-9]+)]', m = re.match(r'\[([0-9]+),([0-9]+)]',
self.value.strip().replace(' ', '')) self.value.strip().replace(' ', ''))
if m: if m:
# Note: we subtract 15 to compensate for the size of the dot on the screen. # Note: we subtract 15 to compensate for the size of the dot on the screen.
......
...@@ -11,7 +11,6 @@ Used by capa_problem.py ...@@ -11,7 +11,6 @@ Used by capa_problem.py
# standard library imports # standard library imports
import abc import abc
import cgi import cgi
import hashlib
import inspect import inspect
import json import json
import logging import logging
...@@ -1903,8 +1902,7 @@ class ImageResponse(LoncapaResponse): ...@@ -1903,8 +1902,7 @@ class ImageResponse(LoncapaResponse):
if not given: # No answer to parse. Mark as incorrect and move on if not given: # No answer to parse. Mark as incorrect and move on
continue continue
# parse given answer # parse given answer
m = re.match( m = re.match(r'\[([0-9]+),([0-9]+)]', given.strip().replace(' ', ''))
'\[([0-9]+),([0-9]+)]', given.strip().replace(' ', ''))
if not m: if not m:
raise Exception('[capamodule.capa.responsetypes.imageinput] ' raise Exception('[capamodule.capa.responsetypes.imageinput] '
'error grading %s (input=%s)' % (aid, given)) 'error grading %s (input=%s)' % (aid, given))
...@@ -1919,7 +1917,7 @@ class ImageResponse(LoncapaResponse): ...@@ -1919,7 +1917,7 @@ class ImageResponse(LoncapaResponse):
# parse expected answer # parse expected answer
# TODO: Compile regexp on file load # TODO: Compile regexp on file load
m = re.match( m = re.match(
'[\(\[]([0-9]+),([0-9]+)[\)\]]-[\(\[]([0-9]+),([0-9]+)[\)\]]', r'[\(\[]([0-9]+),([0-9]+)[\)\]]-[\(\[]([0-9]+),([0-9]+)[\)\]]',
solution_rectangle.strip().replace(' ', '')) solution_rectangle.strip().replace(' ', ''))
if not m: if not m:
msg = 'Error in problem specification! cannot parse rectangle in %s' % ( msg = 'Error in problem specification! cannot parse rectangle in %s' % (
......
...@@ -2,7 +2,6 @@ import unittest ...@@ -2,7 +2,6 @@ import unittest
from lxml import etree from lxml import etree
import os import os
import textwrap import textwrap
import json
import mock import mock
......
from calc import evaluator, UndefinedVariable from calc import evaluator
from cmath import isinf from cmath import isinf
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
......
from __future__ import division from __future__ import division
import copy
from fractions import Fraction from fractions import Fraction
import logging
import math from pyparsing import (Literal, StringEnd, OneOrMore, ParseException)
import operator
import re
import numpy
import numbers
import scipy.constants
from pyparsing import (Literal, Keyword, Word, nums, StringEnd, Optional,
Forward, OneOrMore, ParseException)
import nltk import nltk
from nltk.tree import Tree from nltk.tree import Tree
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
# Provides sympy representation. # Provides sympy representation.
import os import os
import sys
import string import string
import re import re
import logging import logging
...@@ -25,8 +24,7 @@ from sympy.physics.quantum.state import * ...@@ -25,8 +24,7 @@ from sympy.physics.quantum.state import *
# from sympy.core.operations import LatticeOp # from sympy.core.operations import LatticeOp
# import sympy.physics.quantum.qubit # import sympy.physics.quantum.qubit
import urllib from xml.sax.saxutils import unescape
from xml.sax.saxutils import escape, unescape
import sympy import sympy
import unicodedata import unicodedata
from lxml import etree from lxml import etree
...@@ -52,7 +50,7 @@ class dot(sympy.operations.LatticeOp): # my dot product ...@@ -52,7 +50,7 @@ class dot(sympy.operations.LatticeOp): # my dot product
def _print_dot(self, expr): def _print_dot(self, expr):
return '{((%s) \cdot (%s))}' % (expr.args[0], expr.args[1]) return r'{((%s) \cdot (%s))}' % (expr.args[0], expr.args[1])
LatexPrinter._print_dot = _print_dot LatexPrinter._print_dot = _print_dot
...@@ -204,7 +202,7 @@ class formula(object): ...@@ -204,7 +202,7 @@ class formula(object):
return xml return xml
def preprocess_pmathml(self, xml): def preprocess_pmathml(self, xml):
''' r'''
Pre-process presentation MathML from ASCIIMathML to make it more Pre-process presentation MathML from ASCIIMathML to make it more
acceptable for SnuggleTeX, and also to accomodate some sympy acceptable for SnuggleTeX, and also to accomodate some sympy
conventions (eg hat(i) for \hat{i}). conventions (eg hat(i) for \hat{i}).
......
...@@ -8,10 +8,6 @@ ...@@ -8,10 +8,6 @@
# #
# Takes in math expressions given as Presentation MathML (from ASCIIMathML), converts to Content MathML using SnuggleTeX # 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 import traceback
from .formula import * from .formula import *
import logging import logging
......
from factory import Factory, lazy_attribute_sequence, lazy_attribute from factory import Factory, lazy_attribute_sequence, lazy_attribute
from time import gmtime
from uuid import uuid4 from uuid import uuid4
from xmodule.modulestore import Location from xmodule.modulestore import Location
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
......
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 from xmodule.modulestore.search import path_to_location
......
import pymongo import pymongo
from mock import Mock
from nose.tools import assert_equals, assert_raises, assert_not_equals, assert_false from nose.tools import assert_equals, assert_raises, assert_not_equals, assert_false
from pprint import pprint from pprint import pprint
......
...@@ -38,7 +38,7 @@ log = logging.getLogger(__name__) ...@@ -38,7 +38,7 @@ log = logging.getLogger(__name__)
# into the cms from xml # into the cms from xml
def clean_out_mako_templating(xml_string): def clean_out_mako_templating(xml_string):
xml_string = xml_string.replace('%include', 'include') xml_string = xml_string.replace('%include', 'include')
xml_string = re.sub("(?m)^\s*%.*$", '', xml_string) xml_string = re.sub(r"(?m)^\s*%.*$", '', xml_string)
return xml_string return xml_string
......
import json import json
import logging import logging
from lxml import etree from lxml import etree
from lxml.html import rewrite_links
from xmodule.timeinfo import TimeInfo from xmodule.timeinfo import TimeInfo
from xmodule.capa_module import ComplexEncoder from xmodule.capa_module import ComplexEncoder
from xmodule.editing_module import EditingDescriptor
from xmodule.progress import Progress from xmodule.progress import Progress
from xmodule.stringify import stringify_children from xmodule.stringify import stringify_children
from xmodule.xml_module import XmlDescriptor
import self_assessment_module import self_assessment_module
import open_ended_module import open_ended_module
from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST
......
...@@ -3,7 +3,6 @@ import json ...@@ -3,7 +3,6 @@ import json
import logging import logging
import requests import requests
from requests.exceptions import RequestException, ConnectionError, HTTPError from requests.exceptions import RequestException, ConnectionError, HTTPError
import sys
from .combined_open_ended_rubric import CombinedOpenEndedRubric from .combined_open_ended_rubric import CombinedOpenEndedRubric
from lxml import etree from lxml import etree
......
...@@ -14,9 +14,7 @@ from urlparse import urlparse ...@@ -14,9 +14,7 @@ from urlparse import urlparse
import requests import requests
from boto.s3.connection import S3Connection from boto.s3.connection import S3Connection
from boto.s3.key import Key from boto.s3.key import Key
import pickle
import logging import logging
import re
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -11,10 +11,8 @@ from lxml import etree ...@@ -11,10 +11,8 @@ from lxml import etree
import capa.xqueue_interface as xqueue_interface import capa.xqueue_interface as xqueue_interface
from xmodule.capa_module import ComplexEncoder from xmodule.capa_module import ComplexEncoder
from xmodule.editing_module import EditingDescriptor
from xmodule.progress import Progress from xmodule.progress import Progress
from xmodule.stringify import stringify_children from xmodule.stringify import stringify_children
from xmodule.xml_module import XmlDescriptor
from capa.util import * from capa.util import *
import openendedchild import openendedchild
......
...@@ -3,14 +3,8 @@ import logging ...@@ -3,14 +3,8 @@ import logging
from lxml.html.clean import Cleaner, autolink_html from lxml.html.clean import Cleaner, autolink_html
import re import re
from xmodule.capa_module import ComplexEncoder
import open_ended_image_submission 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.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 capa.util import *
from .peer_grading_service import PeerGradingService, MockPeerGradingService from .peer_grading_service import PeerGradingService, MockPeerGradingService
import controller_query_service import controller_query_service
......
...@@ -13,7 +13,6 @@ For most subclassing needs, you should only need to reimplement ...@@ -13,7 +13,6 @@ For most subclassing needs, you should only need to reimplement
frac() and __str__(). frac() and __str__().
''' '''
from collections import namedtuple
import numbers import numbers
......
import json
from .x_module import XModule, XModuleDescriptor from .x_module import XModule, XModuleDescriptor
......
...@@ -3,7 +3,6 @@ from xmodule.raw_module import RawDescriptor ...@@ -3,7 +3,6 @@ from xmodule.raw_module import RawDescriptor
from lxml import etree from lxml import etree
from mako.template import Template from mako.template import Template
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
import logging
class CustomTagModule(XModule): class CustomTagModule(XModule):
......
...@@ -3,7 +3,6 @@ import unittest ...@@ -3,7 +3,6 @@ import unittest
from mock import Mock from mock import Mock
from xmodule.html_module import HtmlModule from xmodule.html_module import HtmlModule
from xmodule.modulestore import Location
from . import get_test_system from . import get_test_system
......
...@@ -2,10 +2,6 @@ import unittest ...@@ -2,10 +2,6 @@ import unittest
from xmodule.modulestore import Location from xmodule.modulestore import Location
from .import get_test_system from .import get_test_system
from test_util_open_ended import MockQueryDict, DummyModulestore 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 import logging
......
import unittest 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' ORG = 'test_org'
COURSE = 'test_course' COURSE = 'test_course'
...@@ -13,9 +8,6 @@ COURSE = 'test_course' ...@@ -13,9 +8,6 @@ COURSE = 'test_course'
START = '2013-01-01T01:00:00' START = '2013-01-01T01:00:00'
from .test_course_module import DummySystem as DummyImportSystem
class RandomizeModuleTestCase(unittest.TestCase): class RandomizeModuleTestCase(unittest.TestCase):
"""Make sure the randomize module works""" """Make sure the randomize module works"""
@staticmethod @staticmethod
......
from nose.tools import assert_equals, assert_true, assert_false from nose.tools import assert_equals
from lxml import etree from lxml import etree
from xmodule.stringify import stringify_children from xmodule.stringify import stringify_children
...@@ -12,7 +12,7 @@ def test_stringify(): ...@@ -12,7 +12,7 @@ def test_stringify():
def test_stringify_again(): def test_stringify_again():
html = """<html name="Voltage Source Answer" >A voltage source is non-linear! html = r"""<html name="Voltage Source Answer" >A voltage source is non-linear!
<div align="center"> <div align="center">
<img src="/static/images/circuits/voltage-source.png"/> <img src="/static/images/circuits/voltage-source.png"/>
\(V=V_C\) \(V=V_C\)
......
from .import get_test_system from .import get_test_system
from xmodule.modulestore import Location 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 from xmodule.tests.test_export import DATA_DIR
OPEN_ENDED_GRADING_INTERFACE = { OPEN_ENDED_GRADING_INTERFACE = {
......
import json
import logging import logging
from lxml import etree from lxml import etree
......
import uuid
from django.db import models from django.db import models
from django.contrib.auth.models import User
class ServerCircuit(models.Model): class ServerCircuit(models.Model):
......
import json import json
import os
import xml.etree.ElementTree import xml.etree.ElementTree
from django.conf import settings
from django.http import Http404 from django.http import Http404
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import redirect from mitxmako.shortcuts import render_to_response
from mitxmako.shortcuts import render_to_response, render_to_string
from .models import ServerCircuit from .models import ServerCircuit
......
...@@ -49,7 +49,7 @@ def course_wiki_redirect(request, course_id): ...@@ -49,7 +49,7 @@ def course_wiki_redirect(request, course_id):
if not course_slug: if not course_slug:
log.exception("This course is improperly configured. The slug cannot be empty.") log.exception("This course is improperly configured. The slug cannot be empty.")
valid_slug = False valid_slug = False
if re.match('^[-\w\.]+$', course_slug) is None: if re.match(r'^[-\w\.]+$', course_slug) is None:
log.exception("This course is improperly configured. The slug can only contain letters, numbers, periods or hyphens.") log.exception("This course is improperly configured. The slug can only contain letters, numbers, periods or hyphens.")
valid_slug = False valid_slug = False
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
Ideally, it will be the only place that needs to know about any special settings Ideally, it will be the only place that needs to know about any special settings
like DISABLE_START_DATES""" like DISABLE_START_DATES"""
import logging import logging
import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
from functools import partial from functools import partial
......
from collections import defaultdict from collections import defaultdict
from fs.errors import ResourceNotFoundError from fs.errors import ResourceNotFoundError
from functools import wraps
import logging import logging
import inspect import inspect
from lxml.html import rewrite_links
from path import path from path import path
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404 from django.http import Http404
from .module_render import get_module from .module_render import get_module
...@@ -18,7 +13,6 @@ from xmodule.modulestore.django import modulestore ...@@ -18,7 +13,6 @@ from xmodule.modulestore.django import modulestore
from xmodule.contentstore.content import StaticContent from xmodule.contentstore.content import StaticContent
from xmodule.modulestore.xml import XMLModuleStore from xmodule.modulestore.xml import XMLModuleStore
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.x_module import XModule
from courseware.model_data import ModelDataCache from courseware.model_data import ModelDataCache
from static_replace import replace_static_urls from static_replace import replace_static_urls
from courseware.access import has_access from courseware.access import has_access
......
...@@ -2,15 +2,12 @@ import os ...@@ -2,15 +2,12 @@ import os
import sys import sys
import traceback import traceback
from filecmp import dircmp
from fs.osfs import OSFS from fs.osfs import OSFS
from path import path from path import path
from lxml import etree
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from xmodule.modulestore.xml import XMLModuleStore from xmodule.modulestore.xml import XMLModuleStore
from xmodule.errortracker import make_error_tracker
def traverse_tree(course): def traverse_tree(course):
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
A script to walk a course xml tree, generate a dictionary of all the metadata, A script to walk a course xml tree, generate a dictionary of all the metadata,
and print it out as a json dict. and print it out as a json dict.
""" """
import os
import sys import sys
import json import json
......
import json import json
import logging import logging
import pyparsing
import re import re
import sys import sys
import static_replace import static_replace
......
...@@ -11,23 +11,16 @@ actually generates the CourseTab. ...@@ -11,23 +11,16 @@ actually generates the CourseTab.
from collections import namedtuple from collections import namedtuple
import logging import logging
import json
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from fs.errors import ResourceNotFoundError
from courseware.access import has_access from courseware.access import has_access
from lxml.html import rewrite_links
from .module_render import get_module from .module_render import get_module
from courseware.access import has_access from courseware.access import has_access
from xmodule.modulestore import Location from xmodule.modulestore import Location
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.x_module import XModule
from student.models import unique_id_for_user
from courseware.model_data import ModelDataCache from courseware.model_data import ModelDataCache
from open_ended_grading import open_ended_notifications from open_ended_grading import open_ended_notifications
......
from mock import Mock, patch from mock import Mock
from django.test import TestCase from django.test import TestCase
......
...@@ -12,7 +12,7 @@ from django.test.utils import override_settings ...@@ -12,7 +12,7 @@ from django.test.utils import override_settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Group from django.contrib.auth.models import Group
from courseware.access import _course_staff_group_name from courseware.access import _course_staff_group_name
from courseware.tests.tests import LoginEnrollmentTestCase, TEST_DATA_XML_MODULESTORE, get_user from courseware.tests.tests import LoginEnrollmentTestCase, TEST_DATA_XML_MODULESTORE, get_user
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
......
...@@ -8,7 +8,6 @@ from django.test import TestCase ...@@ -8,7 +8,6 @@ from django.test import TestCase
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.test.utils import override_settings from django.test.utils import override_settings
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
import courseware.module_render as render import courseware.module_render as render
from courseware.tests.tests import LoginEnrollmentTestCase from courseware.tests.tests import LoginEnrollmentTestCase
......
from django.db import models
# Create your models here. # Create your models here.
# Create your views here.
import json
from datetime import datetime
from django.http import Http404 from django.http import Http404
from mitxmako.shortcuts import render_to_response from mitxmako.shortcuts import render_to_response
from django.db import connection from django.db import connection
from student.models import CourseEnrollment, CourseEnrollmentAllowed from student.models import CourseEnrollment
from django.contrib.auth.models import User from django.contrib.auth.models import User
......
from django.db import models
# Create your models here. # Create your models here.
...@@ -5,7 +5,7 @@ import traceback ...@@ -5,7 +5,7 @@ import traceback
from django.http import Http404 from django.http import Http404
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django_future.csrf import ensure_csrf_cookie, csrf_exempt from django_future.csrf import ensure_csrf_cookie
from mitxmako.shortcuts import render_to_response from mitxmako.shortcuts import render_to_response
from codejail.safe_exec import safe_exec from codejail.safe_exec import safe_exec
......
from django.core.urlresolvers import reverse
from django.conf import settings from django.conf import settings
from mitxmako.shortcuts import render_to_string
from .mustache_helpers import mustache_helpers from .mustache_helpers import mustache_helpers
from django.core.urlresolvers import reverse
from functools import partial from functools import partial
from .utils import * from .utils import *
......
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from django_comment_common.models import Permission, Role
from django.contrib.auth.models import User from django.contrib.auth.models import User
......
from .utils import url_for_tags as _url_for_tags from .utils import url_for_tags as _url_for_tags
import django.core.urlresolvers as urlresolvers import django.core.urlresolvers as urlresolvers
import urllib
import sys import sys
import inspect import inspect
......
from django_comment_common.models import Role, Permission
from django.db.models.signals import post_save
from django.dispatch import receiver
from student.models import CourseEnrollment
import logging import logging
from util.cache import cache from util.cache import cache
from django.core import cache from django.core import cache
......
import django_comment_common.models as models import django_comment_common.models as models
import django_comment_client.permissions as permissions
from django.test import TestCase from django.test import TestCase
...@@ -44,7 +43,7 @@ class RoleClassTestCase(TestCase): ...@@ -44,7 +43,7 @@ class RoleClassTestCase(TestCase):
class PermissionClassTestCase(TestCase): class PermissionClassTestCase(TestCase):
def setUp(self): def setUp(self):
self.permission = permissions.Permission.objects.get_or_create(name="test")[0] self.permission = models.Permission.objects.get_or_create(name="test")[0]
def testUnicode(self): def testUnicode(self):
self.assertEqual(str(self.permission), "test") self.assertEqual(str(self.permission), "test")
import logging import logging
from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.db import models from django.db import models
from student.models import unique_id_for_user
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -5,7 +5,6 @@ from functools import partial ...@@ -5,7 +5,6 @@ from functools import partial
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.test import TestCase from django.test import TestCase
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.conf import settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from foldit.views import foldit_ops, verify_code from foldit.views import foldit_ops, verify_code
......
...@@ -50,7 +50,7 @@ def foldit_ops(request): ...@@ -50,7 +50,7 @@ def foldit_ops(request):
# To allow for fixes without breaking this, the regex should only # To allow for fixes without breaking this, the regex should only
# match unquoted strings, # match unquoted strings,
a = re.compile(r':([a-zA-Z]*),') a = re.compile(r':([a-zA-Z]*),')
puzzle_scores_json = re.sub(a, ':"\g<1>",', puzzle_scores_json) puzzle_scores_json = re.sub(a, r':"\g<1>",', puzzle_scores_json)
puzzle_scores = json.loads(puzzle_scores_json) puzzle_scores = json.loads(puzzle_scores_json)
responses.append(save_scores(request.user, puzzle_scores)) responses.append(save_scores(request.user, puzzle_scores))
......
...@@ -3,18 +3,10 @@ ...@@ -3,18 +3,10 @@
# django management command: dump grades to csv files # django management command: dump grades to csv files
# for use by batch processes # for use by batch processes
import os
import sys
import string
import datetime
import json
#import student.models
from instructor.offline_gradecalc import * from instructor.offline_gradecalc import *
from courseware.courses import get_course_by_id from courseware.courses import get_course_by_id
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from django.conf import settings
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
......
...@@ -6,16 +6,12 @@ ...@@ -6,16 +6,12 @@
# The grades are stored in the OfflineComputedGrade table of the courseware model. # The grades are stored in the OfflineComputedGrade table of the courseware model.
import json import json
import logging
import time import time
import courseware.models
from collections import namedtuple
from json import JSONEncoder from json import JSONEncoder
from courseware import grades, models from courseware import grades, models
from courseware.courses import get_course_by_id from courseware.courses import get_course_by_id
from django.contrib.auth.models import User, Group from django.contrib.auth.models import User
class MyEncoder(JSONEncoder): class MyEncoder(JSONEncoder):
......
...@@ -9,7 +9,6 @@ from django.core.urlresolvers import reverse ...@@ -9,7 +9,6 @@ from django.core.urlresolvers import reverse
from courseware.access import _course_staff_group_name from courseware.access import _course_staff_group_name
from courseware.tests.tests import LoginEnrollmentTestCase, TEST_DATA_XML_MODULESTORE, get_user from courseware.tests.tests import LoginEnrollmentTestCase, TEST_DATA_XML_MODULESTORE, get_user
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
import xmodule.modulestore.django
from student.models import CourseEnrollment, CourseEnrollmentAllowed from student.models import CourseEnrollment, CourseEnrollmentAllowed
from instructor.views import get_and_clean_student_list from instructor.views import get_and_clean_student_list
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
Tests of the instructor dashboard gradebook Tests of the instructor dashboard gradebook
""" """
from django.test import TestCase
from django.test.utils import override_settings from django.test.utils import override_settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from student.tests.factories import UserFactory, CourseEnrollmentFactory, UserProfileFactory, AdminFactory from student.tests.factories import UserFactory, CourseEnrollmentFactory, AdminFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from mock import patch, DEFAULT
from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE
from capa.tests.response_xml_factory import StringResponseXMLFactory from capa.tests.response_xml_factory import StringResponseXMLFactory
from courseware.tests.factories import StudentModuleFactory from courseware.tests.factories import StudentModuleFactory
......
...@@ -3,7 +3,6 @@ Tests of various instructor dashboard features that include lists of students ...@@ -3,7 +3,6 @@ Tests of various instructor dashboard features that include lists of students
""" """
from django.conf import settings from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.test.utils import override_settings from django.test.utils import override_settings
from markupsafe import escape from markupsafe import escape
......
...@@ -17,7 +17,6 @@ from django.core.urlresolvers import reverse ...@@ -17,7 +17,6 @@ from django.core.urlresolvers import reverse
from capa.tests.response_xml_factory import (CodeResponseXMLFactory, from capa.tests.response_xml_factory import (CodeResponseXMLFactory,
CustomResponseXMLFactory) CustomResponseXMLFactory)
from xmodule.modulestore.tests.factories import ItemFactory from xmodule.modulestore.tests.factories import ItemFactory
from xmodule.modulestore.exceptions import ItemNotFoundError
from courseware.model_data import StudentModule from courseware.model_data import StudentModule
......
...@@ -19,7 +19,7 @@ from courseware.tests.factories import StudentModuleFactory ...@@ -19,7 +19,7 @@ from courseware.tests.factories import StudentModuleFactory
from student.tests.factories import UserFactory from student.tests.factories import UserFactory
from instructor_task.models import InstructorTask from instructor_task.models import InstructorTask
from instructor_task.tests.test_base import InstructorTaskModuleTestCase, TEST_COURSE_ORG, TEST_COURSE_NUMBER from instructor_task.tests.test_base import InstructorTaskModuleTestCase
from instructor_task.tests.factories import InstructorTaskFactory from instructor_task.tests.factories import InstructorTaskFactory
from instructor_task.tasks import rescore_problem, reset_problem_attempts, delete_problem_state from instructor_task.tasks import rescore_problem, reset_problem_attempts, delete_problem_state
from instructor_task.tasks_helper import UpdateProblemModuleStateError, update_problem_module_state from instructor_task.tasks_helper import UpdateProblemModuleStateError, update_problem_module_state
......
import os.path
from uuid import uuid4 from uuid import uuid4
from optparse import make_option
from django.utils.html import escape from django.utils.html import escape
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
......
import os.path import os.path
from optparse import make_option
from django.utils.html import escape from django.utils.html import escape
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
......
...@@ -5,13 +5,10 @@ ...@@ -5,13 +5,10 @@
# Create all staff_* groups for classes in data directory. # Create all staff_* groups for classes in data directory.
import os import os
import sys
import string
import re
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings from django.conf import settings
from django.contrib.auth.models import User, Group from django.contrib.auth.models import Group
from path import path from path import path
from lxml import etree from lxml import etree
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
import os import os
import sys import sys
import string import string
import re
import datetime import datetime
from getpass import getpass from getpass import getpass
import json import json
......
...@@ -4,17 +4,9 @@ ...@@ -4,17 +4,9 @@
# #
# interactively list and edit membership in course staff and instructor groups # interactively list and edit membership in course staff and instructor groups
import os
import sys
import string
import re import re
import datetime
from getpass import getpass
import json
import readline
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User, Group from django.contrib.auth.models import User, Group
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import json import json
import logging import logging
import os import os
from pprint import pprint
import xmodule.modulestore.django as xmodule_django import xmodule.modulestore.django as xmodule_django
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
......
...@@ -9,9 +9,7 @@ from django.contrib.auth.models import User ...@@ -9,9 +9,7 @@ from django.contrib.auth.models import User
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
import collections import collections
import unittest
import json import json
import logging
from . import utils, api, models from . import utils, api, models
......
...@@ -4,7 +4,6 @@ from mitxmako.shortcuts import render_to_response ...@@ -4,7 +4,6 @@ from mitxmako.shortcuts import render_to_response
from courseware.courses import get_course_with_access from courseware.courses import get_course_with_access
from notes.models import Note from notes.models import Note
from notes.utils import notes_enabled_for_course from notes.utils import notes_enabled_for_course
import json
@login_required @login_required
......
...@@ -5,7 +5,6 @@ LMS part of instructor grading: ...@@ -5,7 +5,6 @@ LMS part of instructor grading:
- calls the instructor grading service - calls the instructor grading service
""" """
import json
import logging import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -9,7 +9,6 @@ from mock import MagicMock, patch, Mock ...@@ -9,7 +9,6 @@ from mock import MagicMock, patch, Mock
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group from django.contrib.auth.models import Group
from django.http import HttpResponse
from django.conf import settings from django.conf import settings
from mitxmako.shortcuts import render_to_string from mitxmako.shortcuts import render_to_string
......
# Grading Views # Grading Views
import logging import logging
import urllib
from django.conf import settings from django.conf import settings
from django.views.decorators.cache import cache_control from django.views.decorators.cache import cache_control
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
# #
# generate pyschometrics data from tracking logs and student module data # generate pyschometrics data from tracking logs and student module data
import os
import sys
import string
import datetime
import json import json
from courseware.models import * from courseware.models import *
......
from django.db import models
# Create your models here. # Create your models here.
from django.db import models
# Create your models here. # Create your models here.
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.http import Http404 from django.http import Http404
from django.core.urlresolvers import reverse
from mitxmako.shortcuts import render_to_response from mitxmako.shortcuts import render_to_response
from courseware.access import has_access from courseware.access import has_access
......
...@@ -21,7 +21,7 @@ Longer TODO: ...@@ -21,7 +21,7 @@ Longer TODO:
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=W0401, W0614 # pylint: disable=W0401, W0611, W0614
import sys import sys
import os import os
......
...@@ -18,7 +18,6 @@ if 'eecs1' in socket.gethostname(): ...@@ -18,7 +18,6 @@ if 'eecs1' in socket.gethostname():
MITX_ROOT_URL = '/mitx2' MITX_ROOT_URL = '/mitx2'
from .common import * from .common import *
from logsettings import get_logger_config
from .dev import * from .dev import *
if 'eecs1' in socket.gethostname(): if 'eecs1' in socket.gethostname():
......
...@@ -13,7 +13,6 @@ sessions. Assumes structure: ...@@ -13,7 +13,6 @@ sessions. Assumes structure:
# pylint: disable=W0401, W0614 # pylint: disable=W0401, W0614
from .common import * from .common import *
from logsettings import get_logger_config
from .dev import * from .dev import *
import socket import socket
......
# Import other classes here so they can be imported from here.
# pylint: disable=W0611
from .comment import Comment from .comment import Comment
from .thread import Thread from .thread import Thread
from .user import User from .user import User
......
from django.db import models
# Create your models here. # Create your models here.
import logging
from dogapi import dog_http_api, dog_stats_api from dogapi import dog_http_api, dog_stats_api
from django.conf import settings from django.conf import settings
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from request_cache.middleware import RequestCache from request_cache.middleware import RequestCache
from django.core.cache import get_cache, InvalidCacheBackendError from django.core.cache import get_cache
cache = get_cache('mongo_metadata_inheritance') cache = get_cache('mongo_metadata_inheritance')
for store_name in settings.MODULESTORE: for store_name in settings.MODULESTORE:
......
...@@ -3,7 +3,8 @@ from django.conf.urls import patterns, include, url ...@@ -3,7 +3,8 @@ from django.conf.urls import patterns, include, url
from django.contrib import admin from django.contrib import admin
from django.conf.urls.static import static from django.conf.urls.static import static
from . import one_time_startup # Not used, the work is done in the imported module.
from . import one_time_startup # pylint: disable=W0611
import django.contrib.auth.views import django.contrib.auth.views
......
...@@ -35,9 +35,11 @@ load-plugins= ...@@ -35,9 +35,11 @@ load-plugins=
# it should appear only once). # it should appear only once).
disable= disable=
# Never going to use these # Never going to use these
# I0011: Locally disabling W0232
# C0301: Line too long # C0301: Line too long
# W0142: Used * or ** magic
# W0141: Used builtin function 'map' # W0141: Used builtin function 'map'
# W0142: Used * or ** magic
I0011,C0301,W0141,W0142,
# Might use these when the code is in better shape # Might use these when the code is in better shape
# C0302: Too many lines in module # C0302: Too many lines in module
...@@ -50,7 +52,7 @@ disable= ...@@ -50,7 +52,7 @@ disable=
# R0912: Too many branches # R0912: Too many branches
# R0913: Too many arguments # R0913: Too many arguments
# R0914: Too many local variables # R0914: Too many local variables
C0301,C0302,W0141,W0142,R0201,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914 C0302,R0201,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914
[REPORTS] [REPORTS]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment