From 2ffcf1e82bfc013a4a9e0e7a709a7c1395c074ce Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sat, 6 Nov 2021 07:13:02 -0700 Subject: [PATCH] Updated OTL to MTL --- README.md | 8 ++++---- osxphotos/phototemplate.md | 2 +- osxphotos/phototemplate.py | 6 +++--- osxphotos/phototemplate.tx | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9dfd03ff..f9ca67be 100644 --- a/README.md +++ b/README.md @@ -1260,8 +1260,8 @@ s ** Templating System ** The templating system converts one or template statements, written in osxphotos -templating language, to one or more rendered values using information from the -photo being processed. +metadata templating language, to one or more rendered values using information +from the photo being processed. In its simplest form, a template statement has the form: "{template_field}", for example "{title}" which would resolve to the title of the photo. @@ -2775,7 +2775,7 @@ If overwrite=False and increment=False, export will fail if destination file alr Render template string for photo. none_str is used if template substitution results in None value and no default specified. -- `template_str`: str in osxphotos template language (OTL) format. See also [Template System](#template-system) table. See notes below regarding specific details of the syntax. +- `template_str`: str in metadata template language (MTL) format. See also [Template System](#template-system) table. See notes below regarding specific details of the syntax. - `options`: an optional osxphotos.phototemplate.RenderOptions object specifying the options to pass to the rendering engine. `RenderOptions` has the following properties: @@ -3353,7 +3353,7 @@ To get the path of every raw photo, whether it's a single raw photo or a raw+JPE ### Template System -The templating system converts one or template statements, written in osxphotos templating language, to one or more rendered values using information from the photo being processed. +The templating system converts one or template statements, written in osxphotos metadata templating language, to one or more rendered values using information from the photo being processed. In its simplest form, a template statement has the form: `"{template_field}"`, for example `"{title}"` which would resolve to the title of the photo. diff --git a/osxphotos/phototemplate.md b/osxphotos/phototemplate.md index 742565b2..c722db04 100644 --- a/osxphotos/phototemplate.md +++ b/osxphotos/phototemplate.md @@ -1,4 +1,4 @@ -The templating system converts one or template statements, written in osxphotos templating language, to one or more rendered values using information from the photo being processed. +The templating system converts one or template statements, written in osxphotos metadata templating language, to one or more rendered values using information from the photo being processed. In its simplest form, a template statement has the form: `"{template_field}"`, for example `"{title}"` which would resolve to the title of the photo. diff --git a/osxphotos/phototemplate.py b/osxphotos/phototemplate.py index 47e25b6c..04b704ca 100644 --- a/osxphotos/phototemplate.py +++ b/osxphotos/phototemplate.py @@ -1,4 +1,4 @@ -""" Custom template system for osxphotos, implements osxphotos template language (OTL) """ +""" Custom template system for osxphotos, implements metadata template language (MTL) """ import datetime import json @@ -27,7 +27,7 @@ from .utils import expand_and_validate_filepath, load_function # ensure locale set to user's locale locale.setlocale(locale.LC_ALL, "") -OTL_GRAMMAR_MODEL = str(pathlib.Path(__file__).parent / "phototemplate.tx") +MTL_GRAMMAR_MODEL = str(pathlib.Path(__file__).parent / "phototemplate.tx") """TextX metamodel for osxphotos template language """ @@ -324,7 +324,7 @@ class PhotoTemplateParser: if hasattr(self, "metamodel"): return - self.metamodel = metamodel_from_file(OTL_GRAMMAR_MODEL, skipws=False) + self.metamodel = metamodel_from_file(MTL_GRAMMAR_MODEL, skipws=False) def parse(self, template_statement): """Parse a template_statement string""" diff --git a/osxphotos/phototemplate.tx b/osxphotos/phototemplate.tx index 7423c154..7824c1af 100644 --- a/osxphotos/phototemplate.tx +++ b/osxphotos/phototemplate.tx @@ -1,4 +1,4 @@ -// OSXPhotos Template Language (OTL) +// OSXPhotos Metadata Template Language (MTL) // a TemplateString has format: // pre{delim+template_field:subfield|filter(path_sep)[find,replace] conditional?bool_value,default}post // a TemplateStatement may contain zero or more TemplateStrings