이미지를 가지고 있는 폴더도 소스리스트에 추가할 수 있게 함.
This commit is contained in:
10
UtilPack.py
10
UtilPack.py
@@ -80,14 +80,18 @@ def ListContainFiles(pathDir):
|
||||
|
||||
return listRet
|
||||
|
||||
def ListFileExtRcr(pathTrg, strExt):
|
||||
def ListFileExtRcr(pathTrg, listExt):
|
||||
listRet= []
|
||||
|
||||
if False == isinstance(listExt, list):
|
||||
print("ext must list")
|
||||
return
|
||||
|
||||
# pathTrg의 하위 디렉토리 및 파일 목록을 얻음
|
||||
for dirpath, dirnames, filenames in os.walk(pathTrg):
|
||||
for file in filenames:
|
||||
extTmp = GetExtStr(file, False)
|
||||
if extTmp.lower() == strExt and file.startswith('.'):
|
||||
extTmp = GetExtStr(file)
|
||||
if extTmp.lower() in listExt and not file.startswith('.'):
|
||||
listRet.append(os.path.join(dirpath, file))
|
||||
|
||||
return listRet
|
||||
|
||||
Reference in New Issue
Block a user