Commit 8378422f by swdanielli Committed by Piotr Mitros

code clean

parent 504a7a21
......@@ -27,9 +27,11 @@ update_module_store_settings(
}
)
DJFS = {'type': 'osfs',
'directory_root': 'cms/static/djpyfs',
'url_root': '/static/djpyfs'}
DJFS = {
'type': 'osfs',
'directory_root': 'cms/static/djpyfs',
'url_root': '/static/djpyfs'
}
# cdodge: This is the specifier for the MongoDB (using GridFS) backed static content store
# This is for static content for courseware, not system static content (e.g. javascript, css, edX branding, etc)
......
......@@ -42,7 +42,7 @@ def load_function(path):
return getattr(import_module(module_path), name)
def create_modulestore_instance(engine, content_store, doc_store_config, options, i18n_service=None, pyfs_service=None):
def create_modulestore_instance(engine, content_store, doc_store_config, options, i18n_service=None, fs_service=None):
"""
This will return a new instance of a modulestore given an engine and options
"""
......@@ -74,7 +74,7 @@ def create_modulestore_instance(engine, content_store, doc_store_config, options
xblock_select=getattr(settings, 'XBLOCK_SELECT_FUNCTION', None),
doc_store_config=doc_store_config,
i18n_service=i18n_service or ModuleI18nService(),
pyfs_service=pyfs_service or xblock.reference.plugins.FSService(),
fs_service=fs_service or xblock.reference.plugins.FSService(),
branch_setting_func=_get_modulestore_branch_setting,
create_modulestore_instance=create_modulestore_instance,
**_options
......
......@@ -91,7 +91,7 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
"""
ModuleStore knows how to route requests to the right persistence ms
"""
def __init__(self, contentstore, mappings, stores, i18n_service=None, pyfs_service=None, create_modulestore_instance=None, **kwargs):
def __init__(self, contentstore, mappings, stores, i18n_service=None, fs_service=None, create_modulestore_instance=None, **kwargs):
"""
Initialize a MixedModuleStore. Here we look into our passed in kwargs which should be a
collection of other modulestore configuration information
......@@ -130,7 +130,7 @@ class MixedModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
store_settings.get('DOC_STORE_CONFIG', {}),
store_settings.get('OPTIONS', {}),
i18n_service=i18n_service,
pyfs_service=pyfs_service,
fs_service=fs_service,
)
# replace all named pointers to the store into actual pointers
for course_key, store_name in self.mappings.iteritems():
......
......@@ -366,7 +366,7 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
default_class=None,
error_tracker=null_error_tracker,
i18n_service=None,
pyfs_service=None,
fs_service=None,
**kwargs):
"""
:param doc_store_config: must have a host, db, and collection entries. Other common entries: port, tz_aware.
......@@ -410,7 +410,7 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
self.error_tracker = error_tracker
self.render_template = render_template
self.i18n_service = i18n_service
self.pyfs_service = pyfs_service
self.fs_service = fs_service
# performance optimization to prevent updating the meta-data inheritance tree during
# bulk write operations
......@@ -698,8 +698,8 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
if self.i18n_service:
services["i18n"] = self.i18n_service
if self.pyfs_service:
services["fs"] = self.pyfs_service
if self.fs_service:
services["fs"] = self.fs_service
system = CachingDescriptorSystem(
modulestore=self,
......@@ -994,8 +994,8 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase):
if self.i18n_service:
services["i18n"] = self.i18n_service
if self.pyfs_service:
services["fs"] = self.pyfs_service
if self.fs_service:
services["fs"] = self.fs_service
runtime = CachingDescriptorSystem(
modulestore=self,
......
......@@ -120,7 +120,7 @@ class SplitMongoModuleStore(ModuleStoreWriteBase):
def __init__(self, contentstore, doc_store_config, fs_root, render_template,
default_class=None,
error_tracker=null_error_tracker,
i18n_service=None, pyfs_service=None,
i18n_service=None, fs_service=None,
services=None, **kwargs):
"""
:param doc_store_config: must have a host, db, and collection entries. Other common entries: port, tz_aware.
......@@ -148,8 +148,8 @@ class SplitMongoModuleStore(ModuleStoreWriteBase):
if i18n_service is not None:
self.services["i18n"] = i18n_service
if pyfs_service is not None:
self.services["fs"] = pyfs_service
if fs_service is not None:
self.services["fs"] = fs_service
def close_connections(self):
"""
......
......@@ -50,9 +50,11 @@ LOGGING = get_logger_config(ENV_ROOT / "log",
dev_env=True,
debug=True)
DJFS = {'type': 'osfs',
'directory_root': 'lms/static/djpyfs',
'url_root': '/static/djpyfs'}
DJFS = {
'type': 'osfs',
'directory_root': 'lms/static/djpyfs',
'url_root': '/static/djpyfs'
}
# If there is a database called 'read_replica', you can use the use_read_replica_if_available
# function in util/query.py, which is useful for very large database reads
......@@ -220,9 +222,11 @@ CELERY_ALWAYS_EAGER = True
################################ DEBUG TOOLBAR ################################
INSTALLED_APPS += ('debug_toolbar',)
MIDDLEWARE_CLASSES += ('django_comment_client.utils.QueryCountDebugMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'djpyfs')
MIDDLEWARE_CLASSES += (
'django_comment_client.utils.QueryCountDebugMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'djpyfs',
)
INTERNAL_IPS = ('127.0.0.1',)
DEBUG_TOOLBAR_PANELS = (
......
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