Commit 61b53713 by Ned Batchelder

Remove unused imports from lms, as detected by pylint.

parent df6d3f9b
import uuid
from django.db import models
from django.contrib.auth.models import User
class ServerCircuit(models.Model):
......
import json
import os
import xml.etree.ElementTree
from django.conf import settings
from django.http import Http404
from django.http import HttpResponse
from django.shortcuts import redirect
from mitxmako.shortcuts import render_to_response, render_to_string
from mitxmako.shortcuts import render_to_response
from .models import ServerCircuit
......
......@@ -2,7 +2,6 @@
Ideally, it will be the only place that needs to know about any special settings
like DISABLE_START_DATES"""
import logging
import time
from datetime import datetime, timedelta
from functools import partial
......
from collections import defaultdict
from fs.errors import ResourceNotFoundError
from functools import wraps
import logging
import inspect
from lxml.html import rewrite_links
from path import path
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from .module_render import get_module
......@@ -18,7 +13,6 @@ from xmodule.modulestore.django import modulestore
from xmodule.contentstore.content import StaticContent
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.x_module import XModule
from courseware.model_data import ModelDataCache
from static_replace import replace_static_urls
from courseware.access import has_access
......
......@@ -2,15 +2,12 @@ import os
import sys
import traceback
from filecmp import dircmp
from fs.osfs import OSFS
from path import path
from lxml import etree
from django.core.management.base import BaseCommand
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.errortracker import make_error_tracker
def traverse_tree(course):
......
......@@ -2,7 +2,6 @@
A script to walk a course xml tree, generate a dictionary of all the metadata,
and print it out as a json dict.
"""
import os
import sys
import json
......
import json
import logging
import pyparsing
import re
import sys
import static_replace
......
......@@ -11,23 +11,16 @@ actually generates the CourseTab.
from collections import namedtuple
import logging
import json
from django.conf import settings
from django.core.urlresolvers import reverse
from fs.errors import ResourceNotFoundError
from courseware.access import has_access
from lxml.html import rewrite_links
from .module_render import get_module
from courseware.access import has_access
from xmodule.modulestore import Location
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 open_ended_grading import open_ended_notifications
......
from mock import Mock, patch
from mock import Mock
from django.test import TestCase
......
......@@ -12,7 +12,7 @@ from django.test.utils import override_settings
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.tests.tests import LoginEnrollmentTestCase, TEST_DATA_XML_MODULESTORE, get_user
from xmodule.modulestore.django import modulestore
......
......@@ -8,7 +8,6 @@ from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.django import modulestore
import courseware.module_render as render
from courseware.tests.tests import LoginEnrollmentTestCase
......
from django.db import models
# Create your models here.
# Create your views here.
import json
from datetime import datetime
from django.http import Http404
from mitxmako.shortcuts import render_to_response
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.db import models
# Create your models here.
......@@ -5,7 +5,7 @@ import traceback
from django.http import Http404
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 codejail.safe_exec import safe_exec
......
from django.core.urlresolvers import reverse
from django.conf import settings
from mitxmako.shortcuts import render_to_string
from .mustache_helpers import mustache_helpers
from django.core.urlresolvers import reverse
from functools import partial
from .utils import *
......
from django.core.management.base import BaseCommand, CommandError
from django_comment_common.models import Permission, Role
from django.contrib.auth.models import User
......
from .utils import url_for_tags as _url_for_tags
import django.core.urlresolvers as urlresolvers
import urllib
import sys
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
from util.cache import cache
from django.core import cache
......
import django_comment_common.models as models
import django_comment_client.permissions as permissions
from django.test import TestCase
......@@ -44,7 +43,7 @@ class RoleClassTestCase(TestCase):
class PermissionClassTestCase(TestCase):
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):
self.assertEqual(str(self.permission), "test")
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from student.models import unique_id_for_user
log = logging.getLogger(__name__)
......
......@@ -5,7 +5,6 @@ from functools import partial
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import RequestFactory
from django.conf import settings
from django.core.urlresolvers import reverse
from foldit.views import foldit_ops, verify_code
......
......@@ -3,18 +3,10 @@
# django management command: dump grades to csv files
# for use by batch processes
import os
import sys
import string
import datetime
import json
#import student.models
from instructor.offline_gradecalc import *
from courseware.courses import get_course_by_id
from xmodule.modulestore.django import modulestore
from django.conf import settings
from django.core.management.base import BaseCommand
......
......@@ -6,16 +6,12 @@
# The grades are stored in the OfflineComputedGrade table of the courseware model.
import json
import logging
import time
import courseware.models
from collections import namedtuple
from json import JSONEncoder
from courseware import grades, models
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):
......
......@@ -9,7 +9,6 @@ from django.core.urlresolvers import reverse
from courseware.access import _course_staff_group_name
from courseware.tests.tests import LoginEnrollmentTestCase, TEST_DATA_XML_MODULESTORE, get_user
from xmodule.modulestore.django import modulestore
import xmodule.modulestore.django
from student.models import CourseEnrollment, CourseEnrollmentAllowed
from instructor.views import get_and_clean_student_list
......
......@@ -2,13 +2,11 @@
Tests of the instructor dashboard gradebook
"""
from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
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 mock import patch, DEFAULT
from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE
from capa.tests.response_xml_factory import StringResponseXMLFactory
from courseware.tests.factories import StudentModuleFactory
......
......@@ -3,7 +3,6 @@ Tests of various instructor dashboard features that include lists of students
"""
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from markupsafe import escape
......
......@@ -17,7 +17,6 @@ from django.core.urlresolvers import reverse
from capa.tests.response_xml_factory import (CodeResponseXMLFactory,
CustomResponseXMLFactory)
from xmodule.modulestore.tests.factories import ItemFactory
from xmodule.modulestore.exceptions import ItemNotFoundError
from courseware.model_data import StudentModule
......
......@@ -19,7 +19,7 @@ from courseware.tests.factories import StudentModuleFactory
from student.tests.factories import UserFactory
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.tasks import rescore_problem, reset_problem_attempts, delete_problem_state
from instructor_task.tasks_helper import UpdateProblemModuleStateError, update_problem_module_state
......
import os.path
from uuid import uuid4
from optparse import make_option
from django.utils.html import escape
from django.core.management.base import BaseCommand, CommandError
......
import os.path
from optparse import make_option
from django.utils.html import escape
from django.core.management.base import BaseCommand, CommandError
......
......@@ -5,13 +5,10 @@
# Create all staff_* groups for classes in data directory.
import os
import sys
import string
import re
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 Group
from path import path
from lxml import etree
......
......@@ -7,7 +7,6 @@
import os
import sys
import string
import re
import datetime
from getpass import getpass
import json
......
......@@ -4,17 +4,9 @@
#
# interactively list and edit membership in course staff and instructor groups
import os
import sys
import string
import re
import datetime
from getpass import getpass
import json
import readline
from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.auth.models import User, Group
#-----------------------------------------------------------------------------
......
......@@ -5,7 +5,6 @@
import json
import logging
import os
from pprint import pprint
import xmodule.modulestore.django as xmodule_django
from xmodule.modulestore.django import modulestore
......
......@@ -9,9 +9,7 @@ from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
import collections
import unittest
import json
import logging
from . import utils, api, models
......
......@@ -4,7 +4,6 @@ from mitxmako.shortcuts import render_to_response
from courseware.courses import get_course_with_access
from notes.models import Note
from notes.utils import notes_enabled_for_course
import json
@login_required
......
......@@ -5,7 +5,6 @@ LMS part of instructor grading:
- calls the instructor grading service
"""
import json
import logging
log = logging.getLogger(__name__)
......
......@@ -9,7 +9,6 @@ from mock import MagicMock, patch, Mock
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group
from django.http import HttpResponse
from django.conf import settings
from mitxmako.shortcuts import render_to_string
......
# Grading Views
import logging
import urllib
from django.conf import settings
from django.views.decorators.cache import cache_control
......
......@@ -2,10 +2,6 @@
#
# generate pyschometrics data from tracking logs and student module data
import os
import sys
import string
import datetime
import json
from courseware.models import *
......
from django.db import models
# Create your models here.
from django.db import models
# Create your models here.
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.core.urlresolvers import reverse
from mitxmako.shortcuts import render_to_response
from courseware.access import has_access
......
......@@ -305,7 +305,7 @@ COURSES_WITH_UNSAFE_CODE = []
############################ SIGNAL HANDLERS ################################
# This is imported to register the exception signal handling that logs exceptions
import monitoring.exceptions # noqa
import monitoring.exceptions # noqa # pylint: disable=W0611
############################### DJANGO BUILT-INS ###############################
# Change DEBUG/TEMPLATE_DEBUG in your environment settings files, not here
......
......@@ -18,7 +18,6 @@ if 'eecs1' in socket.gethostname():
MITX_ROOT_URL = '/mitx2'
from .common import *
from logsettings import get_logger_config
from .dev import *
if 'eecs1' in socket.gethostname():
......
......@@ -13,7 +13,6 @@ sessions. Assumes structure:
# pylint: disable=W0401, W0614
from .common import *
from logsettings import get_logger_config
from .dev import *
import socket
......
# Import other classes here so they can be imported from here.
# pylint: disable=W0611
from .comment import Comment
from .thread import Thread
from .user import User
......
from django.db import models
# Create your models here.
import logging
from dogapi import dog_http_api, dog_stats_api
from django.conf import settings
from xmodule.modulestore.django import modulestore
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')
for store_name in settings.MODULESTORE:
......
......@@ -3,7 +3,8 @@ from django.conf.urls import patterns, include, url
from django.contrib import admin
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
......
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