On Fri, Apr 30, 2021 at 3:26 PM [email protected] <[email protected]>
wrote:

> *g.fullPath* is a really good method.


Indeed. The latest rev (4726839) eliminates several faux-helper methods and
several kwargs. I am going to continue eliminating kwargs in leoAtFile.py.

I could wish that it would return a directory instead of None when the path
> is to a directory instead of a file, but I suppose that would break some
> things that use it.  It could have a new *returnDir=False* argument, so
> that nothing downstream get broken.
>

The test for p.isAnyAtFileNode is an integral part of g.fullPath. Changing
the meaning of g.fullPath with a kwarg would not be wise.

If you don't care whether there is an @<file node> in p or p's ancestors,
you could do something like this:

aList = g.get_directives_dict_list(p)
path = c.scanAtPathDirectives(aList)

c.scanAtPathDirective handles many details like expanding user expressions
and "~". This *might* be simpler than your script.

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS39WegrrQNpXSnera9ndg4B444m0V0N07_Nviuougq%3DSQ%40mail.gmail.com.

Reply via email to