From 1cdf4addade706b5bf3105441a70fc9d529608a9 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 18 Apr 2021 18:05:26 -0700 Subject: [PATCH] Fixed docs for function: filter --- README.md | 4 ++++ osxphotos/_version.py | 2 +- osxphotos/phototemplate.md | 1 + osxphotos/phototemplate.py | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb51fe34..b8864eb6 100644 --- a/README.md +++ b/README.md @@ -853,6 +853,9 @@ Valid filters are: • braces: Enclose value in curly braces, e.g. 'value => '{value}'. • parens: Enclose value in parentheses, e.g. 'value' => '(value') • brackets: Enclose value in brackets, e.g. 'value' => '[value]' + • function: Run custom python function to filter value; use in format + 'function:/path/to/file.py::function_name'. See example at https://github.com + /RhetTbull/osxphotos/blob/master/examples/template_filter.py e.g. if Photo keywords are ["FOO","bar"]: @@ -2226,6 +2229,7 @@ Valid filters are: - braces: Enclose value in curly braces, e.g. 'value => '{value}'. - parens: Enclose value in parentheses, e.g. 'value' => '(value') - brackets: Enclose value in brackets, e.g. 'value' => '[value]' +- function: Run custom python function to filter value; use in format 'function:/path/to/file.py::function_name'. See example at https://github.com/RhetTbull/osxphotos/blob/master/examples/template_filter.py e.g. if Photo keywords are `["FOO","bar"]`: diff --git a/osxphotos/_version.py b/osxphotos/_version.py index e41e6710..2478b78d 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.42.7" +__version__ = "0.42.8" diff --git a/osxphotos/phototemplate.md b/osxphotos/phototemplate.md index fc6033fd..603a43dd 100644 --- a/osxphotos/phototemplate.md +++ b/osxphotos/phototemplate.md @@ -39,6 +39,7 @@ Valid filters are: - braces: Enclose value in curly braces, e.g. 'value => '{value}'. - parens: Enclose value in parentheses, e.g. 'value' => '(value') - brackets: Enclose value in brackets, e.g. 'value' => '[value]' +- function: Run custom python function to filter value; use in format 'function:/path/to/file.py::function_name'. See example at https://github.com/RhetTbull/osxphotos/blob/master/examples/template_filter.py e.g. if Photo keywords are `["FOO","bar"]`: diff --git a/osxphotos/phototemplate.py b/osxphotos/phototemplate.py index b0168939..6af83093 100644 --- a/osxphotos/phototemplate.py +++ b/osxphotos/phototemplate.py @@ -174,6 +174,7 @@ FILTER_VALUES = { "braces": "Enclose value in curly braces, e.g. 'value => '{value}'.", "parens": "Enclose value in parentheses, e.g. 'value' => '(value')", "brackets": "Enclose value in brackets, e.g. 'value' => '[value]'", + "function": "Run custom python function to filter value; use in format 'function:/path/to/file.py::function_name'. See example at https://github.com/RhetTbull/osxphotos/blob/master/examples/template_filter.py" } # Just the substitutions without the braces