Repository navigation
Video xml serialization bugs #688
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
Closed
chrisndodge
wants to merge
7
commits into
master
from
fix/cdodge/unicode-error-in-video-xml-serilization
Closed
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
042f5f4
was getting unicode errors when exporting CB22x
8b358e9
export_to_xml() really should be definition_to_xml() since we'll rely…
69cde61
remove commented out line
a1d0f9b
update tests to call definition_to_xml rather than export_to_xml, whi…
2ef1e60
Make our deserializing consistent with serializing.
c9dabab
have XModuleDescriptor properly ensure category is set
c6e05e5
Merge branch 'fix/cdodge/unicode-error-in-video-xml-serilization' of …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this approach means that we go through the serialization code in XmlModule, it is not necessary to wrap the value of "show_captions" with json.dumps (on line 259).
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.
Actually, when I removed json.dumps the boolean did not get serialized out. I guess that is because we are not sending the model data value, but the _from_json value (due to calling it as self.show_captions instead of getting it directly from the model data). So json.dumps stays for now. It might be better to change it to _to_json.
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.
OK, my last note about this. The videoalpha code right below this expects value to be a string. In fact, a boolean value of False causes nothing to be written out:
I'm not particularly sold on what is going on in this method, but I am inclined to leave it alone for now.
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.
Arggh. Of course, my current branch has tools to fix this... (ad nauseum). Both this line and the one above re video ids, should, given the current master, only grab the values from self if
field.name in self._model_data. The way this code is written, we will not export explicitly set values if they so happen to be == default even if inheritance would overwrite them w/ something that's not the default. In this case, inheritance may not be an issue b/c these may all be Scope.content, but it's a bad pattern.The loop should be over the explicitly set values and not have this
if value:logic.Given this rant, however, I think we can go ahead but someone should clean up these oddities throughout the code someday (i'm not sure how to capture, perhaps at least a # TODO?)