def packages_relative_path(path, prefix_packages=True):
"""
Return a Packages-relative version of path with '/' as the path separator.
Sublime Text wants Packages-relative paths used in settings and in the plugin API
to use '/' as the path separator on all platforms. This method converts platform
path separators to '/'. If insert_packages = True, 'Packages' is prefixed to the
converted path.
"""
components = get_path_components(path)
if prefix_packages and components and components[0] != 'Packages':
components.insert(0, 'Packages')
return '/'.join(components)
评论列表
文章目录