def relative_to_spp(path):
spp = sublime.packages_path()
spp_real = casedpath(os.path.realpath(spp))
for p in [path, casedpath(os.path.realpath(path))]:
print(('spp_real:v1', spp_real, p))
for sp in [spp, spp_real]:
if p.startswith(sp + os.sep):
return p[len(sp):]
return None
prints:
('spp_real:v1', '/Users/timothee/git_clone/sublime_packages', '/Users/timothee/git_clone/AutomaticPackageReloader/package_reloader.py')
so
relative_to_spp
returns Noneeven though it shouldn't: