picture_viewer.py can now be run stand-alone

24 views
Skip to first unread message

Edward K. Ream

unread,
Oct 23, 2021, 9:44:52 PM10/23/21
to leo-editor
See PR #2292.

You can now invoke the plugin outside of Leo this way:

python -m leo.plugins.picture_viewer

At present the code isn't flexible.  The main function calls:

Slides().run(
    c=None,
    delay=1000,
    full_screen=True,
    reset_zoom=True,
    sort_kind='random',
    verbose=False,
)


This is good enough for me, but it would be better to use Python's argparse module to set the various kwargs from the command-line.  All contributions gratefully accepted :-)

Edward

tbp1...@gmail.com

unread,
Oct 23, 2021, 11:19:39 PM10/23/21
to leo-editor
Nice!  There is a problem in closing the window.  The console (at least in Windows) will hang if the slide show is ended with 'q', or if you cancel out of the directory select dialog.  It will complete without hanging if you click the close box of the slide show frame.

tbp1...@gmail.com

unread,
Oct 24, 2021, 12:39:10 AM10/24/21
to leo-editor
Well, I didn't use argparse so it's not as robust as it could be (but it's really simple), but my recent PR provides command line arguments.

On Saturday, October 23, 2021 at 9:44:52 PM UTC-4 Edward K. Ream wrote:
See PR #2292.

You can now invoke the plugin outside of Leo this way:
...

Edward K. Ream

unread,
Oct 24, 2021, 3:44:37 AM10/24/21
to leo-editor
On Sat, Oct 23, 2021 at 11:39 PM tbp1...@gmail.com <tbp1...@gmail.com> wrote:
Well, I didn't use argparse so it's not as robust as it could be (but it's really simple), but my recent PR provides command line arguments.

Thankyou!  I have merged it into devel.

Edward

Edward K. Ream

unread,
Oct 24, 2021, 3:45:08 AM10/24/21
to leo-editor
On Sat, Oct 23, 2021 at 10:19 PM tbp1...@gmail.com <tbp1...@gmail.com> wrote:
Nice!  There is a problem in closing the window.  The console (at least in Windows) will hang if the slide show is ended with 'q', or if you cancel out of the directory select dialog.  It will complete without hanging if you click the close box of the slide show frame.

I was aware of this problem. I'll fix it today.

Edward
Reply all
Reply to author
Forward
0 new messages