Enable (and test) xml export of pure XBlocks

[LMS-179]
[LMS-209]
[LMS-1345]
This commit is contained in:
Calen Pennington
2014-01-17 15:27:12 -05:00
parent 69097e7b4a
commit b0bed170de
12 changed files with 131 additions and 85 deletions

View File

@@ -1,3 +1,4 @@
import lxml.etree
import os
import sys
import traceback
@@ -30,9 +31,11 @@ def export(course, export_dir):
' May clobber/confuse things'.format(dir=export_dir))
try:
xml = course.export_to_xml(fs)
course.runtime.export_fs = fs
root = lxml.etree.Element('root')
course.add_xml_to_node(root)
with fs.open('course.xml', mode='w') as f:
f.write(xml)
root.write(f)
return True
except: