From 081eca085c318eaaa3816bb4c2cda56232ce7b04 Mon Sep 17 00:00:00 2001 From: rlbr Date: Sun, 30 Sep 2018 19:25:29 -0500 Subject: [PATCH] util.py with filter to not include subdirs --- util.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 util.py 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