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
ce30a27f
Commit
ce30a27f
authored
Dec 13, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small changes to make xml dump into as few files as possible
parent
10b417c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
common/lib/xmodule/xmodule/html_module.py
+6
-1
common/lib/xmodule/xmodule/xml_module.py
+1
-1
No files found.
common/lib/xmodule/xmodule/html_module.py
View file @
ce30a27f
...
@@ -149,10 +149,15 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
...
@@ -149,10 +149,15 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
write just <html filename="" [meta-attrs="..."]> to filename.xml, and the html
write just <html filename="" [meta-attrs="..."]> to filename.xml, and the html
string to filename.html.
string to filename.html.
'''
'''
# If the file is a single html document, just use it directly
try
:
try
:
return
etree
.
fromstring
(
self
.
definition
[
'data'
])
return
etree
.
fromstring
(
self
.
definition
[
'data'
])
except
etree
.
XMLSyntaxError
:
except
etree
.
XMLSyntaxError
:
pass
# Otherwise, try wrapping it in a single html tag, and returning that
try
:
return
etree
.
fromstring
(
"<html>
%
s</html>"
%
self
.
definition
[
'data'
])
except
etree
.
XMLSyntaxError
:
pass
# Not proper format. Write html to file, return an empty tag
# Not proper format. Write html to file, return an empty tag
pathname
=
name_to_pathname
(
self
.
url_name
)
pathname
=
name_to_pathname
(
self
.
url_name
)
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
ce30a27f
...
@@ -326,7 +326,7 @@ class XmlDescriptor(XModuleDescriptor):
...
@@ -326,7 +326,7 @@ class XmlDescriptor(XModuleDescriptor):
NOTE: Do not override this without a good reason. It is here
NOTE: Do not override this without a good reason. It is here
specifically for customtag...
specifically for customtag...
"""
"""
return
Tru
e
return
Fals
e
def
export_to_xml
(
self
,
resource_fs
):
def
export_to_xml
(
self
,
resource_fs
):
...
...
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