Get dirs and files for paths
This commit is contained in:
parent
d40371752b
commit
fc6e6ee93e
|
@ -4524,6 +4524,16 @@ class Paths(object):
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def files(cls, path, pattern='*'):
|
||||||
|
files = [str(p) for p in Path(path).glob(pattern) if p.is_file()]
|
||||||
|
return files
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def dirs(cls, path):
|
||||||
|
dirs = [str(p) for p in Path(path).iterdir() if p.is_dir()]
|
||||||
|
return dirs
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def walk(cls, path, filters=''):
|
def walk(cls, path, filters=''):
|
||||||
paths = []
|
paths = []
|
||||||
|
|
Loading…
Reference in New Issue