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
4c3a0174
Commit
4c3a0174
authored
Jul 23, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #462 from edx/cale/use-xblock-children-api
Make XModuleDescriptor use the XBlock children API
parents
1eaba8b0
a9fb82ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
common/lib/xmodule/xmodule/x_module.py
+12
-1
No files found.
common/lib/xmodule/xmodule/x_module.py
View file @
4c3a0174
...
...
@@ -202,6 +202,13 @@ class XModule(XModuleFields, HTMLSnippet, XBlock):
'''
if
self
.
_loaded_children
is
None
:
child_descriptors
=
self
.
get_child_descriptors
()
# This deliberately uses system.get_module, rather than runtime.get_block,
# because we're looking at XModule children, rather than XModuleDescriptor children.
# That means it can use the deprecated XModule apis, rather than future XBlock apis
# TODO: Once we're in a system where this returns a mix of XModuleDescriptors
# and XBlocks, we're likely to have to change this more
children
=
[
self
.
system
.
get_module
(
descriptor
)
for
descriptor
in
child_descriptors
]
# get_module returns None if the current user doesn't have access
# to the location.
...
...
@@ -493,7 +500,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
child
=
child_loc
else
:
try
:
child
=
self
.
system
.
load_item
(
child_loc
)
child
=
self
.
runtime
.
get_block
(
child_loc
)
except
ItemNotFoundError
:
log
.
exception
(
'Unable to load item {loc}, skipping'
.
format
(
loc
=
child_loc
))
continue
...
...
@@ -807,6 +814,10 @@ class DescriptorSystem(object):
self
.
resources_fs
=
resources_fs
self
.
error_tracker
=
error_tracker
def
get_block
(
self
,
block_id
):
"""See documentation for `xblock.runtime:Runtime.get_block`"""
return
self
.
load_item
(
block_id
)
class
XMLParsingSystem
(
DescriptorSystem
):
def
__init__
(
self
,
load_item
,
resources_fs
,
error_tracker
,
process_xml
,
policy
,
**
kwargs
):
...
...
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