On Sunday, August 27, 2023 at 5:44:23 AM UTC-5 Edward K. Ream wrote:

> Oops: The generated @path directives will be *wrong* unless dir_ is 
either the outline directory or a subdirectory. Let's call this the *directory 
constraint*.


*os.path.relpath *works in all common situations. The output from this test 
script:


from os.path import relpath
    
for sep in '\\', '/':
    base = fr'C:{sep}Users{sep}Dev'
    path = fr"C:{sep}Repos{sep}leo-editor"
    print('base:', base)
    print('path:', path)
    print('relpath', relpath(path, base))
    print('')


is:


base: C:\Users\Dev
path: C:\Repos\leo-editor
relpath ..\..\Repos\leo-editor

base: C:/Users/Dev
path: C:/Repos/leo-editor
relpath ..\..\Repos\leo-editor


I'm not sure recursive imports should allow such "distant" @path directives.


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/0b8a97a6-df40-46e1-9bf2-0b2fb9783d69n%40googlegroups.com.

Reply via email to