Commit 6ebcfb63 by Calen Pennington

Make import work via mako again, to unblock others while I work on making the…

Make import work via mako again, to unblock others while I work on making the LMS work using XModuleDescriptors
parent b13afdf5
......@@ -7,6 +7,7 @@ from keystore.django import keystore
from raw_module import RawDescriptor
from lxml import etree
from fs.osfs import OSFS
from mako.lookup import TemplateLookup
from path import path
from x_module import XModuleDescriptor, XMLParsingSystem
......@@ -23,8 +24,6 @@ class Command(BaseCommand):
def handle(self, *args, **options):
org, course, data_dir = args
data_dir = path(data_dir)
with open(data_dir / "course.xml") as course_file:
class ImportSystem(XMLParsingSystem):
def __init__(self):
self.load_item = keystore().get_item
......@@ -49,4 +48,7 @@ class Command(BaseCommand):
keystore().update_children(module.url, module.definition['children'])
return module
ImportSystem().process_xml(course_file.read())
lookup = TemplateLookup(directories=[data_dir])
template = lookup.get_template("course.xml")
course_string = template.render(groups=[])
ImportSystem().process_xml(course_string)
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