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
c36adf84
Commit
c36adf84
authored
Sep 20, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cosmetic code fixes.
parent
d7e44108
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
common/lib/xmodule/xmodule/x_module.py
+4
-8
common/lib/xmodule/xmodule/xml_module.py
+1
-2
No files found.
common/lib/xmodule/xmodule/x_module.py
View file @
c36adf84
...
...
@@ -555,7 +555,7 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
def
from_xml
(
cls
,
xml_data
,
system
,
org
=
None
,
course
=
None
):
"""
Creates an instance of this descriptor from the supplied xml_data.
This may be overridden by subclasses
This may be overridden by subclasses
.
xml_data: A string of xml that will be translated into data and children
for this module
...
...
@@ -565,13 +565,12 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
org and course are optional strings that will be used in the generated
module's url identifiers
"""
raise
NotImplementedError
(
'Modules must implement from_xml to be parsable from xml'
)
raise
NotImplementedError
(
'Modules must implement from_xml to be parsable from xml'
)
def
export_to_xml
(
self
,
resource_fs
):
"""
Returns an xml string representing this module, and all modules
underneath it. May also write required resources out to resource_fs
underneath it. May also write required resources out to resource_fs
.
Assumes that modules have single parentage (that no module appears twice
in the same course), and that it is thus safe to nest modules as xml
...
...
@@ -581,8 +580,7 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
XModuleDescriptor using the from_xml method with the same system, org,
and course
"""
raise
NotImplementedError
(
'Modules must implement export_to_xml to enable xml export'
)
raise
NotImplementedError
(
'Modules must implement export_to_xml to enable xml export'
)
# =============================== BUILTIN METHODS ==========================
def
__eq__
(
self
,
other
):
...
...
@@ -756,8 +754,6 @@ class DescriptorSystem(Runtime):
class
XMLParsingSystem
(
DescriptorSystem
):
def
__init__
(
self
,
process_xml
,
policy
,
**
kwargs
):
"""
load_item, resources_fs, error_tracker: see DescriptorSystem
policy: a policy dictionary for overriding xml metadata
process_xml: Takes an xml string, and returns a XModuleDescriptor
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
c36adf84
...
...
@@ -217,8 +217,7 @@ class XmlDescriptor(XModuleDescriptor):
# give the class a chance to fix it up. The file will be written out
# again in the correct format. This should go away once the CMS is
# online and has imported all current (fall 2012) courses from xml
if
not
system
.
resources_fs
.
exists
(
filepath
)
and
hasattr
(
cls
,
'backcompat_paths'
):
if
not
system
.
resources_fs
.
exists
(
filepath
)
and
hasattr
(
cls
,
'backcompat_paths'
):
candidates
=
cls
.
backcompat_paths
(
filepath
)
for
candidate
in
candidates
:
if
system
.
resources_fs
.
exists
(
candidate
):
...
...
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