From 4d8618517f1031b60f7696b0b2df037cd9f7ff4d Mon Sep 17 00:00:00 2001 From: 0x29a Date: Wed, 26 Oct 2022 21:04:19 +0200 Subject: [PATCH] refactor: xmodule/hidden_module.py -> xmodule/hidden_block.py --- cms/envs/bok_choy.auth.json | 4 ++-- cms/envs/bok_choy.yml | 4 ++-- cms/envs/bok_choy_docker.auth.json | 4 ++-- cms/envs/bok_choy_docker.yml | 4 ++-- cms/envs/common.py | 4 ++-- cms/envs/devstack-experimental.yml | 4 ++-- cms/envs/test.py | 2 +- lms/envs/bok_choy.yml | 4 ++-- lms/envs/bok_choy_docker.yml | 4 ++-- lms/envs/common.py | 4 ++-- lms/envs/devstack-experimental.yml | 4 ++-- setup.py | 2 +- xmodule/{hidden_module.py => hidden_block.py} | 0 xmodule/modulestore/tests/django_utils.py | 2 +- xmodule/modulestore/tests/test_mixed_modulestore.py | 2 +- .../modulestore/tests/test_modulestore_settings.py | 12 ++++++------ xmodule/modulestore/tests/test_mongo.py | 2 +- xmodule/modulestore/tests/test_split_modulestore.py | 2 +- xmodule/modulestore/tests/test_split_w_old_mongo.py | 2 +- xmodule/modulestore/tests/utils.py | 2 +- xmodule/modulestore/xml_importer.py | 4 ++-- 21 files changed, 36 insertions(+), 36 deletions(-) rename xmodule/{hidden_module.py => hidden_block.py} (100%) diff --git a/cms/envs/bok_choy.auth.json b/cms/envs/bok_choy.auth.json index 4a9a2f7150..b5b94b7b80 100644 --- a/cms/envs/bok_choy.auth.json +++ b/cms/envs/bok_choy.auth.json @@ -72,7 +72,7 @@ "OPTIONS": { "collection": "modulestore", "db": "test", - "default_class": "xmodule.hidden_module.HiddenDescriptor", + "default_class": "xmodule.hidden_block.HiddenDescriptor", "fs_root": "** OVERRIDDEN **", "host": [ "localhost" @@ -86,7 +86,7 @@ "ENGINE": "xmodule.modulestore.xml.XMLModuleStore", "OPTIONS": { "data_dir": "** OVERRIDDEN **", - "default_class": "xmodule.hidden_module.HiddenDescriptor" + "default_class": "xmodule.hidden_block.HiddenDescriptor" } } ] diff --git a/cms/envs/bok_choy.yml b/cms/envs/bok_choy.yml index b378cf6443..657bedd74a 100644 --- a/cms/envs/bok_choy.yml +++ b/cms/envs/bok_choy.yml @@ -105,14 +105,14 @@ MODULESTORE: OPTIONS: collection: modulestore db: test - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: '** OVERRIDDEN **' host: [localhost] port: 27017 render_template: common.djangoapps.edxmako.shortcuts.render_to_string - ENGINE: xmodule.modulestore.xml.XMLModuleStore NAME: xml - OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_module.HiddenDescriptor} + OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_block.HiddenDescriptor} # We need to test different scenarios, following setting effectively disbale rate limiting PASSWORD_RESET_IP_RATE: '1/s' PASSWORD_RESET_EMAIL_RATE: '1/s' diff --git a/cms/envs/bok_choy_docker.auth.json b/cms/envs/bok_choy_docker.auth.json index 98c999fb7c..c3e87580eb 100644 --- a/cms/envs/bok_choy_docker.auth.json +++ b/cms/envs/bok_choy_docker.auth.json @@ -72,7 +72,7 @@ "OPTIONS": { "collection": "modulestore", "db": "test", - "default_class": "xmodule.hidden_module.HiddenDescriptor", + "default_class": "xmodule.hidden_block.HiddenDescriptor", "fs_root": "** OVERRIDDEN **", "host": [ "edx.devstack.mongo" @@ -86,7 +86,7 @@ "ENGINE": "xmodule.modulestore.xml.XMLModuleStore", "OPTIONS": { "data_dir": "** OVERRIDDEN **", - "default_class": "xmodule.hidden_module.HiddenDescriptor" + "default_class": "xmodule.hidden_block.HiddenDescriptor" } } ] diff --git a/cms/envs/bok_choy_docker.yml b/cms/envs/bok_choy_docker.yml index 829b116766..82b7614ebf 100644 --- a/cms/envs/bok_choy_docker.yml +++ b/cms/envs/bok_choy_docker.yml @@ -105,14 +105,14 @@ MODULESTORE: OPTIONS: collection: modulestore db: test - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: '** OVERRIDDEN **' host: [edx.devstack.mongo] port: 27017 render_template: common.djangoapps.edxmako.shortcuts.render_to_string - ENGINE: xmodule.modulestore.xml.XMLModuleStore NAME: xml - OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_module.HiddenDescriptor} + OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_block.HiddenDescriptor} SECRET_KEY: '' SERVER_EMAIL: devops@example.com SESSION_COOKIE_DOMAIN: null diff --git a/cms/envs/common.py b/cms/envs/common.py index f99dfa0b0b..bcddb293e0 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1005,7 +1005,7 @@ MODULESTORE = { 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, 'OPTIONS': { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': DATA_DIR, 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string', } @@ -1015,7 +1015,7 @@ MODULESTORE = { 'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore', 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, 'OPTIONS': { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': DATA_DIR, 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string', } diff --git a/cms/envs/devstack-experimental.yml b/cms/envs/devstack-experimental.yml index daa1225ee8..cc824e5ef0 100644 --- a/cms/envs/devstack-experimental.yml +++ b/cms/envs/devstack-experimental.yml @@ -379,7 +379,7 @@ MODULESTORE: ENGINE: xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore NAME: split OPTIONS: - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: /edx/var/edxapp/data render_template: common.djangoapps.edxmako.shortcuts.render_to_string - DOC_STORE_CONFIG: @@ -399,7 +399,7 @@ MODULESTORE: ENGINE: xmodule.modulestore.mongo.DraftMongoModuleStore NAME: draft OPTIONS: - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: /edx/var/edxapp/data render_template: common.djangoapps.edxmako.shortcuts.render_to_string ORA2_FILE_PREFIX: default_env-default_deployment/ora2 diff --git a/cms/envs/test.py b/cms/envs/test.py index c31635d6bf..31753437f3 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -101,7 +101,7 @@ BLOCK_STRUCTURES_SETTINGS['PRUNING_ACTIVE'] = True update_module_store_settings( MODULESTORE, module_store_options={ - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': TEST_ROOT / "data", }, doc_store_settings={ diff --git a/lms/envs/bok_choy.yml b/lms/envs/bok_choy.yml index 7a0eb44f40..ca4fb816a3 100644 --- a/lms/envs/bok_choy.yml +++ b/lms/envs/bok_choy.yml @@ -196,14 +196,14 @@ MODULESTORE: OPTIONS: collection: modulestore db: test - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: '** OVERRIDDEN **' host: [localhost] port: 27017 render_template: common.djangoapps.edxmako.shortcuts.render_to_string - ENGINE: xmodule.modulestore.xml.XMLModuleStore NAME: xml - OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_module.HiddenDescriptor} + OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_block.HiddenDescriptor} # We need to test different scenarios, following setting effectively disbale rate limiting PASSWORD_RESET_IP_RATE: '1/s' PASSWORD_RESET_EMAIL_RATE: '1/s' diff --git a/lms/envs/bok_choy_docker.yml b/lms/envs/bok_choy_docker.yml index 21ccda2df5..bff2876939 100644 --- a/lms/envs/bok_choy_docker.yml +++ b/lms/envs/bok_choy_docker.yml @@ -118,14 +118,14 @@ MODULESTORE: OPTIONS: collection: modulestore db: test - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: '** OVERRIDDEN **' host: [edx.devstack.mongo] port: 27017 render_template: common.djangoapps.edxmako.shortcuts.render_to_string - ENGINE: xmodule.modulestore.xml.XMLModuleStore NAME: xml - OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_module.HiddenDescriptor} + OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_block.HiddenDescriptor} PASSWORD_RESET_SUPPORT_LINK: https://support.example.com/password-reset-help.html REGISTRATION_EXTENSION_FORM: openedx.core.djangoapps.user_api.tests.test_helpers.TestCaseForm REGISTRATION_EXTRA_FIELDS: {city: hidden, country: required, gender: optional, goals: optional, diff --git a/lms/envs/common.py b/lms/envs/common.py index dfc9242319..f1259a34d8 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1604,7 +1604,7 @@ MODULESTORE = { 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, 'OPTIONS': { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': DATA_DIR, 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string', } @@ -1614,7 +1614,7 @@ MODULESTORE = { 'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore', 'DOC_STORE_CONFIG': DOC_STORE_CONFIG, 'OPTIONS': { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': DATA_DIR, 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string', } diff --git a/lms/envs/devstack-experimental.yml b/lms/envs/devstack-experimental.yml index 48e641135d..c0c9afc01f 100644 --- a/lms/envs/devstack-experimental.yml +++ b/lms/envs/devstack-experimental.yml @@ -419,7 +419,7 @@ MODULESTORE: ENGINE: xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore NAME: split OPTIONS: - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: /edx/var/edxapp/data render_template: common.djangoapps.edxmako.shortcuts.render_to_string - DOC_STORE_CONFIG: @@ -439,7 +439,7 @@ MODULESTORE: ENGINE: xmodule.modulestore.mongo.DraftMongoModuleStore NAME: draft OPTIONS: - default_class: xmodule.hidden_module.HiddenDescriptor + default_class: xmodule.hidden_block.HiddenDescriptor fs_root: /edx/var/edxapp/data render_template: common.djangoapps.edxmako.shortcuts.render_to_string OAUTH_DELETE_EXPIRED: true diff --git a/setup.py b/setup.py index 939e5e9df6..00cf4dc061 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ XBLOCKS = [ "discuss = xmodule.template_module:TranslateCustomTagBlock", "discussion = xmodule.discussion_block:DiscussionXBlock", "error = xmodule.error_block:ErrorBlock", - "hidden = xmodule.hidden_module:HiddenDescriptor", + "hidden = xmodule.hidden_block:HiddenDescriptor", "html = xmodule.html_module:HtmlBlock", "image = xmodule.template_module:TranslateCustomTagBlock", "library = xmodule.library_root_xblock:LibraryRoot", diff --git a/xmodule/hidden_module.py b/xmodule/hidden_block.py similarity index 100% rename from xmodule/hidden_module.py rename to xmodule/hidden_block.py diff --git a/xmodule/modulestore/tests/django_utils.py b/xmodule/modulestore/tests/django_utils.py index e2f8aa2be6..bb0a717620 100644 --- a/xmodule/modulestore/tests/django_utils.py +++ b/xmodule/modulestore/tests/django_utils.py @@ -76,7 +76,7 @@ def mixed_store_config(data_dir, mappings, store_order=None, modulestore_options store_order = [StoreConstructors.draft, StoreConstructors.split] options = { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': data_dir, 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string', } diff --git a/xmodule/modulestore/tests/test_mixed_modulestore.py b/xmodule/modulestore/tests/test_mixed_modulestore.py index 07c12949fa..16417cf29c 100644 --- a/xmodule/modulestore/tests/test_mixed_modulestore.py +++ b/xmodule/modulestore/tests/test_mixed_modulestore.py @@ -74,7 +74,7 @@ class CommonMixedModuleStoreSetup(CourseComparisonTest): COLLECTION = 'modulestore' ASSET_COLLECTION = 'assetstore' FS_ROOT = DATA_DIR - DEFAULT_CLASS = 'xmodule.hidden_module.HiddenDescriptor' + DEFAULT_CLASS = 'xmodule.hidden_block.HiddenDescriptor' RENDER_TEMPLATE = lambda t_n, d, ctx=None, nsp='main': '' MONGO_COURSEID = 'MITx/999/2013_Spring' diff --git a/xmodule/modulestore/tests/test_modulestore_settings.py b/xmodule/modulestore/tests/test_modulestore_settings.py index db267b942f..b071908ad5 100644 --- a/xmodule/modulestore/tests/test_modulestore_settings.py +++ b/xmodule/modulestore/tests/test_modulestore_settings.py @@ -28,7 +28,7 @@ class ModuleStoreSettingsMigration(TestCase): "ENGINE": "xmodule.modulestore.xml.XMLModuleStore", "OPTIONS": { "data_dir": "directory", - "default_class": "xmodule.hidden_module.HiddenDescriptor", + "default_class": "xmodule.hidden_block.HiddenDescriptor", }, "DOC_STORE_CONFIG": {}, } @@ -40,7 +40,7 @@ class ModuleStoreSettingsMigration(TestCase): "OPTIONS": { "collection": "modulestore", "db": "edxapp", - "default_class": "xmodule.hidden_module.HiddenDescriptor", + "default_class": "xmodule.hidden_block.HiddenDescriptor", "fs_root": mkdtemp_clean(), "host": "localhost", "password": "password", @@ -64,7 +64,7 @@ class ModuleStoreSettingsMigration(TestCase): "OPTIONS": { "collection": "modulestore", "db": "test", - "default_class": "xmodule.hidden_module.HiddenDescriptor", + "default_class": "xmodule.hidden_block.HiddenDescriptor", } }, "default": { @@ -79,7 +79,7 @@ class ModuleStoreSettingsMigration(TestCase): "ENGINE": "xmodule.modulestore.xml.XMLModuleStore", "OPTIONS": { "data_dir": "directory", - "default_class": "xmodule.hidden_module.HiddenDescriptor" + "default_class": "xmodule.hidden_block.HiddenDescriptor" }, "DOC_STORE_CONFIG": {} } @@ -99,7 +99,7 @@ class ModuleStoreSettingsMigration(TestCase): 'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore', 'DOC_STORE_CONFIG': {}, 'OPTIONS': { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': "fs_root", 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string', } @@ -109,7 +109,7 @@ class ModuleStoreSettingsMigration(TestCase): 'ENGINE': 'xmodule.modulestore.mongo.draft.DraftModuleStore', 'DOC_STORE_CONFIG': {}, 'OPTIONS': { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': "fs_root", 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string', } diff --git a/xmodule/modulestore/tests/test_mongo.py b/xmodule/modulestore/tests/test_mongo.py index c4f61f1b05..18cc1c56a4 100644 --- a/xmodule/modulestore/tests/test_mongo.py +++ b/xmodule/modulestore/tests/test_mongo.py @@ -48,7 +48,7 @@ DB = 'test_mongo_%s' % uuid4().hex[:5] COLLECTION = 'modulestore' ASSET_COLLECTION = 'assetstore' FS_ROOT = DATA_DIR # TODO (vshnayder): will need a real fs_root for testing load_item -DEFAULT_CLASS = 'xmodule.hidden_module.HiddenDescriptor' +DEFAULT_CLASS = 'xmodule.hidden_block.HiddenDescriptor' RENDER_TEMPLATE = lambda t_n, d, ctx=None, nsp='main': '' diff --git a/xmodule/modulestore/tests/test_split_modulestore.py b/xmodule/modulestore/tests/test_split_modulestore.py index d9372bb1a8..3535abc384 100644 --- a/xmodule/modulestore/tests/test_split_modulestore.py +++ b/xmodule/modulestore/tests/test_split_modulestore.py @@ -67,7 +67,7 @@ class SplitModuleTest(unittest.TestCase): 'collection': 'modulestore', } modulestore_options = { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': tempdir.mkdtemp_clean(), 'xblock_mixins': (InheritanceMixin, XModuleMixin, EditInfoMixin) } diff --git a/xmodule/modulestore/tests/test_split_w_old_mongo.py b/xmodule/modulestore/tests/test_split_w_old_mongo.py index fa55146808..d01fefb377 100644 --- a/xmodule/modulestore/tests/test_split_w_old_mongo.py +++ b/xmodule/modulestore/tests/test_split_w_old_mongo.py @@ -43,7 +43,7 @@ class SplitWMongoCourseBootstrapper(unittest.TestCase): } modulestore_options = { - 'default_class': 'xmodule.hidden_module.HiddenDescriptor', + 'default_class': 'xmodule.hidden_block.HiddenDescriptor', 'fs_root': '', 'render_template': mock.Mock(return_value=""), 'xblock_mixins': (InheritanceMixin, XModuleMixin) diff --git a/xmodule/modulestore/tests/utils.py b/xmodule/modulestore/tests/utils.py index de0edc1727..93acc17a22 100644 --- a/xmodule/modulestore/tests/utils.py +++ b/xmodule/modulestore/tests/utils.py @@ -342,7 +342,7 @@ class XmlModulestoreBuilder(StoreBuilderBase): modulestore = XMLModuleStore( DATA_DIR, course_ids=course_ids, - default_class='xmodule.hidden_module.HiddenDescriptor', + default_class='xmodule.hidden_block.HiddenDescriptor', xblock_mixins=XBLOCK_MIXINS, ) diff --git a/xmodule/modulestore/xml_importer.py b/xmodule/modulestore/xml_importer.py index d7824f5edd..4544a99d96 100644 --- a/xmodule/modulestore/xml_importer.py +++ b/xmodule/modulestore/xml_importer.py @@ -260,7 +260,7 @@ class ImportManager: def __init__( self, store, user_id, data_dir, source_dirs=None, - default_class='xmodule.hidden_module.HiddenDescriptor', + default_class='xmodule.hidden_block.HiddenDescriptor', load_error_modules=True, static_content_store=None, target_id=None, verbose=False, do_import_static=True, do_import_python_lib=True, @@ -1229,7 +1229,7 @@ def validate_course_policy(module_store, course_id): def perform_xlint( # lint-amnesty, pylint: disable=missing-function-docstring data_dir, source_dirs, - default_class='xmodule.hidden_module.HiddenDescriptor', + default_class='xmodule.hidden_block.HiddenDescriptor', load_error_modules=True, xblock_mixins=(LocationMixin, XModuleMixin)): err_cnt = 0