def js_file_reader(file_path, use_unicode=True): if hasattr(sublime, 'load_resource'): rel_path = file_path for prefix in [sublime.packages_path(), sublime.installed_packages_path()]: if rel_path.startswith(prefix): rel_path = os.path.join('Packages', rel_path[len(prefix) + 1:]) break rel_path = rel_path.replace('.sublime-package', '') return sublime.load_resource(rel_path) return _js_file_reader(file_path, use_unicode)
def js_file_reader(file_path, use_unicode=True): if hasattr(sublime, 'load_resource'): rel_path = file_path for prefix in [sublime.packages_path(), sublime.installed_packages_path()]: if rel_path.startswith(prefix): rel_path = os.path.join('Packages', rel_path[len(prefix) + 1:]) break rel_path = rel_path.replace('.sublime-package', '') # for Windows we have to replace slashes rel_path = rel_path.replace('\\', '/') return sublime.load_resource(rel_path) return _js_file_reader(file_path, use_unicode)
def js_file_reader(file_path, use_unicode=True): if hasattr(sublime, "load_resource"): rel_path = file_path for prefix in [sublime.packages_path(), sublime.installed_packages_path()]: if rel_path.startswith(prefix): rel_path = os.path.join("Packages", rel_path[len(prefix) + 1 :]) break rel_path = rel_path.replace(".sublime-package", "") # for Windows we have to replace slashes rel_path = rel_path.replace("\\", "/") return sublime.load_resource(rel_path) return _js_file_reader(file_path, use_unicode)