-
Notifications
You must be signed in to change notification settings - Fork 224
feat:! Adds pointer tag parsing implementation in parse_xml
#830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b3eb22a to
5e0828f
Compare
|
This PR is ready for review. |
15c9d82 to
cd7ba89
Compare
fd3b0eb to
d247d0d
Compare
bc0a1f5 to
fe49706
Compare
|
I didn't test this PR manually, I am trusting Tayyab good domain knowledge and testing on it |
|
@kdmccormick |
fe49706 to
d8f02a9
Compare
|
Yep, this is in my queue Tayyab, sorry for my slowness. |
No worries |
xblock/utils/helpers.py
Outdated
| def load_definition_xml(node, runtime, def_id): | ||
| """ | ||
| Parses and loads an XML definition file based on a given node, runtime | ||
| environment, and definition ID. | ||
| Arguments: | ||
| node: XML element containing attributes for definition loading. | ||
| runtime: The runtime environment that provides resource access. | ||
| def_id: Unique identifier for the definition being loaded. | ||
| Returns: | ||
| tuple: A tuple containing the loaded XML definition and the | ||
| corresponding file path. | ||
| """ | ||
| url_name = node.get('url_name') | ||
| filepath = format_filepath(node.tag, name_to_pathname(url_name)) | ||
| definition_xml = load_file(filepath, runtime.resources_fs, def_id) | ||
| return definition_xml, filepath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work in xblock-sdk as well, or is this logic specific to edx-platform?
If it is specific to edx-platform, then we want want to go through a Runtime method instead, so that edx-platform and xblock-sdk can implement it differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work in xblock-sdk as well, or is this logic specific to edx-platform?
If it is specific to edx-platform, then we want want to go through a Runtime method instead, so that edx-platform and xblock-sdk can implement it differently.
@kdmccormick
I've added the load_definition_xml function to the Runtime class so that it can be optionally overridden by other Runtimes like xblock-sdk. I haven't made it abstract because, as of now, xblock-sdk does not have a course import mechanism that handles the 'pointer-tag' syntax in XML definitions. Making it abstract would unnecessarily enforce implementation where it's not currently needed.
Co-authored-by: Kyle McCormick <[email protected]>
6139828 to
8f6f7e0
Compare
8f6f7e0 to
12e8032
Compare
2ad1be0 to
ea7eddd
Compare
parse_xmlparse_xml
|
I'm not so sure about this approach and wrote up some questions here on the related issue. I don't want to unnecessarily hold things up so don't take this as a definite blocker, but I do want to say that: In general, the way that |
kdmccormick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are discussing alternative implementations on #823 (comment)
|
Closing this PR in favor of this PR in the edx-platform. |
The implementation has been taken from
XmlMixin's pointer tags parsing logic.Testing Notes:
Overall bug investigation ticket: openedx/edx-platform#36390