-
Notifications
You must be signed in to change notification settings - Fork 130
Add substitution to string lib #412
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
Add substitution to string lib #412
Conversation
set library logging level from a user script
pattern matching problems
are equivalent to the darktable variable substitution functions.
Needs darktable-org/darktable#14032 and darktable-org/darktable#13965 to supply data for the variables. |
For those wishing to test/play with substitution I've attached a test script and the image I used to test with is located here, https://drive.google.com/file/d/1xb7AcG_5NSxs4W679K3w61iPqigB5Fts/view?usp=share_link. It's a play raw from pixls. Put it in a folder and import it into darktable. Get the image id (hover over it and look in the image information panel) and replace the 1 in the dt.database.get_image(1) statement. The script prints to the console with the results. |
This makes it feature complete. Some substitutions aren't implemented since the current use case for this is creating export directories. The results from the not implemented substitutions wouldn't work well in path/file names (such as comma separated lists or newlines).
Fixed VERSION_IF_MULTI. Added safety check in category to make sure we don't try and read a tag field that doesn't exist.
The string substitution is feature complete. Some of the variables aren't implemented since the main purpose of this is for use in generating path and filenames in the exporter. However, you can use it to create formatted strings for other uses, such as GUI labels, messages, etc. If enough use is made for this purpose, then the rest of the variables can be implemented. The variables not implemented are:
Some of these are comma separated lists, others are images, and some have no meaning such as jobcode which is used internally. |
added 4.8 syntax to CATEGORY added 4.8 SEQUENCE changes (syntax, start, width)
Added the variable substitution functions used in other scripts to the string library.
Enhanced the substitution functions to be equivalent to the darktable variable substitution functions, including the string manipulations. The darktable variable documentation, https://docs.darktable.org/usermanual/4.2/en/special-topics/variables/, can be used as the reference.
Fixes #386.