From 6c063fd1878b18c4689eb07374667385a2c12868 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 7 Nov 2021 18:59:02 -0800 Subject: [PATCH] Add listdir_files, listdir_directories. --- voussoirkit/pathclass.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/voussoirkit/pathclass.py b/voussoirkit/pathclass.py index 7a868c4..604ce7c 100644 --- a/voussoirkit/pathclass.py +++ b/voussoirkit/pathclass.py @@ -271,6 +271,12 @@ class Path: children = [self.join(child, _case_correct=self._case_correct) for child in children] return children + def listdir_directories(self): + return [p for p in self.listdir() if p.is_dir] + + def listdir_files(self): + return [p for p in self.listdir() if p.is_file] + def makedirs(self, mode=0o777, exist_ok=False): return os.makedirs(self.absolute_path, mode=mode, exist_ok=exist_ok)