Change Location, CourseLocator, etc to reference opaque-keys library
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from cache_toolbox.core import get_cached_content, set_cached_content, del_cached_content
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.contentstore.content import StaticContent
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ after deleting it creates same course again
|
||||
from contentstore.tests.utils import AjaxEnabledTestClient
|
||||
from contentstore.utils import delete_course_and_groups, reverse_url
|
||||
from courseware.tests.factories import UserFactory
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import datetime
|
||||
import json
|
||||
from json.encoder import JSONEncoder
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
from contentstore.utils import get_modulestore, course_image_url
|
||||
from models.settings import course_grading
|
||||
|
||||
@@ -4,7 +4,8 @@ from student.models import CourseEnrollment
|
||||
|
||||
from xmodule.contentstore.django import contentstore
|
||||
from xmodule.contentstore.content import StaticContent, XASSET_LOCATION_TAG
|
||||
from xmodule.modulestore import InvalidLocationError, InvalidKeyError
|
||||
from xmodule.modulestore import InvalidLocationError
|
||||
from opaque_keys import InvalidKeyError
|
||||
from cache_toolbox.core import get_cached_content, set_cached_content
|
||||
from xmodule.exceptions import NotFoundError
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ from opaque_keys import InvalidKeyError
|
||||
from student.models import CourseEnrollment
|
||||
from student.roles import CourseStaffRole
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.django import loc_mapper
|
||||
from xmodule.modulestore.exceptions import InsufficientSpecificationError
|
||||
from xmodule.modulestore.tests.django_utils import (ModuleStoreTestCase,
|
||||
|
||||
@@ -47,7 +47,6 @@ from ratelimitbackend.exceptions import RateLimitException
|
||||
import student.views
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
|
||||
log = logging.getLogger("edx.external_auth")
|
||||
|
||||
@@ -53,7 +53,7 @@ from xmodule.course_module import CourseDescriptor
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from xmodule.modulestore import XML_MODULESTORE_TYPE, Location
|
||||
from xmodule.modulestore import XML_MODULESTORE_TYPE
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from datetime import datetime
|
||||
import dateutil.parser
|
||||
from lazy import lazy
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.partitions.partitions import UserPartition
|
||||
from xmodule.seq_module import SequenceDescriptor, SequenceModule
|
||||
from xmodule.graders import grader_from_conf
|
||||
|
||||
@@ -11,7 +11,8 @@ from opaque_keys import InvalidKeyError
|
||||
|
||||
from . import ModuleStoreWriteBase
|
||||
from xmodule.modulestore.django import create_modulestore_instance, loc_mapper
|
||||
from xmodule.modulestore import Location, XML_MODULESTORE_TYPE
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore import XML_MODULESTORE_TYPE
|
||||
from opaque_keys.edx.locator import CourseLocator, Locator, BlockUsageLocator
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
from opaque_keys.edx.keys import CourseKey, UsageKey
|
||||
|
||||
@@ -31,7 +31,8 @@ from xblock.runtime import KvsFieldData
|
||||
from xblock.exceptions import InvalidScopeError
|
||||
from xblock.fields import Scope, ScopeIds, Reference, ReferenceList, ReferenceValueDict
|
||||
|
||||
from xmodule.modulestore import ModuleStoreWriteBase, Location, MONGO_MODULESTORE_TYPE
|
||||
from xmodule.modulestore import ModuleStoreWriteBase, MONGO_MODULESTORE_TYPE
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError, InvalidLocationError
|
||||
from xmodule.modulestore.inheritance import own_metadata, InheritanceMixin, inherit_metadata, InheritanceKeyValueStore
|
||||
from xmodule.tabs import StaticTab, CourseTabList
|
||||
|
||||
@@ -3,7 +3,7 @@ Test the loc mapper store
|
||||
"""
|
||||
import unittest
|
||||
import uuid
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError, InvalidLocationError
|
||||
from xmodule.modulestore.loc_mapper_store import LocMapperStore
|
||||
|
||||
@@ -5,8 +5,8 @@ from mock import patch, Mock
|
||||
from importlib import import_module
|
||||
|
||||
from xmodule.tests import DATA_DIR
|
||||
from xmodule.modulestore import Location, MONGO_MODULESTORE_TYPE, SPLIT_MONGO_MODULESTORE_TYPE, \
|
||||
XML_MODULESTORE_TYPE
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore import MONGO_MODULESTORE_TYPE, SPLIT_MONGO_MODULESTORE_TYPE, XML_MODULESTORE_TYPE
|
||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||
|
||||
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
|
||||
|
||||
@@ -18,7 +18,8 @@ from xblock.exceptions import InvalidScopeError
|
||||
from xblock.plugin import Plugin
|
||||
|
||||
from xmodule.tests import DATA_DIR
|
||||
from xmodule.modulestore import Location, MONGO_MODULESTORE_TYPE
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore import MONGO_MODULESTORE_TYPE
|
||||
from xmodule.modulestore.mongo import MongoModuleStore, MongoKeyValueStore
|
||||
from xmodule.modulestore.draft import DraftModuleStore
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey, AssetLocation
|
||||
|
||||
@@ -8,7 +8,8 @@ from glob import glob
|
||||
from mock import patch
|
||||
|
||||
from xmodule.modulestore.xml import XMLModuleStore
|
||||
from xmodule.modulestore import Location, XML_MODULESTORE_TYPE
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore import XML_MODULESTORE_TYPE
|
||||
|
||||
from .test_modulestore import check_path_to_location
|
||||
from xmodule.tests import DATA_DIR
|
||||
|
||||
@@ -6,7 +6,7 @@ from xblock.core import XBlock
|
||||
from xblock.fields import String, Scope, ScopeIds
|
||||
from xblock.runtime import Runtime, KvsFieldData, DictKeyValueStore
|
||||
from xmodule.x_module import XModuleMixin
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.inheritance import InheritanceMixin
|
||||
from xmodule.modulestore.xml_importer import import_module
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
@@ -7,7 +7,7 @@ import lxml.etree
|
||||
from xblock.fields import Scope
|
||||
from xmodule.contentstore.content import StaticContent
|
||||
from xmodule.exceptions import NotFoundError
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.inheritance import own_metadata
|
||||
from fs.osfs import OSFS
|
||||
from json import dumps
|
||||
|
||||
@@ -8,7 +8,7 @@ from mock import Mock
|
||||
from xblock.field_data import DictFieldData
|
||||
from xblock.fields import ScopeIds
|
||||
from xmodule.annotatable_module import AnnotatableModule
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
|
||||
from . import get_test_system
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ from capa.responsetypes import (StudentInputError, LoncapaProblemError,
|
||||
ResponseError)
|
||||
from capa.xqueue_interface import XQueueInterface
|
||||
from xmodule.capa_module import CapaModule, ComplexEncoder
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xblock.field_data import DictFieldData
|
||||
from xblock.fields import ScopeIds
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ from xmodule.open_ended_grading_classes.open_ended_module import OpenEndedModule
|
||||
from xmodule.open_ended_grading_classes.self_assessment_module import SelfAssessmentModule
|
||||
from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import CombinedOpenEndedV1Module
|
||||
from xmodule.combined_open_ended_module import CombinedOpenEndedModule
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.tests import get_test_system, test_util_open_ended
|
||||
from xmodule.progress import Progress
|
||||
from xmodule.tests.test_util_open_ended import (
|
||||
|
||||
@@ -15,7 +15,7 @@ from mock import Mock
|
||||
|
||||
import xmodule
|
||||
from xmodule.capa_module import CapaModule
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xblock.field_data import DictFieldData
|
||||
from xblock.fields import ScopeIds
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ from xblock.core import XBlock
|
||||
from xblock.fields import String, Scope, Integer
|
||||
from xblock.test.tools import blocks_are_equivalent
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.xml import XMLModuleStore
|
||||
from xmodule.modulestore.xml_exporter import (
|
||||
EdxJSONEncoder, convert_between_versions, get_version
|
||||
|
||||
@@ -11,7 +11,8 @@ from mock import Mock, patch
|
||||
from django.utils.timezone import UTC
|
||||
|
||||
from xmodule.xml_module import is_pointer_tag
|
||||
from xmodule.modulestore import Location, only_xmodules
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore import only_xmodules
|
||||
from xmodule.modulestore.xml import ImportSystem, XMLModuleStore
|
||||
from xmodule.modulestore.inheritance import compute_inherited_metadata
|
||||
from xmodule.x_module import XModuleMixin
|
||||
|
||||
@@ -6,7 +6,7 @@ from webob.multidict import MultiDict
|
||||
from pytz import UTC
|
||||
from xblock.fields import ScopeIds
|
||||
from xmodule.open_ended_grading_classes.self_assessment_module import SelfAssessmentModule
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from lxml import etree
|
||||
|
||||
from . import get_test_system
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import json
|
||||
from textwrap import dedent
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.xml import XMLModuleStore
|
||||
from xmodule.tests import DATA_DIR, get_test_system
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from mock import Mock
|
||||
|
||||
from . import LogicTest
|
||||
from lxml import etree
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.video_module import VideoDescriptor, create_youtube_string, get_ext
|
||||
from .test_import import DummySystem
|
||||
from xblock.field_data import DictFieldData
|
||||
|
||||
@@ -24,7 +24,7 @@ from unittest.case import SkipTest, TestCase
|
||||
from xblock.field_data import DictFieldData
|
||||
from xblock.fields import ScopeIds
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
|
||||
from xmodule.x_module import ModuleSystem, XModule, XModuleDescriptor, DescriptorSystem
|
||||
from xmodule.annotatable_module import AnnotatableDescriptor
|
||||
|
||||
@@ -45,7 +45,6 @@ from instructor_task.subtasks import (
|
||||
check_subtask_is_valid,
|
||||
update_subtask_status,
|
||||
)
|
||||
from xmodule.modulestore import Location
|
||||
from util.query import use_read_replica_if_available
|
||||
|
||||
log = get_task_logger(__name__)
|
||||
|
||||
@@ -17,7 +17,6 @@ import random
|
||||
import logging
|
||||
import lxml
|
||||
from lxml.etree import XMLSyntaxError, ParserError
|
||||
from xmodule.modulestore import Location
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -12,7 +12,7 @@ from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.inheritance import own_metadata
|
||||
from analytics.csvs import create_csv_response
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
|
||||
# Used to limit the length of list displayed to the screen.
|
||||
MAX_SCREEN_LIST_LENGTH = 250
|
||||
|
||||
@@ -9,7 +9,7 @@ from django.contrib.auth.models import AnonymousUser
|
||||
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
from xmodule.error_module import ErrorDescriptor
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.x_module import XModule
|
||||
|
||||
from xblock.core import XBlock
|
||||
|
||||
@@ -10,7 +10,6 @@ from lettuce.django import django_url
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.urlresolvers import reverse
|
||||
from student.models import CourseEnrollment
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from xmodule.course_module import CourseDescriptor
|
||||
|
||||
@@ -16,7 +16,7 @@ from student.tests.factories import UserFactory, CourseEnrollmentFactory
|
||||
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
|
||||
from xblock.field_data import DictFieldData
|
||||
from xmodule.tests import get_test_system, get_test_descriptor_system
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
@@ -12,7 +12,6 @@ from django.conf import settings
|
||||
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.modulestore import Location
|
||||
|
||||
from courseware.tests import BaseTestXmodule
|
||||
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
@@ -11,7 +11,6 @@ from webob import Request
|
||||
|
||||
from xmodule.contentstore.content import StaticContent
|
||||
from xmodule.contentstore.django import contentstore
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.django import editable_modulestore
|
||||
from . import BaseTestXmodule
|
||||
from .test_video_xml import SOURCE_XML
|
||||
|
||||
@@ -12,7 +12,6 @@ from xblock.field_data import DictFieldData
|
||||
|
||||
from xmodule.video_module import create_youtube_string
|
||||
from xmodule.tests import get_test_descriptor_system
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.video_module import VideoDescriptor
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ course, section, subsection, unit, etc.
|
||||
"""
|
||||
|
||||
from xmodule.video_module import VideoDescriptor
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.tests import get_test_system, LogicTest, get_test_descriptor_system
|
||||
from xblock.field_data import DictFieldData
|
||||
from xblock.fields import ScopeIds
|
||||
|
||||
@@ -21,7 +21,7 @@ from student.models import CourseEnrollment
|
||||
from student.tests.factories import AdminFactory
|
||||
from edxmako.middleware import MakoMiddleware
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
|
||||
@@ -7,7 +7,6 @@ import time
|
||||
from django.core.management.base import BaseCommand
|
||||
from optparse import make_option
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild
|
||||
|
||||
@@ -8,7 +8,7 @@ from pytz import UTC
|
||||
from django.test.utils import override_settings
|
||||
|
||||
import capa.xqueue_interface as xqueue_interface
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import Location
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.open_ended_grading_classes.openendedchild import OpenEndedChild
|
||||
from xmodule.tests.test_util_open_ended import (
|
||||
|
||||
@@ -69,7 +69,6 @@ from .tools import (
|
||||
strip_if_string,
|
||||
bulk_email_is_enabled_for_course,
|
||||
)
|
||||
from xmodule.modulestore import Location
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from opaque_keys import InvalidKeyError
|
||||
|
||||
|
||||
Reference in New Issue
Block a user