Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
98d513ac
Commit
98d513ac
authored
Jun 21, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix and added comments
* wasn't passing namespace properly in parse_course_file
parent
bf8e70f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
lms/djangoapps/courseware/content_parser.py
+11
-3
No files found.
lms/djangoapps/courseware/content_parser.py
View file @
98d513ac
...
@@ -26,10 +26,13 @@ import xmodule
...
@@ -26,10 +26,13 @@ import xmodule
''' This file will eventually form an abstraction layer between the
''' This file will eventually form an abstraction layer between the
course XML file and the rest of the system.
course XML file and the rest of the system.
TODO: Shift everything from xml.dom.minidom to XPath (or XQuery)
'''
'''
# ==== This section has no direct dependencies on django ====================================
# NOTE: it does still have some indirect dependencies:
# util.memcache.fasthash (which does not depend on memcache at all)
#
class
ContentException
(
Exception
):
class
ContentException
(
Exception
):
pass
pass
...
@@ -170,8 +173,11 @@ def parse_course_file(filename, options, namespace):
...
@@ -170,8 +173,11 @@ def parse_course_file(filename, options, namespace):
Options should be a dictionary including keys
Options should be a dictionary including keys
'dev_content': bool,
'dev_content': bool,
'groups' : [list, of, user, groups]
'groups' : [list, of, user, groups]
namespace is used to in searching for the file. Could be e.g. 'course',
'sections'.
'''
'''
xml
=
etree
.
XML
(
render_to_string
(
filename
,
options
,
namespace
=
'course'
))
xml
=
etree
.
XML
(
render_to_string
(
filename
,
options
,
namespace
=
namespace
))
return
course_xml_process
(
xml
)
return
course_xml_process
(
xml
)
...
@@ -197,6 +203,8 @@ def get_module(tree, module, id_tag, module_id, sections_dirname, options):
...
@@ -197,6 +203,8 @@ def get_module(tree, module, id_tag, module_id, sections_dirname, options):
Given the xml tree of the course, get the xml string for a module
Given the xml tree of the course, get the xml string for a module
with the specified module type, id_tag, module_id. Looks in
with the specified module type, id_tag, module_id. Looks in
sections_dirname for sections.
sections_dirname for sections.
id_tag -- use id_tag if the place the module stores its id is not 'id'
'''
'''
# Sanitize input
# Sanitize input
if
not
module
.
isalnum
():
if
not
module
.
isalnum
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment