Commit aecc037e by Don Mitchell

pylint and pep8 fixes

parent fc1ca7b3
......@@ -451,7 +451,7 @@ class ModuleStoreWrite(ModuleStoreRead):
pass
@abstractmethod
def delete_item(self, location, user_id=None, delete_all_versions=False, delete_children=False, force=False):
def delete_item(self, location, user_id=None, **kwargs):
"""
Delete an item from persistence. Pass the user's unique id which the persistent store
should save with the update if it has that ability.
......
......@@ -377,15 +377,15 @@ class MixedModuleStore(ModuleStoreWriteBase):
store = self._get_modulestore_for_courseid(course_id)
return store.update_item(xblock, user_id)
def delete_item(self, location, user_id=None):
def delete_item(self, location, user_id=None, **kwargs):
"""
Delete the given item from persistence.
Delete the given item from persistence. kwargs allow modulestore specific parameters.
"""
course_id = self._infer_course_id_try(location)
if course_id is None:
raise ItemNotFoundError(u"Cannot find modulestore for %s" % location)
store = self._get_modulestore_for_courseid(course_id)
return store.delete_item(location, user_id=user_id)
return store.delete_item(location, user_id=user_id, **kwargs)
def close_all_connections(self):
"""
......
......@@ -109,7 +109,11 @@ class TestMixedModuleStore(LocMapperSetupSansDjango):
patcher.start()
self.addCleanup(patcher.stop)
self.addTypeEqualityFunc(BlockUsageLocator, '_compareIgnoreVersion')
# define attrs which get set in initdb to quell pylint
self.import_chapter_location = self.store = self.fake_location = self.xml_chapter_location = None
self.course_locations = []
# pylint: disable=invalid-name
def _create_course(self, default, course_id):
"""
Create a course w/ one item in the persistence store using the given course & item location.
......@@ -323,10 +327,12 @@ class TestMixedModuleStore(LocMapperSetupSansDjango):
self.assertEqual(len(parents), 1)
self.assertEqual(parents[0], self.course_locations[self.XML_COURSEID1])
#=============================================================================================================
# General utils for not using django settings
#=============================================================================================================
def load_function(path):
"""
Load a function by name.
......@@ -338,6 +344,7 @@ def load_function(path):
return getattr(import_module(module_path), name)
# pylint: disable=unused-argument
def create_modulestore_instance(engine, doc_store_config, options, i18n_service=None):
"""
This will return a new instance of a modulestore given an engine and options
......
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