-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use ruamel.yaml for formatting and outputting rip .log file #415
Conversation
Old Logger Output:
New logger:
|
I think the simplest solution to get the newlines back introduced is to have regex that run on the following rules:
This is probably simpler than trying to create a custom dumper for ruamel.yaml. @JoeLametta is regex fine by you for this? |
Alright, made some changes, here is the new output:
which generates mostly the same output as before through a series of regex replaces, except that all strings that might contain certain characters (like @JoeLametta this should be ready to merge. |
First of all thanks for the pull request! Overall it seems ready to merge to me. Just a few questions:
Maybe it's unrelated to this pull request but I'm considering restructuring the logger output a bit so that breaking changes are minimized in the future. Current idea: put Whipper section (name to be defined):
Log created by: whipper 0.7.4.dev77+g635113b
Logger used: internal logger
Log creation date: 2019-09-17T01:38:36Z Advantages:
Another idea is to add a field to the logger to version it (signaling breaking changes). @itismadness What do you think about these ideas? Any other suggestions? |
Yes, but ruamel.yaml unfortunately insists on putting quotes around it with the fix there being one of:
Yes, fixed in d01bf08f40c4b5ebf445b967375d4429a6df7f7f.
Yup, missed removing one of the pointless
Similar to my suggestion in #416, I'm on board with splitting multi-value fields apart to make it easier for automated tools to consume. The whipper version line is well-structured enough to make it easy to split apart, but in an ideal world (for me), it'd be cool to see:
I'm not sure it's really necessary to version the |
Everything looks good! Could you also commit a test case for the logger? |
b71ec9f
to
23e7593
Compare
I've rebased on |
That looks fine. I'll add a testcase (swapping out the use of Box in my homegrown test for just manually constructing some dummy test objects) in the next couple of days (probably this weekend). |
Hi, I think this is the last sizable change left to merge before tagging a new whipper's release (v0.8.0). 🎆 |
Alright @JoeLametta, updated with a The testcase then:
I also modified the Travis setup so that it uses requirements.txt for everything but pycdio (which gets installed separately) which makes it a bit easier to add new dependencies in the future as only have to edit one place, not two. |
- insert newlines after blocks of content - strip quotes around creation time and offset - Change offset value representation - Clarify logger regular expressions - Fix missing AccurateRip Summary field - Read usage of time.gmtime(epoch) for generating datetime string - fix missing dependency in travis - install pycdio with specific version separately Signed-off-by: itismadness <itismadness@users.noreply.github.com>
Signed-off-by: itismadness <itismadness@users.noreply.github.com>
f217c8a
to
3cd2da7
Compare
Merged, thanks! |
accuraterip-checksum converted to C extension: whipper-team/whipper#274 Switch to YAML library (ruamel) for formatting log files: whipper-team/whipper#415 Port to Python 3: whipper-team/whipper#411
Similar to #384, but uses ruamel.yaml instead producing a YAML 1.2 compliant log, while retaining the ordering of they keys. There's still some steps of cleanup for values (handful of
"%s"
and"%d"
replaces that can just use the value directly) and then matter of newlines in the log.Here is a test script for checking the output of the logger (relies on having box), without having to actually rip a CD: