PR 2393 creates leo.plugins.remove_duplicate_pictures

49 views
Skip to first unread message

Edward K. Ream

unread,
Jan 27, 2022, 7:59:55 AM1/27/22
to leo-editor
PR #2393 has been merged into devel. This PR adds a program (nominally a plugin) that removes duplicate pictures from a directory and its subdirectories. There is no need ever to enable this plugin.

To execute:  python -m leo.plugins.remove_duplicate_pictures <args>

The -h argument will show all options. Imo, there is no need for more.

See the docstring for a list of required third-party packages.

Please report any bugs. I do not plan to add any enhancements.

Edward

lewis

unread,
Jan 28, 2022, 7:55:15 PM1/28/22
to leo-editor
Docstring needs updating - change line15 (and 19) from:
python -m leo.plugins.remove_duplicate_slides
to:
python -m leo.plugins.remove_duplicate_pictures

Edward K. Ream

unread,
Jan 29, 2022, 6:32:04 AM1/29/22
to leo-editor
On Fri, Jan 28, 2022 at 7:55 PM lewis <lewi...@fastmail.com.au> wrote:
Docstring needs updating

Thanks for this report.

Rev .31f45a5 in devel changes the docstring in three places and removes the unused 'c' positional arg from the run method.

Edward

lewis

unread,
Jan 29, 2022, 6:31:55 PM1/29/22
to leo-editor
Running externally works fine. However running in Leo as a script there are 3 issues.
Quit button does not work.
A single file is reported as a duplicate.
With a single file - if you rerun the script the number of duplicate files reported increments by 1.

Regards
Lewis

tbp1...@gmail.com

unread,
Jan 29, 2022, 10:23:07 PM1/29/22
to leo-editor
Probably because the class RemoveDuplicates initializes at import, not at initialization.  If the class gets reused, the global data variables get reused.  That works fine as a standalone, but not if reused inside Leo.

Edward K. Ream

unread,
Feb 7, 2022, 4:24:51 PM2/7/22
to leo-editor
On Sat, Jan 29, 2022 at 5:31 PM lewis <lewi...@fastmail.com.au> wrote:
Running externally works fine. However running in Leo as a script there are 3 issues.
Quit button does not work.
A single file is reported as a duplicate.
With a single file - if you rerun the script the number of duplicate files reported increments by 1.

Thanks for this report.  PR #2397 contains the fixes.

Edward
Reply all
Reply to author
Forward
0 new messages