Added --retry, issue #406

This commit is contained in:
Rhet Turnbull
2021-03-27 22:40:56 -07:00
parent a941f66d62
commit b330e27fb8
18 changed files with 261 additions and 136 deletions

View File

@@ -366,6 +366,11 @@ Options:
may create name collisions on export. (e.g. if may create name collisions on export. (e.g. if
two files happen to have the same name) two files happen to have the same name)
--retry RETRY Automatically retry export up to RETRY times
if an error occurs during export. This may be
useful with network drives that experience
intermittent errors.
--export-by-date Automatically create output folders to --export-by-date Automatically create output folders to
organize photos by date created (e.g. organize photos by date created (e.g.
DEST/2019/12/20/photoname.jpg). DEST/2019/12/20/photoname.jpg).

View File

@@ -1,4 +1,4 @@
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: c43f566654ff6a66a64cd55da2e67fef config: 83db317a0b058d0bba826496215f3269
tags: 645f666f9bcd5a90fca523b33c5a78b7 tags: 645f666f9bcd5a90fca523b33c5a78b7

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; osxphotos 0.41.4 documentation</title> <title>Overview: module code &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>osxphotos.photoinfo._photoinfo_export &#8212; osxphotos 0.41.4 documentation</title> <title>osxphotos.photoinfo._photoinfo_export &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>osxphotos.photoinfo.photoinfo &#8212; osxphotos 0.41.4 documentation</title> <title>osxphotos.photoinfo.photoinfo &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
@@ -486,9 +486,24 @@
<span class="p">)</span> <span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_albums</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_albums</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">burst_albums</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;If photo is non-selected burst photo, list of albums any other images in the same burst set are contained in, otherwise returns self.albums&quot;&quot;&quot;</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">burst_selected</span> <span class="ow">or</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">burst</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">albums</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_burst_albums</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="n">burst_albums</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">photo</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">burst_photos</span><span class="p">:</span>
<span class="n">burst_albums</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">photo</span><span class="o">.</span><span class="n">albums</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_burst_albums</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">burst_albums</span><span class="p">))</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_burst_albums</span>
<span class="nd">@property</span> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">album_info</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">def</span> <span class="nf">album_info</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; list of AlbumInfo objects representing albums the photos is contained in &quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot; list of AlbumInfo objects representing albums the photo is contained in &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_album_info</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_album_info</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span> <span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
@@ -498,6 +513,21 @@
<span class="p">]</span> <span class="p">]</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_album_info</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_album_info</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">burst_album_info</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; If photo is a non-selected burst photo, returns list of AlbumInfo objects representing albums any other photos in the same burst set are contained in, otherwise returns self.album_info &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">burst_selected</span> <span class="ow">or</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">burst</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">album_info</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_burst_album_info</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="n">burst_album_info</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">photo</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">burst_photos</span><span class="p">:</span>
<span class="n">burst_album_info</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">photo</span><span class="o">.</span><span class="n">album_info</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_burst_album_info</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">burst_album_info</span><span class="p">))</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_burst_album_info</span>
<span class="nd">@property</span> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">import_info</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">def</span> <span class="nf">import_info</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; ImportInfo object representing import session for the photo or None if no import session &quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot; ImportInfo object representing import session for the photo or None if no import session &quot;&quot;&quot;</span>
@@ -713,6 +743,11 @@
<span class="sd">&quot;&quot;&quot; Returns True if photo is part of a Burst photo set, otherwise False &quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot; Returns True if photo is part of a Burst photo set, otherwise False &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_info</span><span class="p">[</span><span class="s2">&quot;burst&quot;</span><span class="p">]</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_info</span><span class="p">[</span><span class="s2">&quot;burst&quot;</span><span class="p">]</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">burst_selected</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Returns True if photo is a burst photo and has been selected from the burst set by the user, otherwise False &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_info</span><span class="p">[</span><span class="s2">&quot;burst_key&quot;</span><span class="p">]</span>
<span class="nd">@property</span> <span class="nd">@property</span>
<span class="k">def</span> <span class="nf">burst_photos</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">def</span> <span class="nf">burst_photos</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;If photo is a burst photo, returns list of PhotoInfo objects</span> <span class="sd">&quot;&quot;&quot;If photo is a burst photo, returns list of PhotoInfo objects</span>

View File

@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.41.4', VERSION: '0.41.6',
LANGUAGE: 'None', LANGUAGE: 'None',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
BUILDER: 'html', BUILDER: 'html',

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>osxphotos command line interface (CLI) &#8212; osxphotos 0.41.4 documentation</title> <title>osxphotos command line interface (CLI) &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
@@ -549,6 +549,12 @@ to modify this behavior.</p>
<dd><p>Overwrite existing files. Default behavior is to add (1), (2), etc to filename if file already exists. Use this with caution as it may create name collisions on export. (e.g. if two files happen to have the same name)</p> <dd><p>Overwrite existing files. Default behavior is to add (1), (2), etc to filename if file already exists. Use this with caution as it may create name collisions on export. (e.g. if two files happen to have the same name)</p>
</dd></dl> </dd></dl>
<dl class="std option">
<dt id="cmdoption-osxphotos-export-retry">
<code class="sig-name descname"><span class="pre">--retry</span></code><code class="sig-prename descclassname"> <span class="pre">&lt;RETRY&gt;</span></code><a class="headerlink" href="#cmdoption-osxphotos-export-retry" title="Permalink to this definition"></a></dt>
<dd><p>Automatically retry export up to RETRY times if an error occurs during export. This may be useful with network drives that experience intermittent errors.</p>
</dd></dl>
<dl class="std option"> <dl class="std option">
<dt id="cmdoption-osxphotos-export-export-by-date"> <dt id="cmdoption-osxphotos-export-export-by-date">
<code class="sig-name descname"><span class="pre">--export-by-date</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-osxphotos-export-export-by-date" title="Permalink to this definition"></a></dt> <code class="sig-name descname"><span class="pre">--export-by-date</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-osxphotos-export-export-by-date" title="Permalink to this definition"></a></dt>

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &#8212; osxphotos 0.41.4 documentation</title> <title>Index &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
@@ -538,8 +538,6 @@
<li><a href="cli.html#cmdoption-osxphotos-query-no-description">osxphotos-query command line option</a> <li><a href="cli.html#cmdoption-osxphotos-query-no-description">osxphotos-query command line option</a>
</li> </li>
</ul></li> </ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li> <li>
--no-likes --no-likes
@@ -549,6 +547,8 @@
<li><a href="cli.html#cmdoption-osxphotos-query-no-likes">osxphotos-query command line option</a> <li><a href="cli.html#cmdoption-osxphotos-query-no-likes">osxphotos-query command line option</a>
</li> </li>
</ul></li> </ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li> <li>
--no-place --no-place
@@ -799,6 +799,13 @@
<ul> <ul>
<li><a href="cli.html#cmdoption-osxphotos-export-report">osxphotos-export command line option</a> <li><a href="cli.html#cmdoption-osxphotos-export-report">osxphotos-export command line option</a>
</li>
</ul></li>
<li>
--retry &lt;RETRY&gt;
<ul>
<li><a href="cli.html#cmdoption-osxphotos-export-retry">osxphotos-export command line option</a>
</li> </li>
</ul></li> </ul></li>
<li> <li>
@@ -1089,13 +1096,19 @@
</li> </li>
<li><a href="reference.html#osxphotos.PhotoInfo.ExifInfo.bit_rate">bit_rate (osxphotos.PhotoInfo.ExifInfo attribute)</a> <li><a href="reference.html#osxphotos.PhotoInfo.ExifInfo.bit_rate">bit_rate (osxphotos.PhotoInfo.ExifInfo attribute)</a>
</li> </li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#osxphotos.PhotoInfo.SearchInfo.bodies_of_water">bodies_of_water() (osxphotos.PhotoInfo.SearchInfo property)</a> <li><a href="reference.html#osxphotos.PhotoInfo.SearchInfo.bodies_of_water">bodies_of_water() (osxphotos.PhotoInfo.SearchInfo property)</a>
</li> </li>
<li><a href="reference.html#osxphotos.PhotoInfo.burst">burst() (osxphotos.PhotoInfo property)</a> <li><a href="reference.html#osxphotos.PhotoInfo.burst">burst() (osxphotos.PhotoInfo property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#osxphotos.PhotoInfo.burst_album_info">burst_album_info() (osxphotos.PhotoInfo property)</a>
</li>
<li><a href="reference.html#osxphotos.PhotoInfo.burst_albums">burst_albums() (osxphotos.PhotoInfo property)</a>
</li> </li>
<li><a href="reference.html#osxphotos.PhotoInfo.burst_photos">burst_photos() (osxphotos.PhotoInfo property)</a> <li><a href="reference.html#osxphotos.PhotoInfo.burst_photos">burst_photos() (osxphotos.PhotoInfo property)</a>
</li>
<li><a href="reference.html#osxphotos.PhotoInfo.burst_selected">burst_selected() (osxphotos.PhotoInfo property)</a>
</li> </li>
</ul></td> </ul></td>
</tr></table> </tr></table>
@@ -1586,6 +1599,8 @@
<li><a href="cli.html#cmdoption-osxphotos-export-replace-keywords">--replace-keywords</a> <li><a href="cli.html#cmdoption-osxphotos-export-replace-keywords">--replace-keywords</a>
</li> </li>
<li><a href="cli.html#cmdoption-osxphotos-export-report">--report &lt;path to export report&gt;</a> <li><a href="cli.html#cmdoption-osxphotos-export-report">--report &lt;path to export report&gt;</a>
</li>
<li><a href="cli.html#cmdoption-osxphotos-export-retry">--retry &lt;RETRY&gt;</a>
</li> </li>
<li><a href="cli.html#cmdoption-osxphotos-export-save-config">--save-config &lt;config file path&gt;</a> <li><a href="cli.html#cmdoption-osxphotos-export-save-config">--save-config &lt;config file path&gt;</a>
</li> </li>

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome to osxphotoss documentation! &#8212; osxphotos 0.41.4 documentation</title> <title>Welcome to osxphotoss documentation! &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>osxphotos &#8212; osxphotos 0.41.4 documentation</title> <title>osxphotos &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>

Binary file not shown.

Binary file not shown.

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>osxphotos package &#8212; osxphotos 0.41.4 documentation</title> <title>osxphotos package &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
@@ -650,7 +650,7 @@ including keywords, persons, albums, uuid, path, etc.</p>
<dl class="py method"> <dl class="py method">
<dt id="osxphotos.PhotoInfo.album_info"> <dt id="osxphotos.PhotoInfo.album_info">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">album_info</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.album_info" title="Permalink to this definition"></a></dt> <em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">album_info</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.album_info" title="Permalink to this definition"></a></dt>
<dd><p>list of AlbumInfo objects representing albums the photos is contained in</p> <dd><p>list of AlbumInfo objects representing albums the photo is contained in</p>
</dd></dl> </dd></dl>
<dl class="py method"> <dl class="py method">
@@ -671,6 +671,18 @@ including keywords, persons, albums, uuid, path, etc.</p>
<dd><p>Returns True if photo is part of a Burst photo set, otherwise False</p> <dd><p>Returns True if photo is part of a Burst photo set, otherwise False</p>
</dd></dl> </dd></dl>
<dl class="py method">
<dt id="osxphotos.PhotoInfo.burst_album_info">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">burst_album_info</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.burst_album_info" title="Permalink to this definition"></a></dt>
<dd><p>If photo is a non-selected burst photo, returns list of AlbumInfo objects representing albums any other photos in the same burst set are contained in, otherwise returns self.album_info</p>
</dd></dl>
<dl class="py method">
<dt id="osxphotos.PhotoInfo.burst_albums">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">burst_albums</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.burst_albums" title="Permalink to this definition"></a></dt>
<dd><p>If photo is non-selected burst photo, list of albums any other images in the same burst set are contained in, otherwise returns self.albums</p>
</dd></dl>
<dl class="py method"> <dl class="py method">
<dt id="osxphotos.PhotoInfo.burst_photos"> <dt id="osxphotos.PhotoInfo.burst_photos">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">burst_photos</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.burst_photos" title="Permalink to this definition"></a></dt> <em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">burst_photos</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.burst_photos" title="Permalink to this definition"></a></dt>
@@ -679,6 +691,12 @@ that are part of the same burst photo set; otherwise returns empty list.
self is not included in the returned list</p> self is not included in the returned list</p>
</dd></dl> </dd></dl>
<dl class="py method">
<dt id="osxphotos.PhotoInfo.burst_selected">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">burst_selected</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.burst_selected" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if photo is a burst photo and has been selected from the burst set by the user, otherwise False</p>
</dd></dl>
<dl class="py method"> <dl class="py method">
<dt id="osxphotos.PhotoInfo.comments"> <dt id="osxphotos.PhotoInfo.comments">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">comments</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.comments" title="Permalink to this definition"></a></dt> <em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">comments</span></code><a class="headerlink" href="#osxphotos.PhotoInfo.comments" title="Permalink to this definition"></a></dt>

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &#8212; osxphotos 0.41.4 documentation</title> <title>Search &#8212; osxphotos 0.41.6 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
""" version info """ """ version info """
__version__ = "0.41.5" __version__ = "0.41.6"

View File

@@ -517,6 +517,13 @@ def cli(ctx, db, json_, debug):
"Use this with caution as it may create name collisions on export. " "Use this with caution as it may create name collisions on export. "
"(e.g. if two files happen to have the same name)", "(e.g. if two files happen to have the same name)",
) )
@click.option(
"--retry",
metavar="RETRY",
type=click.INT,
help="Automatically retry export up to RETRY times if an error occurs during export. "
"This may be useful with network drives that experience intermittent errors.",
)
@click.option( @click.option(
"--export-by-date", "--export-by-date",
is_flag=True, is_flag=True,
@@ -892,6 +899,7 @@ def export(
export_as_hardlink, export_as_hardlink,
touch_file, touch_file,
overwrite, overwrite,
retry,
export_by_date, export_by_date,
skip_edited, skip_edited,
skip_original_if_edited, skip_original_if_edited,
@@ -1040,6 +1048,7 @@ def export(
export_as_hardlink = cfg.export_as_hardlink export_as_hardlink = cfg.export_as_hardlink
touch_file = cfg.touch_file touch_file = cfg.touch_file
overwrite = cfg.overwrite overwrite = cfg.overwrite
retry = cfg.retry
export_by_date = cfg.export_by_date export_by_date = cfg.export_by_date
skip_edited = cfg.skip_edited skip_edited = cfg.skip_edited
skip_original_if_edited = cfg.skip_original_if_edited skip_original_if_edited = cfg.skip_original_if_edited
@@ -1199,6 +1208,7 @@ def export(
original_suffix = ( original_suffix = (
DEFAULT_ORIGINAL_SUFFIX if original_suffix is None else original_suffix DEFAULT_ORIGINAL_SUFFIX if original_suffix is None else original_suffix
) )
retry = 0 if not retry else retry
if not os.path.isdir(dest): if not os.path.isdir(dest):
click.echo( click.echo(
@@ -1475,6 +1485,7 @@ def export(
strip=strip, strip=strip,
jpeg_ext=jpeg_ext, jpeg_ext=jpeg_ext,
replace_keywords=replace_keywords, replace_keywords=replace_keywords,
retry=retry,
) )
results += export_results results += export_results
@@ -2353,6 +2364,7 @@ def export_photo(
strip=False, strip=False,
jpeg_ext=None, jpeg_ext=None,
replace_keywords=False, replace_keywords=False,
retry=0,
): ):
"""Helper function for export that does the actual export """Helper function for export that does the actual export
@@ -2392,6 +2404,7 @@ def export_photo(
exiftool_merge_persons: boolean; if True, merged persons found in file's exif data (requires exiftool) exiftool_merge_persons: boolean; if True, merged persons found in file's exif data (requires exiftool)
jpeg_ext: if not None, specify the extension to use for all JPEG images on export jpeg_ext: if not None, specify the extension to use for all JPEG images on export
replace_keywords: if True, --keyword-template replaces keywords instead of adding keywords replace_keywords: if True, --keyword-template replaces keywords instead of adding keywords
retry: retry up to retry # of times if there's an error
Returns: Returns:
list of path(s) of exported photo or None if photo was missing list of path(s) of exported photo or None if photo was missing
@@ -2541,72 +2554,88 @@ def export_photo(
str(pathlib.Path(dest_path) / original_filename) str(pathlib.Path(dest_path) / original_filename)
) )
else: else:
try: tries = 0
export_results = photo.export2( while tries <= retry:
dest_path, tries += 1
original_filename, error = 0
sidecar=sidecar_flags, try:
sidecar_drop_ext=sidecar_drop_ext, export_results = photo.export2(
live_photo=export_live, dest_path,
raw_photo=export_raw, original_filename,
export_as_hardlink=export_as_hardlink, sidecar=sidecar_flags,
overwrite=overwrite, sidecar_drop_ext=sidecar_drop_ext,
use_photos_export=use_photos_export, live_photo=export_live,
exiftool=exiftool, raw_photo=export_raw,
merge_exif_keywords=exiftool_merge_keywords, export_as_hardlink=export_as_hardlink,
merge_exif_persons=exiftool_merge_persons, overwrite=overwrite,
use_albums_as_keywords=album_keyword, use_photos_export=use_photos_export,
use_persons_as_keywords=person_keyword, exiftool=exiftool,
keyword_template=keyword_template, merge_exif_keywords=exiftool_merge_keywords,
description_template=description_template, merge_exif_persons=exiftool_merge_persons,
update=update, use_albums_as_keywords=album_keyword,
ignore_signature=ignore_signature, use_persons_as_keywords=person_keyword,
export_db=export_db, keyword_template=keyword_template,
fileutil=fileutil, description_template=description_template,
dry_run=dry_run, update=update,
touch_file=touch_file, ignore_signature=ignore_signature,
convert_to_jpeg=convert_to_jpeg, export_db=export_db,
jpeg_quality=jpeg_quality, fileutil=fileutil,
ignore_date_modified=ignore_date_modified, dry_run=dry_run,
use_photokit=use_photokit, touch_file=touch_file,
verbose=verbose_, convert_to_jpeg=convert_to_jpeg,
exiftool_flags=exiftool_option, jpeg_quality=jpeg_quality,
jpeg_ext=jpeg_ext, ignore_date_modified=ignore_date_modified,
replace_keywords=replace_keywords, use_photokit=use_photokit,
) verbose=verbose_,
results += export_results exiftool_flags=exiftool_option,
for warning_ in export_results.exiftool_warning: jpeg_ext=jpeg_ext,
verbose_( replace_keywords=replace_keywords,
f"exiftool warning for file {warning_[0]}: {warning_[1]}"
) )
for error_ in export_results.exiftool_error: for warning_ in export_results.exiftool_warning:
verbose_(
f"exiftool warning for file {warning_[0]}: {warning_[1]}"
)
for error_ in export_results.exiftool_error:
click.echo(
click.style(
f"exiftool error for file {error_[0]}: {error_[1]}",
fg=CLI_COLOR_ERROR,
),
err=True,
)
for error_ in export_results.error:
click.echo(
click.style(
f"Error exporting photo ({photo.uuid}: {photo.original_filename}) as {error_[0]}: {error_[1]}",
fg=CLI_COLOR_ERROR,
),
err=True,
)
error += 1
if not error or tries > retry:
results += export_results
break
else:
click.echo(
"Retrying export for photo ({photo.uuid}: {photo.original_filename})"
)
except Exception as e:
click.echo( click.echo(
click.style( click.style(
f"exiftool error for file {error_[0]}: {error_[1]}", f"Error exporting photo ({photo.uuid}: {photo.original_filename}) as {original_filename}: {e}",
fg=CLI_COLOR_ERROR, fg=CLI_COLOR_ERROR,
), ),
err=True, err=True,
) )
for error_ in export_results.error: if tries > retry:
click.echo( results.error.append(
click.style( (str(pathlib.Path(dest) / original_filename), e)
f"Error exporting photo ({photo.uuid}: {photo.original_filename}) as {error_[0]}: {error_[1]}", )
fg=CLI_COLOR_ERROR, break
), else:
err=True, click.echo(
) f"Retrying export for photo ({photo.uuid}: {photo.original_filename})"
)
except Exception as e:
click.echo(
click.style(
f"Error exporting photo ({photo.uuid}: {photo.original_filename}) as {original_filename}: {e}",
fg=CLI_COLOR_ERROR,
),
err=True,
)
results.error.append(
(str(pathlib.Path(dest) / original_filename), e)
)
else: else:
verbose_(f"Skipping original version of {photo.original_filename}") verbose_(f"Skipping original version of {photo.original_filename}")
@@ -2690,70 +2719,87 @@ def export_photo(
) )
else: else:
try: tries = 0
export_results_edited = photo.export2( while tries <= retry:
dest_path, tries += 1
edited_filename, error = 0
sidecar=sidecar_flags, try:
sidecar_drop_ext=sidecar_drop_ext, export_results_edited = photo.export2(
export_as_hardlink=export_as_hardlink, dest_path,
overwrite=overwrite, edited_filename,
edited=True, sidecar=sidecar_flags,
use_photos_export=use_photos_export, sidecar_drop_ext=sidecar_drop_ext,
exiftool=exiftool, export_as_hardlink=export_as_hardlink,
merge_exif_keywords=exiftool_merge_keywords, overwrite=overwrite,
merge_exif_persons=exiftool_merge_persons, edited=True,
use_albums_as_keywords=album_keyword, use_photos_export=use_photos_export,
use_persons_as_keywords=person_keyword, exiftool=exiftool,
keyword_template=keyword_template, merge_exif_keywords=exiftool_merge_keywords,
description_template=description_template, merge_exif_persons=exiftool_merge_persons,
update=update, use_albums_as_keywords=album_keyword,
ignore_signature=ignore_signature, use_persons_as_keywords=person_keyword,
export_db=export_db, keyword_template=keyword_template,
fileutil=fileutil, description_template=description_template,
dry_run=dry_run, update=update,
touch_file=touch_file, ignore_signature=ignore_signature,
convert_to_jpeg=convert_to_jpeg, export_db=export_db,
jpeg_quality=jpeg_quality, fileutil=fileutil,
ignore_date_modified=ignore_date_modified, dry_run=dry_run,
use_photokit=use_photokit, touch_file=touch_file,
verbose=verbose_, convert_to_jpeg=convert_to_jpeg,
exiftool_flags=exiftool_option, jpeg_quality=jpeg_quality,
jpeg_ext=jpeg_ext, ignore_date_modified=ignore_date_modified,
replace_keywords=replace_keywords, use_photokit=use_photokit,
) verbose=verbose_,
results += export_results_edited exiftool_flags=exiftool_option,
for warning_ in export_results_edited.exiftool_warning: jpeg_ext=jpeg_ext,
verbose_( replace_keywords=replace_keywords,
f"exiftool warning for file {warning_[0]}: {warning_[1]}"
) )
for error_ in export_results_edited.exiftool_error: for warning_ in export_results_edited.exiftool_warning:
verbose_(
f"exiftool warning for file {warning_[0]}: {warning_[1]}"
)
for error_ in export_results_edited.exiftool_error:
click.echo(
click.style(
f"exiftool error for file {error_[0]}: {error_[1]}",
fg=CLI_COLOR_ERROR,
),
err=True,
)
for error_ in export_results_edited.error:
click.echo(
click.style(
f"Error exporting edited photo ({photo.uuid}: {photo.original_filename}) as {error_[0]}: {error_[1]}",
fg=CLI_COLOR_ERROR,
),
err=True,
)
error += 1
if not error or tries > retry:
results += export_results_edited
break
else:
click.echo(
"Retrying export for photo ({photo.uuid}: {photo.original_filename})"
)
except Exception as e:
click.echo( click.echo(
click.style( click.style(
f"exiftool error for file {error_[0]}: {error_[1]}", f"Error exporting edited photo ({photo.uuid}: {photo.original_filename}) {filename} as {edited_filename}: {e}",
fg=CLI_COLOR_ERROR, fg=CLI_COLOR_ERROR,
), ),
err=True, err=True,
) )
for error_ in export_results_edited.error: if tries > retry:
click.echo( results.error.append(
click.style( (str(pathlib.Path(dest) / edited_filename), e)
f"Error exporting edited photo ({photo.uuid}: {photo.original_filename}) as {error_[0]}: {error_[1]}", )
fg=CLI_COLOR_ERROR, break
), else:
err=True, click.echo(
) f"Retrying export for photo ({photo.uuid}: {photo.original_filename})"
except Exception as e: )
click.echo(
click.style(
f"Error exporting edited photo ({photo.uuid}: {photo.original_filename}) {filename} as {edited_filename}: {e}",
fg=CLI_COLOR_ERROR,
),
err=True,
)
results.error.append(
(str(pathlib.Path(dest) / edited_filename), e)
)
if verbose: if verbose:
if update: if update:

File diff suppressed because one or more lines are too long