Re: Discuss: what should path expressions contain?

2024-01-10 Thread jkn
Yes, I ended up with

@path ${NEXTCLOUD}/dir1/dir2
@file myfile.txt

(I prefer using ${NEXTCLOUD} to $NEXTCLOUD, but that is a very minor point)

one thing I note is that leo says eg:

wrote file myfile.txt

where I would prefer it wrote the full path.

I now seem to have quite a few files scattered around called 
"{{g.app.homedir}}{{sep}}"...

J^n



On Wednesday, January 10, 2024 at 4:49:37 PM UTC tbp1...@gmail.com wrote:

> I just did some testing on Windows, and with an @file node Leo acts as if 
> the os.path functions expanduser() and expandvars() are applied, as well as 
> the  abspath() that would be expected (and probably realpath() but I didn't 
> check that).  This means that you can set an environmental variable, say 
> VAR, and use it in the path expression as $VAR.  I didn't find any 
> variables that seem to have been added by Leo.
>
> I didn't find where in LeoPyRef.leo this all happens.
>
> On Wednesday, January 10, 2024 at 9:53:06 AM UTC-5 jkn wrote:
>
>> On Wednesday, January 10, 2024 at 1:00:58 PM UTC tbp1...@gmail.com wrote:
>>
>> Edward made some changes during this thread, IIRC.
>>
>>
>> Yes ... I was trying to track the end results of this.
>>
>> The description of {{sep}} etc. used to be on the leoeditor.com 
>> documentation,
>> but no longer seems to be there.
>> A short 'migration guide' paragraph would be useful, it was not clear to 
>> me
>> that my nodes with this style of directives need to be changed.
>>  
>>
>> On Wednesday, January 10, 2024 at 5:21:22 AM UTC-5 Edward K. Ream wrote:
>>
>> On Tue, Jan 9, 2024 at 1:14 PM jkn  wrote:
>>
>> did the work that got done here ever get documented? 
>>
>>
>> Luke, use the find command!
>>
>> Searching LeoDocs.leo for "path expression" yields these items from the 
>> 6.1 release notes:
>>
>> - #1338 : 
>> g.getUrlFromNode must not expand path expressions.
>> - #1341 : 
>> Expansion of path expressions should be strictly limited.
>>
>> My only memory of these issues is that path expressions *must not* 
>> execute arbitrary code!
>>
>> It looks like the fixes happened before Leo started using PRs, so it's 
>> much harder to pinpoint the actual changes.
>>
>> 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/c190db36-761b-4fb6-b3ac-48de442fc9bfn%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-10 Thread Thomas Passin
I just did some testing on Windows, and with an @file node Leo acts as if 
the os.path functions expanduser() and expandvars() are applied, as well as 
the  abspath() that would be expected (and probably realpath() but I didn't 
check that).  This means that you can set an environmental variable, say 
VAR, and use it in the path expression as $VAR.  I didn't find any 
variables that seem to have been added by Leo.

I didn't find where in LeoPyRef.leo this all happens.

On Wednesday, January 10, 2024 at 9:53:06 AM UTC-5 jkn wrote:

> On Wednesday, January 10, 2024 at 1:00:58 PM UTC tbp1...@gmail.com wrote:
>
> Edward made some changes during this thread, IIRC.
>
>
> Yes ... I was trying to track the end results of this.
>
> The description of {{sep}} etc. used to be on the leoeditor.com 
> documentation,
> but no longer seems to be there.
> A short 'migration guide' paragraph would be useful, it was not clear to me
> that my nodes with this style of directives need to be changed.
>  
>
> On Wednesday, January 10, 2024 at 5:21:22 AM UTC-5 Edward K. Ream wrote:
>
> On Tue, Jan 9, 2024 at 1:14 PM jkn  wrote:
>
> did the work that got done here ever get documented? 
>
>
> Luke, use the find command!
>
> Searching LeoDocs.leo for "path expression" yields these items from the 
> 6.1 release notes:
>
> - #1338 : 
> g.getUrlFromNode must not expand path expressions.
> - #1341 : Expansion 
> of path expressions should be strictly limited.
>
> My only memory of these issues is that path expressions *must not* 
> execute arbitrary code!
>
> It looks like the fixes happened before Leo started using PRs, so it's 
> much harder to pinpoint the actual changes.
>
> 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/55ed6e19-b92d-4cfb-ac1b-d67988129f6fn%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-10 Thread jkn


On Wednesday, January 10, 2024 at 1:00:58 PM UTC tbp1...@gmail.com wrote:

Edward made some changes during this thread, IIRC.


Yes ... I was trying to track the end results of this.

The description of {{sep}} etc. used to be on the leoeditor.com 
documentation,
but no longer seems to be there.
A short 'migration guide' paragraph would be useful, it was not clear to me
that my nodes with this style of directives need to be changed.
 

On Wednesday, January 10, 2024 at 5:21:22 AM UTC-5 Edward K. Ream wrote:

On Tue, Jan 9, 2024 at 1:14 PM jkn  wrote:

did the work that got done here ever get documented? 


Luke, use the find command!

Searching LeoDocs.leo for "path expression" yields these items from the 6.1 
release notes:

- #1338 : 
g.getUrlFromNode must not expand path expressions.
- #1341 : Expansion 
of path expressions should be strictly limited.

My only memory of these issues is that path expressions *must not* execute 
arbitrary code!

It looks like the fixes happened before Leo started using PRs, so it's much 
harder to pinpoint the actual changes.

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/84bbc53b-d0a1-4add-abae-a2d30587b9d2n%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-10 Thread Thomas Passin
Edward made some changes during this thread, IIRC.

On Wednesday, January 10, 2024 at 5:21:22 AM UTC-5 Edward K. Ream wrote:

> On Tue, Jan 9, 2024 at 1:14 PM jkn  wrote:
>
>> did the work that got done here ever get documented? 
>>
>
> Luke, use the find command!
>
> Searching LeoDocs.leo for "path expression" yields these items from the 
> 6.1 release notes:
>
> - #1338 : 
> g.getUrlFromNode must not expand path expressions.
> - #1341 : Expansion 
> of path expressions should be strictly limited.
>
> My only memory of these issues is that path expressions *must not* 
> execute arbitrary code!
>
> It looks like the fixes happened before Leo started using PRs, so it's 
> much harder to pinpoint the actual changes.
>
> 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/41eab2db-58d4-4e61-990c-03d02509498dn%40googlegroups.com.


Re: Discuss: what should path expressions contain?

2024-01-10 Thread Edward K. Ream
On Tue, Jan 9, 2024 at 1:14 PM jkn  wrote:

> did the work that got done here ever get documented?
>

Luke, use the find command!

Searching LeoDocs.leo for "path expression" yields these items from the 6.1
release notes:

- #1338 :
g.getUrlFromNode must not expand path expressions.
- #1341 : Expansion
of path expressions should be strictly limited.

My only memory of these issues is that path expressions *must not* execute
arbitrary code!

It looks like the fixes happened before Leo started using PRs, so it's much
harder to pinpoint the actual changes.

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