Commit 829e890a by Piotr Mitros

Very minor cleanups

parent 1ec3209d
......@@ -105,12 +105,3 @@ def toc_from_xml(coursefile, active_chapter, active_section):
'active':(c.get("name")==active_chapter)})
return ch
def dom_select(dom, element_type, element_name):
if dom==None:
return None
elements=dom.getElementsByTagName(element_type)
for e in elements:
if e.getAttribute("name")==element_name:
return e
return None
......@@ -171,9 +171,6 @@ def index(request, course="6.002 Spring 2012", chapter="Using the System", secti
cf = content_parser.course_file(request.user)
dom=etree.parse(cf)
#dom_course=content_parser.dom_select(dom, 'course', course)
#dom_chapter=content_parser.dom_select(dom_course, 'chapter', chapter)
#dom_section=content_parser.dom_select(dom_chapter, 'section', section)
dom_module = dom.xpath("//course[@name=$course]/chapter[@name=$chapter]//section[@name=$section]/*[1]",
course=course, chapter=chapter, section=section)
if len(dom_module) == 0:
......
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