Commit 21ba5019 by Calen Pennington

Revert "Make import work via mako again, to unblock others while I work on…

Revert "Make import work via mako again, to unblock others while I work on making the LMS work using XModuleDescriptors"

This reverts commit 6fdf44fe.
parent 3c60d1a9
...@@ -7,7 +7,6 @@ from keystore.django import keystore ...@@ -7,7 +7,6 @@ from keystore.django import keystore
from raw_module import RawDescriptor from raw_module import RawDescriptor
from lxml import etree from lxml import etree
from fs.osfs import OSFS from fs.osfs import OSFS
from mako.lookup import TemplateLookup
from path import path from path import path
from x_module import XModuleDescriptor, XMLParsingSystem from x_module import XModuleDescriptor, XMLParsingSystem
...@@ -28,6 +27,7 @@ class Command(BaseCommand): ...@@ -28,6 +27,7 @@ class Command(BaseCommand):
org, course, data_dir = args org, course, data_dir = args
data_dir = path(data_dir) data_dir = path(data_dir)
with open(data_dir / "course.xml") as course_file:
class ImportSystem(XMLParsingSystem): class ImportSystem(XMLParsingSystem):
def __init__(self): def __init__(self):
...@@ -53,7 +53,4 @@ class Command(BaseCommand): ...@@ -53,7 +53,4 @@ class Command(BaseCommand):
keystore().update_children(module.url, module.definition['children']) keystore().update_children(module.url, module.definition['children'])
return module return module
lookup = TemplateLookup(directories=[data_dir]) ImportSystem().process_xml(course_file.read())
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