except IOError:
pass
+ def __repr__(self):
+ return "<Directory %s>" % self.rel_path
+
files = {}
current_file = None
self.contents = "".join(txt)
+ def __repr__(self):
+ return "<File %s>" % self.rel_path
+
_get_file_for_cache = {}
def get_file_for(name):
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