Commit a8473505 by Ned Batchelder

Move common/lib/*.py to openedx/core/lib

This makes these files importable, and puts them into the new best guess
as to where files should live.
parent 072dbcd5
......@@ -11,7 +11,7 @@ from django.core.management.base import BaseCommand, CommandError
from tempfile import mkdtemp
import tarfile
import shutil
from extract_tar import safetar_extractall
from openedx.core.lib.extract_tar import safetar_extractall
from xmodule.modulestore.xml_exporter import convert_between_versions
......
......@@ -10,7 +10,6 @@ from datetime import timedelta
from fs.osfs import OSFS
from json import loads
from path import path
from tempdir import mkdtemp_clean
from textwrap import dedent
from uuid import uuid4
from functools import wraps
......@@ -21,6 +20,7 @@ from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from openedx.core.lib.tempdir import mkdtemp_clean
from contentstore.tests.utils import parse_json, AjaxEnabledTestClient, CourseTestCase
from contentstore.views.component import ADVANCED_COMPONENT_TYPES
......
......@@ -33,7 +33,7 @@ from xmodule.modulestore import COURSE_ROOT, LIBRARY_ROOT
from student.auth import has_course_author_access
from extract_tar import safetar_extractall
from openedx.core.lib.extract_tar import safetar_extractall
from util.json_request import JsonResponse
from util.views import ensure_valid_course_key
......
......@@ -23,7 +23,7 @@ from contentstore.utils import reverse_course_url
from xmodule.modulestore.tests.factories import ItemFactory, LibraryFactory
from contentstore.tests.utils import CourseTestCase
from extract_tar import safetar_extractall
from openedx.core.lib.extract_tar import safetar_extractall
from student import auth
from student.roles import CourseInstructorRole, CourseStaffRole
......
......@@ -15,7 +15,7 @@ import json
from .common import *
from logsettings import get_logger_config
from openedx.core.lib.logsettings import get_logger_config
import os
from path import path
......
......@@ -159,7 +159,6 @@ GITHUB_REPO_ROOT = ENV_ROOT / "data"
sys.path.append(REPO_ROOT)
sys.path.append(PROJECT_ROOT / 'djangoapps')
sys.path.append(COMMON_ROOT / 'djangoapps')
sys.path.append(COMMON_ROOT / 'lib')
# For geolocation ip database
GEOIP_PATH = REPO_ROOT / "common/static/data/geoip/GeoIP.dat"
......@@ -416,7 +415,7 @@ EMBARGO_SITE_REDIRECT_URL = None
############################### Pipeline #######################################
STATICFILES_STORAGE = 'cms.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage'
from rooted_paths import rooted_glob
from openedx.core.lib.rooted_paths import rooted_glob
PIPELINE_CSS = {
'style-vendor': {
......
......@@ -6,7 +6,7 @@ This config file runs the simplest dev environment"""
# pylint: disable=wildcard-import, unused-wildcard-import
from .common import *
from logsettings import get_logger_config
from openedx.core.lib.logsettings import get_logger_config
# import settings from LMS for consistent behavior with CMS
from lms.envs.dev import (WIKI_ENABLED)
......
......@@ -17,7 +17,7 @@ defined in the environment:
import yaml
from .common import *
from logsettings import get_logger_config
from openedx.core.lib.logsettings import get_logger_config
from util.config_parse import convert_tokens
import os
......
......@@ -7,7 +7,7 @@ from django.conf import settings
# Force settings to run so that the python path is modified
settings.INSTALLED_APPS # pylint: disable=pointless-statement
from django_startup import autostartup
from openedx.core.lib.django_startup import autostartup
from monkey_patch import django_utils_translation
......
......@@ -8,7 +8,7 @@ from django.template.loaders.app_directories import Loader as AppDirectoriesLoad
from edxmako.template import Template
import tempdir
from openedx.core.lib.tempdir import mkdtemp_clean
log = logging.getLogger(__name__)
......@@ -30,7 +30,7 @@ class MakoLoader(object):
if module_directory is None:
log.warning("For more caching of mako templates, set the MAKO_MODULE_DIR in settings!")
module_directory = tempdir.mkdtemp_clean()
module_directory = mkdtemp_clean()
self.module_directory = module_directory
......
......@@ -16,8 +16,8 @@ from django.conf import settings
from django.contrib.auth.models import User
from django.db import models, transaction
from html_to_text import html_to_text
from mail_utils import wrap_message
from openedx.core.lib.html_to_text import html_to_text
from openedx.core.lib.mail_utils import wrap_message
from xmodule_django.models import CourseKeyField
from util.keyword_substitution import substitute_keywords_with_data
......
......@@ -19,7 +19,7 @@ Common traits:
import json
from .common import *
from logsettings import get_logger_config
from openedx.core.lib.logsettings import get_logger_config
import os
from path import path
......
......@@ -389,7 +389,6 @@ DATA_DIR = COURSES_ROOT
sys.path.append(REPO_ROOT)
sys.path.append(PROJECT_ROOT / 'djangoapps')
sys.path.append(COMMON_ROOT / 'djangoapps')
sys.path.append(COMMON_ROOT / 'lib')
# For Node.js
......@@ -1070,7 +1069,7 @@ X_FRAME_OPTIONS = 'ALLOW'
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
from rooted_paths import rooted_glob
from openedx.core.lib.rooted_paths import rooted_glob
courseware_js = (
[
......
......@@ -18,7 +18,6 @@ sessions. Assumes structure:
# pylint: disable=invalid-name
from .common import *
from logsettings import get_logger_config
DEBUG = True
TEMPLATE_DEBUG = True
......
......@@ -13,7 +13,7 @@ sessions. Assumes structure:
# pylint: disable=wildcard-import, unused-wildcard-import
from .common import *
from logsettings import get_logger_config
from openedx.core.lib.logsettings import get_logger_config
STATIC_GRAB = True
......
......@@ -16,7 +16,7 @@ defined in the environment:
import yaml
from .common import *
from logsettings import get_logger_config
from openedx.core.lib.logsettings import get_logger_config
from util.config_parse import convert_tokens
import os
......
......@@ -9,7 +9,7 @@ from django.conf import settings
# Force settings to run so that the python path is modified
settings.INSTALLED_APPS # pylint: disable=pointless-statement
from django_startup import autostartup
from openedx.core.lib.django_startup import autostartup
import edxmako
import logging
from monkey_patch import django_utils_translation
......
......@@ -13,7 +13,10 @@ from django.conf import settings
from django.contrib.auth.models import User
from django.http import Http404
from django.test.client import RequestFactory
import django_test_client_utils # monkey-patch for PATCH request method.
# monkey-patch for PATCH request method.
import openedx.core.lib.django_test_client_utils # pylint: disable=unused-import
from student.models import CourseEnrollment
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
......
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