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