Re: About PR #3828: Require Qt6.6+

2024-03-24 Thread Edward K. Ream
On Sun, Mar 24, 2024 at 7:53 AM Thomas Passin  wrote:

> Every one of my fleet of Linux VMs has finally got PyQt 6.6, so that's
> favorable. No one can prove that *every* distro will have it - there are
> just too many variations - but so be it.  I don't know about ARM versions
> and don't have a way to check, but I suppose they are still not a likely
> host for Leo.
>

Thanks for your comment.  Leo 6.7.9 is scheduled for August 15. There will
be plenty of time for discussion and testing.

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/CAMF8tS0tbpf01sNac_1%2BYVkjmpW7ymXWLzetRE0iOgD%2BmH8vkw%40mail.gmail.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
I think the fact that (recently discovered) ... there seems to be no method 
getPath() in LeoConfig.py  tells us something.

Not trying to make a big deal of this, mind you...

On Sunday, March 24, 2024 at 12:48:13 PM UTC tbp1...@gmail.com wrote:

> It's still a good question, though.  Is there an actual use for a setting 
> of type "@path"?Having it included in that documentation section seems 
> to imply that there is, though its inclusion may have been meant only as a 
> syntax example. Can anyone resolve this?
>
> On Sunday, March 24, 2024 at 8:24:47 AM UTC-4 Edward K. Ream wrote:
>
>> On Sun, Mar 24, 2024 at 7:01 AM Thomas Passin  wrote:
>>
>>> Settings and headlines are not the same.
>>>
>>
>> At last I understand :-)  As Thomas says, the syntax for settings nodes 
>> is different from directives.
>>
>> In other words, Leo's documentation appears to be correct.
>>
>> 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/1d17bf22-ee22-4c89-a1d3-bc35c0c78df0n%40googlegroups.com.


Re: About PR #3828: Require Qt6.6+

2024-03-24 Thread Thomas Passin
Every one of my fleet of Linux VMs has finally got PyQt 6.6, so that's 
favorable. No one can prove that *every* distro will have it - there are 
just too many variations - but so be it.  I don't know about ARM versions 
and don't have a way to check, but I suppose they are still not a likely 
host for Leo.

On Sunday, March 24, 2024 at 8:17:29 AM UTC-4 Edward K. Ream wrote:

> I am now working on PR #3828 
> : require Qt 6.6+. 
> This PR is experimental and possibly controversial.
>
>
> *The good news*
>
>
> - leoQt.py contains no conditional imports. 
>
> - leoQt.py defines all constants unambiguously.
>
> - No Qt-related switches exist*.* Hurray! Removing these switches 
> (especially isQt5 and isQt6) simplifies code throughout Leo.
>
>
> *The controversial news*
>
>
> Four Qt modules no longer exist in Qt6: *phonon*, *QtDeclarative*, 
> *QtWebKit*, and *QtWebKitWidgets*. As a result, I have retired five of 
> Terry Brown's plugins. There is no obvious way to make these plugins work 
> with Qt6. 
>
>
> *Summary*
>
>
> PR #3828  removes all 
> vestiges of Qt5 from Leo's codebase. Now is probably a good time to move to 
> Qt6. Leo 6.7.8 installs only Qt6 without anyone complaining :-)
>
>
> A one-line change to requirements.txt installs all necessary Qt6 modules. 
> There is no need for conditional code in leoQt.py.
>
>
> Five plugins are incompatible with Qt6 and have been retired to the attic: 
> *notebook.py*, *richtext.py*, and three "editpane" plugins: 
> *pandownview.py*, *webengineview.py*, and *webkitview.py*. These plugins 
> are no great loss. They do not work with the typical installation of Leo 
> 6.7.8.
>
>
> Please tell me what you think.
>
>
> 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/43c0e3d7-615b-42a7-91e0-3153986d9cd7n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread Thomas Passin
It's still a good question, though.  Is there an actual use for a setting 
of type "@path"?Having it included in that documentation section seems 
to imply that there is, though its inclusion may have been meant only as a 
syntax example. Can anyone resolve this?

On Sunday, March 24, 2024 at 8:24:47 AM UTC-4 Edward K. Ream wrote:

> On Sun, Mar 24, 2024 at 7:01 AM Thomas Passin  wrote:
>
>> Settings and headlines are not the same.
>>
>
> At last I understand :-)  As Thomas says, the syntax for settings nodes is 
> different from directives.
>
> In other words, Leo's documentation appears to be correct.
>
> 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/68e70299-1e4a-45eb-b7b2-31aa9bced5can%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread Edward K. Ream
On Sun, Mar 24, 2024 at 7:01 AM Thomas Passin  wrote:

> Settings and headlines are not the same.
>

At last I understand :-)  As Thomas says, the syntax for settings nodes is
different from directives.

In other words, Leo's documentation appears to be correct.

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/CAMF8tS3gXC%3DtHpJPM9%3D%2B7MNSwALweS0mxOHYh7fXCTi_o-TjKw%40mail.gmail.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
I see what you mean... yes, I conflated the two (a site search for '@path' 
got me to the link I mentioned, and not to the canonical documentation 
Edward pointed out)

In that case, can someone give me an example of the use for

@settings
@path mypath = path/to/...

?
Thanks, J^n


On Sunday, March 24, 2024 at 12:01:40 PM UTC tbp1...@gmail.com wrote:

> Settings and headlines are not the same.
>
> On Sunday, March 24, 2024 at 6:39:03 AM UTC-4 jkn wrote:
>
>> Hi Edward
>> I put the link (to a different part of the documentation) in an earlier 
>> post: 
>> https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes
>>
>> The section you reference is clear, and correct. The link above perhaps 
>> references an older syntax?
>>
>> Regards, J^n
>>
>>
>> On Sunday, March 24, 2024 at 10:27:45 AM UTC Edward K. Ream wrote:
>>
>>> On Sun, Mar 24, 2024 at 4:20 AM jkn  wrote:
>>>

 I am commenting on the fact that the documentation says that an @path 
 directive (and all the others in the table below) takes the form

 @path **=** my/path

 whereas in fact no equals sign is necessary (any might well cause an 
 error?)

 @path  my/path

>>>
>>> I see no equal sign in Leo's directive reference 
>>>  page. What 
>>> documentation are you talking about?
>>>
>>> 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/11753fae-a031-482b-90f5-a2c90440139cn%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread Edward K. Ream
On Sun, Mar 24, 2024 at 5:39 AM jkn  wrote:

I put the link (to a different part of the documentation) in an earlier
> post:
> https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes
>

Thanks. I'll take a look.

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/CAMF8tS3%2Bv9Hva5mJjH4A_77QWxLcH9whobwSMo0k4M9ASPEaiA%40mail.gmail.com.


About PR #3828: Require Qt6.6+

2024-03-24 Thread Edward K. Ream
 

I am now working on PR #3828 
: require Qt 6.6+. This 
PR is experimental and possibly controversial.


*The good news*


- leoQt.py contains no conditional imports. 

- leoQt.py defines all constants unambiguously.

- No Qt-related switches exist*.* Hurray! Removing these switches 
(especially isQt5 and isQt6) simplifies code throughout Leo.


*The controversial news*


Four Qt modules no longer exist in Qt6: *phonon*, *QtDeclarative*, 
*QtWebKit*, and *QtWebKitWidgets*. As a result, I have retired five of 
Terry Brown's plugins. There is no obvious way to make these plugins work 
with Qt6. 


*Summary*


PR #3828  removes all 
vestiges of Qt5 from Leo's codebase. Now is probably a good time to move to 
Qt6. Leo 6.7.8 installs only Qt6 without anyone complaining :-)


A one-line change to requirements.txt installs all necessary Qt6 modules. 
There is no need for conditional code in leoQt.py.


Five plugins are incompatible with Qt6 and have been retired to the attic: 
*notebook.py*, *richtext.py*, and three "editpane" plugins: *pandownview.py*
, *webengineview.py*, and *webkitview.py*. These plugins are no great loss. 
They do not work with the typical installation of Leo 6.7.8.


Please tell me what you think.


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/5cd63b5c-a546-4858-8c51-4c728acb8fc0n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread Thomas Passin
Settings and headlines are not the same.

On Sunday, March 24, 2024 at 6:39:03 AM UTC-4 jkn wrote:

> Hi Edward
> I put the link (to a different part of the documentation) in an earlier 
> post: 
> https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes
>
> The section you reference is clear, and correct. The link above perhaps 
> references an older syntax?
>
> Regards, J^n
>
>
> On Sunday, March 24, 2024 at 10:27:45 AM UTC Edward K. Ream wrote:
>
>> On Sun, Mar 24, 2024 at 4:20 AM jkn  wrote:
>>
>>>
>>> I am commenting on the fact that the documentation says that an @path 
>>> directive (and all the others in the table below) takes the form
>>>
>>> @path **=** my/path
>>>
>>> whereas in fact no equals sign is necessary (any might well cause an 
>>> error?)
>>>
>>> @path  my/path
>>>
>>
>> I see no equal sign in Leo's directive reference 
>>  page. What 
>> documentation are you talking about?
>>
>> 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/c367b9f6-6c96-4a8d-8e49-173d4f9f5c3an%40googlegroups.com.


Two PRs merged into devel

2024-03-24 Thread Edward K. Ream
 

Leo's "devel" branch now contains two significant PRs:


PR #3838  updates 
developer scripts that build and test Leo. The (newly revised) info issue 
#2867  lists these 
scripts. All these scripts are now Python scripts. How did we ever live 
without them?


PR #3838  improves the 
annotations in leoTokens.py (Leo's beautifier) so that mypyc  
can compile it.  My tests show the compiled 
version is about twice as fast as the pure Python version. Compiling 
leoTokens.py is *optional:*


cd leo-editor

python -m mypyc leo/core/leoTokens.py --strict-optional


*Summary*


- PR #3838  helps all 
developers test their code.

- PR #3838  doubles the 
speed of Leo's beautifier.


Both PRs change Leo's codebase significantly. Please report any problems.


All questions and comments are welcome. 


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/824fd215-e770-4056-8f6d-69a42f553763n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
Hi Edward
I put the link (to a different part of the documentation) in an earlier 
post: 
https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes

The section you reference is clear, and correct. The link above perhaps 
references an older syntax?

Regards, J^n


On Sunday, March 24, 2024 at 10:27:45 AM UTC Edward K. Ream wrote:

> On Sun, Mar 24, 2024 at 4:20 AM jkn  wrote:
>
>>
>> I am commenting on the fact that the documentation says that an @path 
>> directive (and all the others in the table below) takes the form
>>
>> @path **=** my/path
>>
>> whereas in fact no equals sign is necessary (any might well cause an 
>> error?)
>>
>> @path  my/path
>>
>
> I see no equal sign in Leo's directive reference 
>  page. What 
> documentation are you talking about?
>
> 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/4be91dbc-8f22-4be4-89ea-5f4c7c397da1n%40googlegroups.com.


Re: A Script To Insert An Image

2024-03-24 Thread Edward K. Ream
On Sun, Mar 24, 2024 at 4:20 AM jkn  wrote:

>
> I am commenting on the fact that the documentation says that an @path
> directive (and all the others in the table below) takes the form
>
> @path **=** my/path
>
> whereas in fact no equals sign is necessary (any might well cause an
> error?)
>
> @path  my/path
>

I see no equal sign in Leo's directive reference
 page. What
documentation are you talking about?

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/CAMF8tS297bxSY9XwLpyRsBLdGeOfz47mA2JfqtOKNaUw3X6cKA%40mail.gmail.com.


Re: A Script To Insert An Image

2024-03-24 Thread jkn
That's not what I am commenting on - I'm well aware of all of that.

I am commenting on the fact that the documentation says that an @path 
directive (and all the others in the table below) takes the form

@path **=** my/path

whereas in fact no equals sign is necessary (any might well cause an error?)

@path  my/path




On Sunday, March 24, 2024 at 4:10:38 AM UTC tbp1...@gmail.com wrote:

> *@path* headlines must be like this: @path c:/test/python. Use forward 
> slashes even on Windows. The pathlib methods will use forward slashes and 
> output whatever is right for the OS.
>
> On Saturday, March 23, 2024 at 7:14:14 PM UTC-4 jkn wrote:
>
>> BTW [Edward], isn't this documentation, from 
>> https://leo-editor.github.io/leo-editor/customizing.html#simple-settings-nodes,
>>  
>> incorrect - or am I misunderstanding something?
>>
>> """
>> Simple settings nodes have headlines of the form @ name = val. 
>> These settings set the value of name to val, with the indicated type:
>> """
>> ISTM that the headlines are of the form
>>
>> @type val
>>
>> or can you actually write
>>
>> @path = 
>>
>> etc? I can find no examples of this...
>>
>> On Saturday, March 23, 2024 at 10:55:16 PM UTC jkn wrote:
>>
>>> I think I have an earlier version of this snippet from you somewhere - I 
>>> was going to take a look at it for this purpose. So thanks!
>>>
>>> J^n
>>>
>>>
>>> On Saturday, March 23, 2024 at 10:42:32 PM UTC tbp1...@gmail.com wrote:
>>>
 I've been using an "images" subdirectory under the location of the 
 outline, or under the @path location if you use one.  It would make backup 
 or sharing easier than some random location in the file system.  The 
 script 
 could check for its existence and create it if needed.  

 Here's how I get the path of the node or it's @path into the clipboard:

 """Copy the effective path of the current node to the clipboard.

 This command honors @path directives.
 """
 from pathlib import Path

 pth = Path(c.fullPath(p))
 if pth.exists():
 if pth.is_file():
 direc = pth.parent
 else:
 direc = pth
 else:
 direc = Path(g.scanAllAtPathDirectives(c, p))

 if direc:
 normdir = str(direc.resolve())
 g.app.gui.replaceClipboardWith(normdir)
 else:
 g.es(f"Path {direc} doesn't exist")

 BTW, I have this script linked to a button, which is very convenient 
 sometimes.
 On Saturday, March 23, 2024 at 6:30:21 PM UTC-4 jkn wrote:

> Hi Thomas
> not sure what an undoer would do here? maybe delete the file? 
> There is no leo-relevant action here (yet)
>
> I'm well aware I don't *need* the main(), but I prefer to write this 
> way. Same as with bash scripts etc. It helps for future modularity, I 
> find. 
> Of course, 'YAGNI', but still. f course you are right that main() could 
> be 
> more descriptive, this is only a POC.
>
> The tricky bit is deciding where to store the clipboard files. 
> Obsidian has a special action when you click on inserted 'snippet' 
> images; 
> it just stores the filename in the 'body', and uses its knowledge of 
> where 
> the snippets are located when you do the equivalent of CTRL-click on the 
> URL
>
> Linking the location of the 'snippets' to the leo file and/or node is 
> an interesting challenge...
>
>
>
> On Saturday, March 23, 2024 at 10:09:59 PM UTC tbp1...@gmail.com 
> wrote:
>
>> Looks pretty straightforward.  Perhaps you'll want to make it 
>> undoable (so far as Leo is concerned).  As a matter of Python 
>> programming, 
>> defining a main() function here isn't needed.  If you are only going to 
>> use 
>> it as a script, then you don't need a function at all. Just unindent 
>> those 
>> lines of code (and delete the "main()" line) and they will run when the 
>> script runs.  No need to call main() at all.   If you want that 
>> clipboard 
>> part of the block to run and if it succeeds then insert the markdown 
>> text 
>> into a node, then the function shouldn't be called "main" but something 
>> more descriptive.
>>
>> On Saturday, March 23, 2024 at 4:59:25 PM UTC-4 jkn wrote:
>>
>>> OK, here is a simple demonstration of part of the feature I am 
>>> interested in.
>>>
>>> When run with an image in the (global) clipboard, it saves this to a 
>>> local timestamped file (under ~/tmp), and indicates how a markdown 
>>> reference to that file could be inserted.
>>>
>>> There's plenty more needed but this is the QClipboard part, I think.
>>>
>>> import os
>>> import time
>>> 
>>> def unique_png_fname():
>>> """ return a unique (timestamped) filename to use
>>> """
>>> FORMAT="%Y-%m-%d-%H-%M-%S.png"
>>> return