Re: picture_viewer.py can now be run stand-alone

2021-10-23 Thread tbp1...@gmail.com
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 no

Re: picture_viewer.py can now be run stand-alone

2021-10-23 Thread tbp1...@gmail.com
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. On Saturday, October 23,

picture_viewer.py can now be run stand-alone

2021-10-23 Thread Edward K. Ream
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_

Re: New picture_viewer.py plugin in devel

2021-10-23 Thread Edward K. Ream
On Sat, Oct 23, 2021 at 12:38 PM tbp1...@gmail.com wrote: I now noticed that an initial path is already one of the *run(*) > arguments. Great! > :-) It's remarkable how simple all the methods are. Edward -- You received this message because you are subscribed to the Google Groups "leo-edit

Re: New picture_viewer.py plugin in devel

2021-10-23 Thread tbp1...@gmail.com
On Saturday, October 23, 2021 at 11:14:24 AM UTC-4 tbp1...@gmail.com wrote: > I'm also thinking it might be useful to be able to optionally specify the > target directory. > I now noticed that an initial path is already one of the *run(*) arguments. Great! -- You received this message becau

Re: New picture_viewer.py plugin in devel

2021-10-23 Thread tbp1...@gmail.com
Turns out you can set the initial zoom factor like this: from leo.plugins.picture_viewer import Slides Slides.scale = .5 Slides().run(c, reset_zoom = False) So no need to change any code. You must use reset_zoom = False for this to work. The one minor negative is that the window itself doesn't

Re: New picture_viewer.py plugin in devel

2021-10-23 Thread tbp1...@gmail.com
I tried the *width* argument, and I had expected that the aspect ratio would be the original. Instead, the width was set to my value but the original size was not changed. So the image was clipped in width. This is not very helpful. I'd rather see the zoom factor set so that the specified w

Re: New picture_viewer.py plugin in devel

2021-10-23 Thread tbp1...@gmail.com
Oh, I see, those args are for *run()*, not the constructor. On Saturday, October 23, 2021 at 9:39:14 AM UTC-4 tbp1...@gmail.com wrote: > Those args in the docstring are not set in the *Slides* constructor: > > exception executing script > TypeError: 'reset_zoom' is an unknown keyword argument > -

Re: New picture_viewer.py plugin in devel

2021-10-23 Thread tbp1...@gmail.com
Those args in the docstring are not set in the *Slides* constructor: exception executing script TypeError: 'reset_zoom' is an unknown keyword argument line 4: from leo.plugins.picture_viewer import Slides * line 5: Slides(reset_zoom = False, width = 900, sort_kind = None).ru