On Sat, Apr 8, 2023 at 1:50 PM Thomas Passin <tbp100...@gmail.com> wrote:

1. I don't see any need to use the expression "{{~}}". Just using "~" works
> now.
>

Thomas, you have just opened my eyes. Python should do all the work!

- os.path.expandvars
<https://docs.python.org/3/library/os.path.html#os.path.expandvars>
substitutes environment variables!
- os.path.expanduser
<https://docs.python.org/3/library/os.path.html#os.path.expanduser> handles
per-platform resolution of `~`.
See the links above for details.

As before, any path can be relative to the outline. Just "finalize" the
resulting path using:

os.path.normpath(os.path.join(os.path.dirname(c.fileName()), path))

*Summary*

c.expand_path_expression should let os.path do all the work. No more
security woes.

There is no need for path expressions! Bye-bye {{ and }}. No more Leo-only
conventions.

c.expand_path_expression will collapse.

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/CAMF8tS179BCozd18vNgQ1r5w%3DMWXTmiBNZcKCF-HuDcnq2UQ6w%40mail.gmail.com.

Reply via email to