Skip to content

Commit c1572a4

Browse files
committed
Add depth parameter setting to ISOSR
Replacing ls command by find Signed-off-by: imakiro <[email protected]>
1 parent 8ca9de0 commit c1572a4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/ISOSR.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _loadvdis(self):
119119
return
120120

121121
for name in filter(is_image_utf8_compatible,
122-
util.listdir(self.path, quiet = True)):
122+
util.listdir(self.path, quiet = True, depth=10)):
123123
fileName = self.path + "/" + name
124124
if os.path.isdir(fileName):
125125
util.SMlog("_loadvdis : %s is a directory. Ignore" % fileName)

drivers/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ def pread3(cmdlist, text):
208208
SMlog(" pread3 SUCCESS")
209209
return stdout
210210

211-
def listdir(path, quiet = False):
212-
cmd = ["ls", path, "-1", "--color=never"]
211+
def listdir(path, quiet=False, depth=1):
212+
cmd = ["find", path, "-maxdepth", str(depth)]
213213
try:
214214
text = pread2(cmd, quiet = quiet)[:-1]
215215
if len(text) == 0:

0 commit comments

Comments
 (0)