-
Notifications
You must be signed in to change notification settings - Fork 309
Expose json indent to the otio_json adapter #641
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
Expose json indent to the otio_json adapter #641
Conversation
Codecov Report
@@ Coverage Diff @@
## master #641 +/- ##
=======================================
Coverage 81.69% 81.69%
=======================================
Files 72 72
Lines 2732 2732
=======================================
Hits 2232 2232
Misses 500 500
Continue to review full report at Codecov.
|
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.
Works for me, this is pretty in-line with other adapters that take keyword args.
If you want to go one step farther, you could expose a |
Yeah, good point. I found while reading the code you can trigger that PrettyWriter vs Writer switch by passing a negative value to |
That should either be clearly documented, or perhaps minify=true could do that for you? That would be clearer for someone reading the code, and wouldn't rely on an implementation detail of RapidJSON. |
Totally, however that (< 0) code is ours: https://github.com/PixarAnimationStudios/OpenTimelineIO/blob/0a35894d72b14c7cb8373a00f0dfa594dc493751/src/opentimelineio/serialization.cpp#L707-L756 If you wanted to split out the logic into indent vs no-newlines, we should make the change there and carry the arguments along out to python. |
Note that the decision of which formatter to use (the “PrettyWriter” or the other one RapidJSON supplies) is made outside of rapidJSON, i.e. by the C++ code, if that matters in this discussion.
… On Jan 22, 2020, at 9:36 AM, Joshua Minor ***@***.***> wrote:
That should either be clearly documented, or perhaps minify=true could do that for you? That would be clearer for someone reading the code, and wouldn't rely on an implementation detail of RapidJSON.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#641>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADAWJJOV53LKJHNHEVNPJYTQ7B72TANCNFSM4KIOS6YQ>.
|
Ah, I see. Thanks for pointing that out. I have a slight preference for making this a toggle (pretty vs minified) since I doubt anyone would actually want |
Is it possible there are three values?
-1
4
0 (eliminate spaces to make the file as small as possible?)
… On Jan 22, 2020, at 9:53 AM, Joshua Minor ***@***.***> wrote:
Ah, I see. Thanks for pointing that out. I have a slight preference for making this a toggle (pretty vs minified) since I doubt anyone would actually want indent=3 or any other value.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#641>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADAWJJPCFKYFV35BUUOWZHTQ7CB23ANCNFSM4KIOS6YQ>.
|
Ok, I added some docs for the otio_json adapter. Can someone take a look and perhaps suggest improved wording? |
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.
Looks great. Thanks for documenting that.
* master: (23 commits) Indicate Empty track in otioview and display track name (AcademySoftwareFoundation#677) FCP 7 XML - Fix failure on empty name tags (AcademySoftwareFoundation#674) xges: Effects and Markers Support (AcademySoftwareFoundation#609) Add List of Supported Formats to Conform.py Help Text (AcademySoftwareFoundation#676) Update Copyright/License on ffmpeg_burnins.py (AcademySoftwareFoundation#679) Fix the windows build (AcademySoftwareFoundation#669) Version bump to beta 13 Set final version for beta 12.0 (AcademySoftwareFoundation#665) Rodeofx fix cmx 3600 multiple markers per clip issue 593 (AcademySoftwareFoundation#664) Tweaks to cmake so that pip and local builds both work (AcademySoftwareFoundation#663) Fixed issue where CMX3600 adapter would try to add the same clip to multiple tracks. Also moved some code out of a loop it didn't need to be in. (AcademySoftwareFoundation#644) RV adapter metadata updates (AcademySoftwareFoundation#640) Expose json indent to the otio_json adapter (AcademySoftwareFoundation#641) fix otioconvert for Kdenlive with python3 (AcademySoftwareFoundation#646) Add basic debugging instructions to quickstart. (AcademySoftwareFoundation#655) Add kdenlive adapter to adapters list. (AcademySoftwareFoundation#661) Timecode rate is ignored (AcademySoftwareFoundation#612) Detect if plugin doesn't have a docstring and return an error which says which plugin it is that doesn't have the docstring. (AcademySoftwareFoundation#635) Add hook function args to otioview and otioconvert (AcademySoftwareFoundation#651) Updating Copyright notices (AcademySoftwareFoundation#660) ... # Conflicts: # contrib/opentimelineio_contrib/adapters/advanced_authoring_format.py # src/py-opentimelineio/opentimelineio/adapters/fcp_xml.py
Not at all critical, but this threw me for a bit and I thought it might be nice to expose here.