From fd9e5232bec91f78ebae069a058e6ecd6d1e8900 Mon Sep 17 00:00:00 2001 From: imakiro Date: Sun, 1 Dec 2019 04:57:21 +0100 Subject: [PATCH] Add depth parameter setting to ISOSR Replacing ls command by find Signed-off-by: imakiro --- drivers/ISOSR.py | 2 +- drivers/util.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ISOSR.py b/drivers/ISOSR.py index eb471e22b..355e4c9ec 100755 --- a/drivers/ISOSR.py +++ b/drivers/ISOSR.py @@ -119,7 +119,7 @@ def _loadvdis(self): return for name in filter(is_image_utf8_compatible, - util.listdir(self.path, quiet = True)): + util.listdir(self.path, quiet = True, depth=10)): fileName = self.path + "/" + name if os.path.isdir(fileName): util.SMlog("_loadvdis : %s is a directory. Ignore" % fileName) diff --git a/drivers/util.py b/drivers/util.py index 888cbdb98..8a9e85b7b 100755 --- a/drivers/util.py +++ b/drivers/util.py @@ -208,8 +208,8 @@ def pread3(cmdlist, text): SMlog(" pread3 SUCCESS") return stdout -def listdir(path, quiet = False): - cmd = ["ls", path, "-1", "--color=never"] +def listdir(path, quiet=False, depth=1): + cmd = ["find", path, "-maxdepth", str(depth)] try: text = pread2(cmd, quiet = quiet)[:-1] if len(text) == 0: