Commit 96c4af9a by Victor Shnayder

Add kwargs back to DescriptorSystem init()s

* allow future expansion without breaking interface.
parent 7f2f4759
......@@ -3,9 +3,9 @@ from x_module import XModuleDescriptor, DescriptorSystem
class MakoDescriptorSystem(DescriptorSystem):
def __init__(self, load_item, resources_fs, error_handler,
render_template):
render_template, **kwargs):
super(MakoDescriptorSystem, self).__init__(
load_item, resources_fs, error_handler)
load_item, resources_fs, error_handler, **kwargs)
self.render_template = render_template
......
......@@ -29,7 +29,7 @@ def clean_out_mako_templating(xml_string):
return xml_string
class ImportSystem(XMLParsingSystem, MakoDescriptorSystem):
def __init__(self, xmlstore, org, course, course_dir, error_handler):
def __init__(self, xmlstore, org, course, course_dir, error_handler, **kwargs):
"""
A class that handles loading from xml. Does some munging to ensure that
all elements have unique slugs.
......@@ -88,9 +88,9 @@ class ImportSystem(XMLParsingSystem, MakoDescriptorSystem):
resources_fs = OSFS(xmlstore.data_dir / course_dir)
MakoDescriptorSystem.__init__(self, load_item, resources_fs,
error_handler, render_template)
error_handler, render_template, **kwargs)
XMLParsingSystem.__init__(self, load_item, resources_fs,
error_handler, process_xml)
error_handler, process_xml, **kwargs)
......
......@@ -521,7 +521,7 @@ class XModuleDescriptor(Plugin, HTMLSnippet):
class DescriptorSystem(object):
def __init__(self, load_item, resources_fs, error_handler):
def __init__(self, load_item, resources_fs, error_handler, **kwargs):
"""
load_item: Takes a Location and returns an XModuleDescriptor
......@@ -561,14 +561,15 @@ class DescriptorSystem(object):
class XMLParsingSystem(DescriptorSystem):
def __init__(self, load_item, resources_fs, error_handler, process_xml):
def __init__(self, load_item, resources_fs, error_handler, process_xml, **kwargs):
"""
load_item, resources_fs, error_handler: see DescriptorSystem
process_xml: Takes an xml string, and returns a XModuleDescriptor
created from that xml
"""
DescriptorSystem.__init__(self, load_item, resources_fs, error_handler)
DescriptorSystem.__init__(self, load_item, resources_fs, error_handler,
**kwargs)
self.process_xml = process_xml
......
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