Feature custom sidecar 1123 (#1129)

* Working on custom sidecar, #1123

* Working on custom sidecar, #1123

* Added custom sidecar example

* Added WRITE_SKIPPED argument for --sidecar-template

* Updated report writer for user sidecars

* Added noqa to long lines in report writer

* Initial tests for --sidecar-template

* Initial tests for --sidecar-template

* Initial tests for --sidecar-template

* Completed tests for --sidecar-template

* Added json example for --sidecar-template

* Added json example for --sidecar-template
This commit is contained in:
Rhet Turnbull
2023-07-24 06:38:44 -07:00
committed by GitHub
parent 3bae875a63
commit 02b6698c80
10 changed files with 914 additions and 223 deletions

22
tests/custom_sidecar.mako Normal file
View File

@@ -0,0 +1,22 @@
<%doc>
This is an example Mako template for use with --sidecar-template
For more information on Mako templates, see https://docs.makotemplates.org/en/latest/
The template will be passed three variables for rendering:
photo: a PhotoInfo object for the photo being exported
photo_path: a pathlib.Path object for the photo file being exported
sidecar_path: a pathlib.Path object for the sidecar file being written
</%doc>
<%def name="rating(photo)" filter="trim">\
% if photo.favorite:
★★★★★
% else:
★☆☆☆☆
% endif
</%def>\
Sidecar: ${sidecar_path.name}
Photo: ${photo_path.name}
UUID: ${photo.uuid}
Rating: ${rating(photo)}