diff --git a/util.py b/util.py new file mode 100644 index 0000000..30cba7f --- /dev/null +++ b/util.py @@ -0,0 +1,12 @@ +def pparent(paths): + paths = sorted(paths,key=len) + first = True + ret = [] + while len(paths) > 0: + el1 = old_paths[0] + old_paths = paths[1:] + paths = [] + for path in old_paths: + if not paths.startswith(el1): + paths.insert(0,path) + return ret \ No newline at end of file