Parse XModuleDescriptors on import using from_xml

Also:
Render all XModuleDescriptors in the cms the same way
Default them to editing raw xml, if there is no specific module for them
This commit is contained in:
Calen Pennington
2012-06-26 11:55:20 -04:00
parent 5b4c501a71
commit e9a00ffc5a
17 changed files with 242 additions and 202 deletions

View File

@@ -158,6 +158,7 @@ PIPELINE_CSS = {
PIPELINE_ALWAYS_RECOMPILE = ['sass/base-style.scss']
from x_module import XModuleDescriptor
from raw_module import RawDescriptor
js_file_dir = PROJECT_ROOT / "static" / "coffee" / "module"
try:
os.makedirs(js_file_dir)
@@ -168,7 +169,7 @@ except OSError as exc:
raise
module_js_sources = []
for xmodule in XModuleDescriptor.load_classes():
for xmodule in XModuleDescriptor.load_classes() + [RawDescriptor]:
js = xmodule.get_javascript()
for filetype in ('coffee', 'js'):
for idx, fragment in enumerate(js.get(filetype, [])):