You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API_README.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,11 +57,12 @@ osxphotos provides several useful helper functions to make it easy to build simp
57
57
Here's a simple example showing how to use the `query_command` decorator to implement a simple command line tool. The `query_command` decorator turns your function into a full-fledged [Click](https://palletsprojects.com/p/click/) command line app that can be run via `osxphotos run example.py` or `python example.py` if you have pip installed osxphotos. Your command will include all the query options available in `osxphotos query` as command line options as well as `--verbose` and other convenient options.
58
58
59
59
<!--[[[cog
60
-
cog.out("```python\n")
60
+
cog.out("\n```python\n")
61
61
with open("examples/cli_example_1.py", "r") as f:
62
62
cog.out(f.read())
63
63
cog.out("```\n")
64
64
]]]-->
65
+
65
66
```python
66
67
"""Sample query command for osxphotos
67
68
@@ -136,11 +137,12 @@ if __name__ == "__main__":
136
137
Here is a more advanced example that shows how to implement a script with a "dry run" and "resume" capability that preserves state between runs. Using the built-in helpers allows you to implement complex behavior in just a few lines of code.
137
138
138
139
<!--[[[cog
139
-
cog.out("```python\n")
140
+
cog.out("\n```python\n")
140
141
with open("examples/cli_example_2.py", "r") as f:
141
142
cog.out(f.read())
142
143
cog.out("```\n")
143
144
]]]-->
145
+
144
146
```python
145
147
"""Sample query command for osxphotos
146
148
@@ -308,11 +310,12 @@ if __name__ == "__main__":
308
310
In addition to the `query_command` decorator, you can also use the `selection_command` decorator to implement a command that operates on the current selection in Photos.
309
311
310
312
<!--[[[cog
311
-
cog.out("```python\n")
313
+
cog.out("\n```python\n")
312
314
with open("examples/cli_example_3.py", "r") as f:
313
315
cog.out(f.read())
314
316
cog.out("```\n")
315
317
]]]-->
318
+
316
319
```python
317
320
"""Sample query command for osxphotos
318
321
@@ -2242,8 +2245,9 @@ To get the path of every raw photo, whether it's a single raw photo or a raw+JPE
2242
2245
2243
2246
<!--[[[cog
2244
2247
from osxphotos.phototemplate import get_template_help
2245
-
cog.out(get_template_help())
2248
+
cog.out("\n"+get_template_help())
2246
2249
]]]-->
2250
+
2247
2251
<!-- Generated by cog: see phototemplate.cog.md -->
2248
2252
2249
2253
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.
@@ -2408,8 +2412,9 @@ The following template field substitutions are availabe for use the templating s
2408
2412
2409
2413
<!--[[[cog
2410
2414
from osxphotos.phototemplate import get_template_field_table
0 commit comments