def get_current_file():
return current_file
+@set_function("get_path_to_root")
+def get_path_to_root():
+ rel_path = relpath(directories[current_file.direc].abs_path, directories[''].abs_path)
+ rel_path = os.path.join(rel_path, os.path.split("")[1])
+ if rel_path[-1] == "/":
+ rel_path = rel_path[:-1]
+ return rel_path