changed 'course code lib' references to 'python lib' to maintain consistency
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import re
|
||||
|
||||
from django.conf import settings
|
||||
from lms.djangoapps.dashboard.git_import import DEFAULT_COURSE_CODE_LIB_FILENAME
|
||||
from lms.djangoapps.dashboard.git_import import DEFAULT_PYTHON_LIB_FILENAME
|
||||
|
||||
|
||||
def can_execute_unsafe_code(course_id):
|
||||
@@ -31,7 +31,7 @@ def can_execute_unsafe_code(course_id):
|
||||
|
||||
def get_python_lib_zip(contentstore, course_id):
|
||||
"""Return the bytes of the course code library file, if it exists."""
|
||||
python_lib_filename = getattr(settings, 'COURSE_CODE_LIB_FILENAME', DEFAULT_COURSE_CODE_LIB_FILENAME)
|
||||
python_lib_filename = getattr(settings, 'PYTHON_LIB_FILENAME', DEFAULT_PYTHON_LIB_FILENAME)
|
||||
asset_key = course_id.make_asset_key("asset", python_lib_filename)
|
||||
zip_lib = contentstore().find(asset_key, throw_on_not_found=False)
|
||||
if zip_lib is not None:
|
||||
|
||||
@@ -194,7 +194,7 @@ class ImportManager(object):
|
||||
default_class='xmodule.raw_module.RawDescriptor',
|
||||
load_error_modules=True, static_content_store=None,
|
||||
target_id=None, verbose=False,
|
||||
do_import_static=True, do_import_code_lib=True,
|
||||
do_import_static=True, do_import_python_lib=True,
|
||||
create_if_not_present=False, raise_on_failure=False,
|
||||
static_content_subdir=DEFAULT_STATIC_CONTENT_SUBDIR,
|
||||
python_lib_filename='python_lib.zip',
|
||||
@@ -210,7 +210,7 @@ class ImportManager(object):
|
||||
self.static_content_subdir = static_content_subdir
|
||||
self.python_lib_filename = python_lib_filename
|
||||
self.do_import_static = do_import_static
|
||||
self.do_import_code_lib = do_import_code_lib
|
||||
self.do_import_python_lib = do_import_python_lib
|
||||
self.create_if_not_present = create_if_not_present
|
||||
self.raise_on_failure = raise_on_failure
|
||||
self.xml_module_store = self.store_class(
|
||||
@@ -247,10 +247,10 @@ class ImportManager(object):
|
||||
"Skipping import of static content, "
|
||||
"since do_import_static=%s", self.do_import_static
|
||||
)
|
||||
if self.do_import_code_lib:
|
||||
if self.do_import_python_lib:
|
||||
log.debug(
|
||||
"Importing code library anyway "
|
||||
"since do_import_code_lib=%s", self.do_import_code_lib
|
||||
"since do_import_python_lib=%s", self.do_import_python_lib
|
||||
)
|
||||
|
||||
if self.static_content_store is not None:
|
||||
@@ -259,7 +259,7 @@ class ImportManager(object):
|
||||
static_content_importer.import_static_content_directory(
|
||||
content_subdir=self.static_content_subdir, verbose=self.verbose
|
||||
)
|
||||
elif self.do_import_code_lib and self.python_lib_filename:
|
||||
elif self.do_import_python_lib and self.python_lib_filename:
|
||||
python_lib_dir_path = data_path / self.static_content_subdir
|
||||
python_lib_full_path = python_lib_dir_path / self.python_lib_filename
|
||||
if os.path.isfile(python_lib_full_path):
|
||||
|
||||
Reference in New Issue
Block a user