Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread Thomas Passin

On Monday, May 13, 2024 at 8:18:56 PM UTC-4 chr...@gmail.com wrote:

OK, it *WORKS*.
...
*THANK YOU SO MUCH THOMAS!* I got the job done just as my nightly backups 
started, ruthlessly hogging the CPU of the laptop I was using.

 
Glad I could help!
 

By the way, several other plugins don't work anymore. I forgot which ones.


There are quite a few, actually.  Some never got updated for Qt, and some 
weren't updated for Qt6.  Their original authors haven't thought to see if 
they work (maybe they have moved on and don't use the plugin any more).  In 
some cases, the plugins may have been subjected to some enhancement, 
usually adding type hints, that ended up changing some variable or property 
such that the code no longer worked.  There are still (I'm pretty sure) old 
plugins that were written for Python2 and never updated.

No one is interested in working through all of them and getting them 
working.  Who wants to spend time figuring out how a plugin works that one 
doesn't want to use anyway, especially if using it is complex and hard to 
understand?  In the case of leo-to-html, I got curious to see if it did 
something I'd like, and when I looked at it, the code and operation seemed 
fairly simple, so I spent the time for you.
 

The "outside of the python directory" LEO-EDITOR-MASTER trick is a very 
good one. It makes updating both python and Leo sources much easier, 
without having to create environments etc. It seems to have disappeared 
from the "downloading Leo" webpage, though. There was a "downloading 
sources" section, and I always assumed that the other download methods were 
providing a kind of half "compiled' Leo, so I never used them. Is that the 
case? now the whole sources package can be downloaded from github, I guess.


Nowadays the equivalent would be the *leo-editor* directory, which is above 
the *leo* directory in the repository.  You get it if you clone the repo.
 

"Leo is a PIM" is not really true anymore.
Without the whole professional programmer's knowledge of all the 
intricacies of  process and online platforms such as github and all the 
extra software used to put together and install something like Leo, the guy 
like me for whom computers are first and foremost (addictive) tools to 
achieve other things, Leo's complexity has evolved so much that it is now 
only a great tool for programmers.

I'm planning to go back to OmniOutliner: I'll have my outlines (with 
pictures) on my Mac, on my PCs through Teamviewer, and on my iPad and 
iPhone without having to convert them to OPML with a script. I won't have 
to go through reams of scattershot documentations at every turn of the road.

It was an interesting adventure...

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/e1cd50a5-25fb-4574-aad4-3c43954bcb3dn%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread chr...@gmail.com
OK, it *WORKS*.
My correct path was indeed C:\leo-editor-master\leo\plugins\, and I now 
remember that what's in 
C:\Python311\Lib\site-packages\leo-6.7.7.dist-info\
(NOT \leo) is a bunch of stuff that I guessed was like pointing to the 
actual source directory (leo-editor-master). I downloaded the plugin file 
following your instructions, and the file had a couple hundred bytes less 
than my clumsy cut-and-paste of the code. I should have thought of looking 
up the code of leo_to_html.py: I had noticed the difference of menu name  
in its doc and could have fixed it, but without a complete, deep, 
well-organized documentation, to the non-advanced-IT-professional Leo is 
such a black box that the idea didn't cross my mind.

*THANK YOU SO MUCH THOMAS!* I got the job done just as my nightly backups 
started, ruthlessly hogging the CPU of the laptop I was using.

By the way, several other plugins don't work anymore. I forgot which ones.

The "outside of the python directory" LEO-EDITOR-MASTER trick is a very 
good one. It makes updating both python and Leo sources much easier, 
without having to create environments etc. It seems to have disappeared 
from the "downloading Leo" webpage, though. There was a "downloading 
sources" section, and I always assumed that the other download methods were 
providing a kind of half "compiled' Leo, so I never used them. Is that the 
case? now the whole sources package can be downloaded from github, I guess.

"Leo is a PIM" is not really true anymore.
Without the whole professional programmer's knowledge of all the 
intricacies of  process and online platforms such as github and all the 
extra software used to put together and install something like Leo, the guy 
like me for whom computers are first and foremost (addictive) tools to 
achieve other things, Leo's complexity has evolved so much that it is now 
only a great tool for programmers.

I'm planning to go back to OmniOutliner: I'll have my outlines (with 
pictures) on my Mac, on my PCs through Teamviewer, and on my iPad and 
iPhone without having to convert them to OPML with a script. I won't have 
to go through reams of scattershot documentations at every turn of the road.

It was an interesting adventure...

Ciao!
On Monday, May 13, 2024 at 10:06:08 PM UTC tbp1...@gmail.com wrote:

> Yes, once you find the leo-to-html.py file, download it and then copy into 
> your Python install's *site-packages/leo/plugins* directory.
>
> To find that location, open a terminal or console and run
>
> py -m pip show leo
>
> NOTE - use the actual command that you use to run Python if it's not 
> "py".  The response will include a line that tells you where the right 
> *site-packages* directory is.  On my system it's
>
> Location: C:\Users\tom\AppData\Roaming\Python\Python312\site-packages
>
> Here's a step-by-step now that's in the main Leo-Editor repository.  
> First, navigate to the top of the repo 
> . Select the *Code* tab if it's 
> not selected. Then select the *devel* branch in the branch selector box, 
> near the upper left.  Then navigate to *leo/plugins* page and scroll down 
> until you find the link to our file, *leo-html.py*.  Click that link.
> In  that page, the one for our file,  notice near the upper right that 
> there is a box labeled "Raw".  There is a download icon next to it.  Click 
> that to download our file.
>
> Please post about any apparent bugs you find - I haven't given this fix 
> much of a workout.  I hoped to get you running as quickly as possible since 
> you sounded as if you depend a lot on the plugin.
> On Monday, May 13, 2024 at 5:48:26 PM UTC-4 chr...@gmail.com wrote:
>
>> On Monday, May 13, 2024 at 8:06:29 PM UTC tbp1...@gmail.com wrote:
>>
>> I have created a pull request, 3907 
>> , that gets this 
>> plugin working again.  At least, it works when outputting just the 
>> headlines. 
>>
>> If anyone wants to try it out before the PR gets merged into the devel 
>> branch, you can follow the link in the Github PR page to my repository and 
>> get the file there.
>>
>>
>> Thanks Thomas, I half understand "Github PR page to my repository"... is 
>> the name of the file LEO-TO-HTML.? and do I replace the same file in my 
>> installation?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/e99dd7ac-740f-463b-bfa1-c60fe79783den%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread Thomas Passin

On Monday, May 13, 2024 at 6:33:18 PM UTC-4 chr...@gmail.com wrote:

OK,  so that's why it wouldn't work: I copied it in 
C:\leo-editor-master\leo\plugins\
I don't even know the difference betweenl eo-editor-master and  the install 
that's in Python site-packages.


I assumed that you were trying to use it with the latest Leo release, the 
one you get by installing it with pip. If you have a copy or clone of the 
whole Leo repository you have to make sure that Python will use that one 
instead.  There are various ways to do that.  At any rate, the command I 
gave you earlier will tell you where the thing is actually living.
 

I'MM A SELF-TAUGHT GUY except for one semester of BASIC on Apple 2 around 
1982, fer chrissakes. But I did surf the wave all along, and among other 
things I even learned C in a week and wrote an online financial datafeed 
custom on-demand retrieval program for UBS in the early 90s, in another two 
weeks, dammit.
Only ever used Github to download useful stuff. I couldn't find how to 
download the plugin so I copied the text, and of course the first time it 
wasn't fully expanded.
Gonna try what you wrote now.

On Monday, May 13, 2024 at 10:06:08 PM UTC tbp1...@gmail.com wrote:

Yes, once you find the leo-to-html.py file, download it and then copy into 
your Python install's *site-packages/leo/plugins* directory.

To find that location, open a terminal or console and run

py -m pip show leo

NOTE - use the actual command that you use to run Python if it's not "py".  
The response will include a line that tells you where the right 
*site-packages* directory is.  

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/09a7b44b-15e1-4640-b47d-708b35e894ean%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread chr...@gmail.com
OK,  so that's why it wouldn't work: I copied it in 
C:\leo-editor-master\leo\plugins\
I don't even know the difference betweenl eo-editor-master and  the install 
that's in Python site-packages. I'MM A SELF-TAUGHT GUY except for one 
semester of BASIC on Apple 2 around 1982, fer chrissakes. But I did surf 
the wave all along, and among other things I even learned C in a week and 
wrote an online financial datafeed custom on-demand retrieval program for 
UBS in the early 90s, in another two weeks, dammit.
Only ever used Github to download useful stuff. I couldn't find how to 
download the plugin so I copied the text, and of course the first time it 
wasn't fully expanded.
Gonna try what you wrote now.

On Monday, May 13, 2024 at 10:06:08 PM UTC tbp1...@gmail.com wrote:

> Yes, once you find the leo-to-html.py file, download it and then copy into 
> your Python install's *site-packages/leo/plugins* directory.
>
> To find that location, open a terminal or console and run
>
> py -m pip show leo
>
> NOTE - use the actual command that you use to run Python if it's not 
> "py".  The response will include a line that tells you where the right 
> *site-packages* directory is.  On my system it's
>
> Location: C:\Users\tom\AppData\Roaming\Python\Python312\site-packages
>
> Here's a step-by-step now that's in the main Leo-Editor repository.  
> First, navigate to the top of the repo 
> . Select the *Code* tab if it's 
> not selected. Then select the *devel* branch in the branch selector box, 
> near the upper left.  Then navigate to *leo/plugins* page and scroll down 
> until you find the link to our file, *leo-html.py*.  Click that link.
> In  that page, the one for our file,  notice near the upper right that 
> there is a box labeled "Raw".  There is a download icon next to it.  Click 
> that to download our file.
>
> Please post about any apparent bugs you find - I haven't given this fix 
> much of a workout.  I hoped to get you running as quickly as possible since 
> you sounded as if you depend a lot on the plugin.
> On Monday, May 13, 2024 at 5:48:26 PM UTC-4 chr...@gmail.com wrote:
>
>> On Monday, May 13, 2024 at 8:06:29 PM UTC tbp1...@gmail.com wrote:
>>
>> I have created a pull request, 3907 
>> , that gets this 
>> plugin working again.  At least, it works when outputting just the 
>> headlines. 
>>
>> If anyone wants to try it out before the PR gets merged into the devel 
>> branch, you can follow the link in the Github PR page to my repository and 
>> get the file there.
>>
>>
>> Thanks Thomas, I half understand "Github PR page to my repository"... is 
>> the name of the file LEO-TO-HTML.? and do I replace the same file in my 
>> installation?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/3037f907-5a61-4618-b942-b1fea353ba96n%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread Thomas Passin
Yes, once you find the leo-to-html.py file, download it and then copy into 
your Python install's *site-packages/leo/plugins* directory.

To find that location, open a terminal or console and run

py -m pip show leo

NOTE - use the actual command that you use to run Python if it's not "py".  
The response will include a line that tells you where the right 
*site-packages* directory is.  On my system it's

Location: C:\Users\tom\AppData\Roaming\Python\Python312\site-packages

Here's a step-by-step now that's in the main Leo-Editor repository.  First, 
navigate to the top of the repo . 
Select the *Code* tab if it's not selected. Then select the *devel* branch 
in the branch selector box, near the upper left.  Then navigate to 
*leo/plugins* page and scroll down until you find the link to our file, 
*leo-html.py*.  Click that link.
In  that page, the one for our file,  notice near the upper right that 
there is a box labeled "Raw".  There is a download icon next to it.  Click 
that to download our file.

Please post about any apparent bugs you find - I haven't given this fix 
much of a workout.  I hoped to get you running as quickly as possible since 
you sounded as if you depend a lot on the plugin.
On Monday, May 13, 2024 at 5:48:26 PM UTC-4 chr...@gmail.com wrote:

> On Monday, May 13, 2024 at 8:06:29 PM UTC tbp1...@gmail.com wrote:
>
> I have created a pull request, 3907 
> , that gets this 
> plugin working again.  At least, it works when outputting just the 
> headlines. 
>
> If anyone wants to try it out before the PR gets merged into the devel 
> branch, you can follow the link in the Github PR page to my repository and 
> get the file there.
>
>
> Thanks Thomas, I half understand "Github PR page to my repository"... is 
> the name of the file LEO-TO-HTML.? and do I replace the same file in my 
> installation?
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/989d1ab0-f46a-4925-8889-346e54d4a7abn%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread chr...@gmail.com
OK, found it

On Monday, May 13, 2024 at 9:48:26 PM UTC chr...@gmail.com wrote:

> On Monday, May 13, 2024 at 8:06:29 PM UTC tbp1...@gmail.com wrote:
>
> I have created a pull request, 3907 
> , that gets this 
> plugin working again.  At least, it works when outputting just the 
> headlines. 
>
> If anyone wants to try it out before the PR gets merged into the devel 
> branch, you can follow the link in the Github PR page to my repository and 
> get the file there.
>
>
> Thanks Thomas, I half understand "Github PR page to my repository"... is 
> the name of the file LEO-TO-HTML.? and do I replace the same file in my 
> installation?
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/95e5ab8c-f665-4c5c-ba60-675d288294a8n%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread chr...@gmail.com


On Monday, May 13, 2024 at 8:06:29 PM UTC tbp1...@gmail.com wrote:

I have created a pull request, 3907 
, that gets this plugin 
working again.  At least, it works when outputting just the headlines. 

If anyone wants to try it out before the PR gets merged into the devel 
branch, you can follow the link in the Github PR page to my repository and 
get the file there.


Thanks Thomas, I half understand "Github PR page to my repository"... is 
the name of the file LEO-TO-HTML.? and do I replace the same file in my 
installation?

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1919ef53-5348-47d1-98b2-13508e27325dn%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread Thomas Passin
This PR has been merged into the *devel *branch, if you need it before the 
next general release of Leo.

On Monday, May 13, 2024 at 4:06:29 PM UTC-4 Thomas Passin wrote:

> I have created a pull request, 3907 
> , that gets this 
> plugin working again.  At least, it works when outputting just the 
> headlines.  I haven't tested it including all the body text.  But I think 
> it should work as it did before.
>
> As for that *Properties* submenu in the Plugins menu, that's not going to 
> work until someone is able to put in a lot of work to make it function in 
> Qt (it's a holdover from the Tk  Gui days, apparently).  But you can still 
> set those properties by hand in the .ini file *leo-to-html.ini*, as before
> *.*
>
> If anyone wants to try it out before the PR gets merged into the devel 
> branch, you can follow the link in the Github PR page to my repository and 
> get the file there.
>
> On Monday, May 13, 2024 at 1:21:21 PM UTC-4 Thomas Passin wrote:
>
>> I don't know why it's not working, but I do know why the submenus aren't 
>> appearing.  It's because the plugin is trying to add its own menus under 
>> the *File/Export...* menu.  But that's been renamed and is now *File/Export 
>> Files*.  The plugin code will have to change to match that name.  Even 
>> better would be for the plugin to insert its own menu item with its 
>> submenus.  Then it won't fail the next time there's a menu name change.
>>
>> What is the latest release where you know it worked?
>>
>>
>> On Monday, May 13, 2024 at 12:35:09 PM UTC-4 chr...@gmail.com wrote:
>>
>> *...and it's a major-urgent-pain-in-the-neck for me!*
>>
>> - None of the plugin submenus appear in the File > Export Files... menu
>> - The plugin is correctly enabled in myLeoSettings.leo
>> - There is no "@bool leo_to_html_no_menus = True" anywhere
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6cc8cb81-30fb-4976-b03d-1e862d8fc7d2n%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread chr...@gmail.com


@tbp1...@gmail.com
*What is the latest release where you know it worked?*

Maybe November, not sure at all. 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/581cdcf8-ad4c-433a-9250-6bec577cc2fbn%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread Thomas Passin
I have created a pull request, 3907 
, that gets this plugin 
working again.  At least, it works when outputting just the headlines.  I 
haven't tested it including all the body text.  But I think it should work 
as it did before.

As for that *Properties* submenu in the Plugins menu, that's not going to 
work until someone is able to put in a lot of work to make it function in 
Qt (it's a holdover from the Tk  Gui days, apparently).  But you can still 
set those properties by hand in the .ini file *leo-to-html.ini*, as before
*.*

If anyone wants to try it out before the PR gets merged into the devel 
branch, you can follow the link in the Github PR page to my repository and 
get the file there.

On Monday, May 13, 2024 at 1:21:21 PM UTC-4 Thomas Passin wrote:

> I don't know why it's not working, but I do know why the submenus aren't 
> appearing.  It's because the plugin is trying to add its own menus under 
> the *File/Export...* menu.  But that's been renamed and is now *File/Export 
> Files*.  The plugin code will have to change to match that name.  Even 
> better would be for the plugin to insert its own menu item with its 
> submenus.  Then it won't fail the next time there's a menu name change.
>
> What is the latest release where you know it worked?
>
>
> On Monday, May 13, 2024 at 12:35:09 PM UTC-4 chr...@gmail.com wrote:
>
> *...and it's a major-urgent-pain-in-the-neck for me!*
>
> - None of the plugin submenus appear in the File > Export Files... menu
> - The plugin is correctly enabled in myLeoSettings.leo
> - There is no "@bool leo_to_html_no_menus = True" anywhere
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0c45591c-8180-4b54-97ac-d4c2e621c5bbn%40googlegroups.com.


Re: leo-to-html HAS STOPPED WORKING

2024-05-13 Thread Thomas Passin
I don't know why it's not working, but I do know why the submenus aren't 
appearing.  It's because the plugin is trying to add its own menus under 
the *File/Export...* menu.  But that's been renamed and is now *File/Export 
Files*.  The plugin code will have to change to match that name.  Even 
better would be for the plugin to insert its own menu item with its 
submenus.  Then it won't fail the next time there's a menu name change.

What is the latest release where you know it worked?

On Monday, May 13, 2024 at 12:35:09 PM UTC-4 chr...@gmail.com wrote:

*...and it's a major-urgent-pain-in-the-neck for me!*

- None of the plugin submenus appear in the File > Export Files... menu
- The plugin is correctly enabled in myLeoSettings.leo
- There is no "@bool leo_to_html_no_menus = True" anywhere

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/032ae6d1-d34b-4598-add7-77bf483b4f1cn%40googlegroups.com.


leo-to-html HAS STOPPED WORKING

2024-05-13 Thread chr...@gmail.com
*...and it's a major-urgent-pain-in-the-neck for me!*

- None of the plugin submenus appear in the File > Export Files... menu
- The plugin is correctly enabled in myLeoSettings.leo
- There is no "@bool leo_to_html_no_menus = True" anywhere

- I have a  ~450 headlines outline, so I tried with a 3-line
"test1"
"test2"-"test3" outline, here is what I get by running
"export-html-bullet" from the minibuffer:





















*Leo Log WindowLeo 6.7.7Python 3.11.8, PyQt version 5.15.2Windows 10 AMD64 
(build 10.0.19045) SP0leo_to_html: running ...Traceback (most recent call 
last):  File "C:\leo-editor-master\leo\core\leoKeys.py", line 2501, in 
callAltXFunctionfunc(event)  File 
"C:\leo-editor-master\leo\plugins\leo_to_html.py", line 248, in 
export_html_headself.export_html(bullet='head')  File 
"C:\leo-editor-master\leo\plugins\leo_to_html.py", line 236, in 
export_htmlhtml.main(bullet=bullet, show=show, node=node)  File 
"C:\leo-editor-master\leo\plugins\leo_to_html.py", line 453, in main
self.do_xhtml(node)  File 
"C:\leo-editor-master\leo\plugins\leo_to_html.py", line 353, in do_xhtml
self.doItemHeadlineTags(root)  File 
"C:\leo-editor-master\leo\plugins\leo_to_html.py", line 373, in 
doItemHeadlineTagsself.doHeadline(p, level)  File 
"C:\leo-editor-master\leo\plugins\leo_to_html.py", line 408, in doHeadline  
  self.xhtml.append(self.openHeadlineString % h + headline + 
self.closeHeadlineString % h)^^AttributeError: 'Leo_to_HTML' 
object has no attribute 'xhtml'*

same result with "export-html-head"

- The Toolbar Menu -> Plugins ->Properties results in this in the log 
window:
*Properties menu not supported for Qt gui*

"export-html-node" doesn't work either.

HELP!






-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a86d7500-23af-4994-bc51-d8e0a6f776b0n%40googlegroups.com.


Re: A Script To Display The Viewrendered3 Pane in the Same Place s The Body

2024-05-13 Thread jkn
Hey, that looks like great fun!


On Monday, May 13, 2024 at 3:00:58 PM UTC+1 Edward K. Ream wrote:

> On Sunday, May 12, 2024 at 4:17:19 PM UTC-5 tbp1...@gmail.com wrote:
>
> I have devised a script that can [swap the body and VR3 panes].  You can 
> put it into a button for easy activation, or you could make it into a 
> command in the Settings tree and bind it to a keystroke. 
>
>
> Thomas, your private email on this topic was a Eureka moment for me. I 
> realized that we Leo devs aren't aware of the hierarchy of Leo's Qt widgets.
>
> The following script helps cure that ignorance:
>
> """Scripts to discover Leo's Qt Widget hierarchy."""
> g.cls()
>
> total = 0
>
> def w_name(w):
> name = w.objectName() or 'no name'
> return f"<{name}>:{ w.__class__.__name__}"
>
> def dump(tag, w, level=0):
> global total
> total += 1
> ws = (level * 2) * ' '
> print(f"{id(w):<14} lvl {level:2}: {ws}{tag}:{w_name(w)}")
> 
> def dump_children(w, level=0):
> if 1:  # Specify wanted classes...
> wanted = (
> 'DynamicWindow', 'Frame', 'Layout',
> 'Splitter', 'Stacked', 'Text', 'Widget')
> children = [z for z in w.children()
> if any (z2 in z.__class__.__name__ for z2 in wanted)]
> else:  # Specifiy unwanted classes...
> ignore = ('action', 'animation', 'menu')
> children = [z for z in w.children()
> if not any (z2 in z.__class__.__name__.lower() for z2 in 
> ignore)]
> if children:
> for i, child in enumerate(children):
> dump(f"child {i}", child, level + 1)
> dump_children(child, level + 1)
> 
> def full_dump(tag, w, level=0):
> print('')
> print(f"Full dump of {w_name(w)} at {id(w)}...\n")
> dump(tag, w)
> dump_children(w)
> 
> if 1:
> full_dump('c.frame.top.parent()', c.frame.top.parent())
> else:
>
> flc = c.free_layout  # free layout controller
> top_splitter = flc.get_top_splitter()
> dump('c.frame.top.parent()', c.frame.top.parent())
> dump('c.frame.top', c.frame.top)
> full_dump('top_splitter', top_splitter)
>
> print('')
> print(f"total objects: {total}")
>
> And here is the output:
>
> Full dump of :QStackedWidget at 
> 2877793745520...
>
> 2877793745520  lvl  0: 
> c.frame.top.parent()::QStackedWidget
> 2877793745840  lvl  1:   child 0::QStackedLayout
> 2877687572080  lvl  1:   child 1::DynamicWindow
> 2877793745200  lvl  2: child 0:<_layout>:QLayout
> 2877687572560  lvl  2: child 1::QWidget
> 2877687572880  lvl  3:   child 0::QVBoxLayout
> 2877687573040  lvl  3:   child 1::NestedSplitter
> 2877793731920  lvl  4: child 0::NestedSplitter
> 2877692019248  lvl  5:   child 0::QFrame
> 2877692019408  lvl  6: child 0::QFrame
> 2877692019728  lvl  7:   child 
> 0::QStackedWidget
> 2877793746480  lvl  8: child 0::QStackedLayout
> 2877692019888  lvl  8: child 1::QWidget
> 2877692020368  lvl  9:   child 
> 0::LeoQTextBrowser
> 2877793746320  lvl 10: child 
> 0::QWidget
> 2877793746640  lvl 10: child 
> 1::QWidget
> 2877793550416  lvl 11:   child 0::QBoxLayout
> 2877793731440  lvl 10: child 
> 2::QWidget
> 2877793746800  lvl 11:   child 0::QBoxLayout
> 2877692020848  lvl  9:   child 1::QVBoxLayout
> 2877692021168  lvl  7:   child 1::QGridLayout
> 2877692021008  lvl  6: child 1::QGridLayout
> 2877793732080  lvl  5:   child 
> 1::NestedSplitterHandle
> 2877692019568  lvl  5:   child 
> 2::NestedSplitterHandle
> 2877687573200  lvl  4: child 1::NestedSplitter
> 2877687574640  lvl  5:   child 0::QFrame
> 2877687574800  lvl  6: child 0::QFrame
> 2877687575120  lvl  7:   child 0::QTabWidget
> 2877793746480  lvl  8: child 
> 0::QStackedWidget
> 2877793731440  lvl  9:   child 0::QStackedLayout
> 2877687575920  lvl  9:   child 1::QWidget
> 2877687576080  lvl 10: child 
> 0::QVBoxLayout
> 2877687576240  lvl 10: child 1::QFrame
> 2877687576400  lvl 11:   child 
> 0::QVBoxLayout
> 2877687576560  lvl 12: child 
> 0::QGridLayout
> 2877692018768  lvl 11:   child 
> 1::QListWidget
> 2877793746320  lvl 12: child 
> 0::QWidget
> 2877793746640  lvl 12: child 
> 1::QWidget
> 2877793743600  lvl 13:   child 0: name>:QBoxLayout
> 2877793746800  lvl 12: child 
> 2::QWidget
> 2877793743920  lvl 13:   child 0: name>:QBoxLayout
> 2877695206864  lvl  9:   child 
> 2::LeoQTextBrowser
> 2877793746800  lvl 10: child 
> 0::QWidget
> 2877793746640  lvl 

Re: A Script To Display The Viewrendered3 Pane in the Same Place s The Body

2024-05-13 Thread Edward K. Ream
On Mon, May 13, 2024 at 9:38 AM Thomas wrote:

>> Thomas, your private email on this topic was a Eureka moment for me. I
realized that we Leo devs aren't aware of the hierarchy of Leo's Qt widgets.

> That's an understatement! - at least for me...  It explains why I had so
much trouble discovering when the body editor was created, by whom, and
what frame it is put into.  Your printout is stunningly complex.

Hehe. It took a lot of work to make the printout as simple as it is.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0-vq5e50imdni%2BNESaYscY_%2ByvXfrbn2co-8qs8xLc5Q%40mail.gmail.com.


Re: A Script To Display The Viewrendered3 Pane in the Same Place s The Body

2024-05-13 Thread Thomas Passin

On Monday, May 13, 2024 at 10:00:58 AM UTC-4 Edward K. Ream wrote:

On Sunday, May 12, 2024 at 4:17:19 PM UTC-5 tbp1...@gmail.com wrote:

I have devised a script that can [swap the body and VR3 panes].  You can 
put it into a button for easy activation, or you could make it into a 
command in the Settings tree and bind it to a keystroke. 


Thomas, your private email on this topic was a Eureka moment for me. I 
realized that we Leo devs aren't aware of the hierarchy of Leo's Qt widgets.


That's a understatement! - at least for me...  It explains why I had so 
much trouble discovering when the body editor was created, by whom, and 
what frame it is put into.  Your printout is stunningly complex.
 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/5646e000-c731-4959-8a56-15f62e63be1an%40googlegroups.com.


Re: A Script To Display The Viewrendered3 Pane in the Same Place s The Body

2024-05-13 Thread Edward K. Ream
On Sunday, May 12, 2024 at 4:17:19 PM UTC-5 tbp1...@gmail.com wrote:

I have devised a script that can [swap the body and VR3 panes].  You can 
put it into a button for easy activation, or you could make it into a 
command in the Settings tree and bind it to a keystroke. 


Thomas, your private email on this topic was a Eureka moment for me. I 
realized that we Leo devs aren't aware of the hierarchy of Leo's Qt widgets.

The following script helps cure that ignorance:

"""Scripts to discover Leo's Qt Widget hierarchy."""
g.cls()

total = 0

def w_name(w):
name = w.objectName() or 'no name'
return f"<{name}>:{ w.__class__.__name__}"

def dump(tag, w, level=0):
global total
total += 1
ws = (level * 2) * ' '
print(f"{id(w):<14} lvl {level:2}: {ws}{tag}:{w_name(w)}")

def dump_children(w, level=0):
if 1:  # Specify wanted classes...
wanted = (
'DynamicWindow', 'Frame', 'Layout',
'Splitter', 'Stacked', 'Text', 'Widget')
children = [z for z in w.children()
if any (z2 in z.__class__.__name__ for z2 in wanted)]
else:  # Specifiy unwanted classes...
ignore = ('action', 'animation', 'menu')
children = [z for z in w.children()
if not any (z2 in z.__class__.__name__.lower() for z2 in 
ignore)]
if children:
for i, child in enumerate(children):
dump(f"child {i}", child, level + 1)
dump_children(child, level + 1)

def full_dump(tag, w, level=0):
print('')
print(f"Full dump of {w_name(w)} at {id(w)}...\n")
dump(tag, w)
dump_children(w)

if 1:
full_dump('c.frame.top.parent()', c.frame.top.parent())
else:
flc = c.free_layout  # free layout controller
top_splitter = flc.get_top_splitter()
dump('c.frame.top.parent()', c.frame.top.parent())
dump('c.frame.top', c.frame.top)
full_dump('top_splitter', top_splitter)

print('')
print(f"total objects: {total}")

And here is the output:

Full dump of :QStackedWidget at 2877793745520...

2877793745520  lvl  0: 
c.frame.top.parent()::QStackedWidget
2877793745840  lvl  1:   child 0::QStackedLayout
2877687572080  lvl  1:   child 1::DynamicWindow
2877793745200  lvl  2: child 0:<_layout>:QLayout
2877687572560  lvl  2: child 1::QWidget
2877687572880  lvl  3:   child 0::QVBoxLayout
2877687573040  lvl  3:   child 1::NestedSplitter
2877793731920  lvl  4: child 0::NestedSplitter
2877692019248  lvl  5:   child 0::QFrame
2877692019408  lvl  6: child 0::QFrame
2877692019728  lvl  7:   child 
0::QStackedWidget
2877793746480  lvl  8: child 0::QStackedLayout
2877692019888  lvl  8: child 1::QWidget
2877692020368  lvl  9:   child 
0::LeoQTextBrowser
2877793746320  lvl 10: child 
0::QWidget
2877793746640  lvl 10: child 
1::QWidget
2877793550416  lvl 11:   child 0::QBoxLayout
2877793731440  lvl 10: child 
2::QWidget
2877793746800  lvl 11:   child 0::QBoxLayout
2877692020848  lvl  9:   child 1::QVBoxLayout
2877692021168  lvl  7:   child 1::QGridLayout
2877692021008  lvl  6: child 1::QGridLayout
2877793732080  lvl  5:   child 
1::NestedSplitterHandle
2877692019568  lvl  5:   child 
2::NestedSplitterHandle
2877687573200  lvl  4: child 1::NestedSplitter
2877687574640  lvl  5:   child 0::QFrame
2877687574800  lvl  6: child 0::QFrame
2877687575120  lvl  7:   child 0::QTabWidget
2877793746480  lvl  8: child 
0::QStackedWidget
2877793731440  lvl  9:   child 0::QStackedLayout
2877687575920  lvl  9:   child 1::QWidget
2877687576080  lvl 10: child 
0::QVBoxLayout
2877687576240  lvl 10: child 1::QFrame
2877687576400  lvl 11:   child 
0::QVBoxLayout
2877687576560  lvl 12: child 
0::QGridLayout
2877692018768  lvl 11:   child 
1::QListWidget
2877793746320  lvl 12: child 
0::QWidget
2877793746640  lvl 12: child 
1::QWidget
2877793743600  lvl 13:   child 0::QBoxLayout
2877793746800  lvl 12: child 
2::QWidget
2877793743920  lvl 13:   child 0::QBoxLayout
2877695206864  lvl  9:   child 
2::LeoQTextBrowser
2877793746800  lvl 10: child 
0::QWidget
2877793746640  lvl 10: child 
1::QWidget
2877793746320  lvl 11:   child 0::QBoxLayout
2877793743920  lvl 10: child 
2::QWidget
2877793746320  lvl 11:   child 0::QBoxLayout
2877687575280  lvl  7:   child 1::QGridLayout
2877687575440  lvl  6: child 1::QGridLayout
2877687573360  

Re: A Script To Display The Viewrendered3 Pane in the Same Place s The Body

2024-05-13 Thread Thomas Passin
Thank you, Lewis, much appreciated!

I'll be posting an improved version of the script later today. I've already 
added it as a vr3- command and button to my own MyLeoSettings.leo outline.

On Monday, May 13, 2024 at 3:31:23 AM UTC-4 lewis wrote:

> Thomas,
> Thanks for the script. I really appreciate the effort you have put into 
> improving the VR3 functionality.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/266124b7-63d0-4bd6-8f9b-b0a44ed17bc2n%40googlegroups.com.


Re: A Script To Display The Viewrendered3 Pane in the Same Place s The Body

2024-05-13 Thread lewis
Thomas,
Thanks for the script. I really appreciate the effort you have put into 
improving the VR3 functionality.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/52a6-7adf-449e-a8d5-e86760d97b9fn%40googlegroups.com.