Update GlobSubDir() function.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2321 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
7cc241301a
commit
4cb779d743
|
@ -332,15 +332,22 @@ def GlobSubDir(sub_dir, ext_name):
|
|||
import os
|
||||
import glob
|
||||
|
||||
def glob_source(sub_dir, ext_name):
|
||||
list = os.listdir(sub_dir)
|
||||
src = glob.glob(os.path.join(sub_dir, ext_name))
|
||||
|
||||
for item in list:
|
||||
full_subdir = os.path.join(sub_dir, item)
|
||||
if os.path.isdir(full_subdir):
|
||||
src += GlobSubDir(full_subdir, ext_name)
|
||||
src += glob_source(full_subdir, ext_name)
|
||||
return src
|
||||
|
||||
dst = []
|
||||
src = glob_source(sub_dir, ext_name)
|
||||
for item in src:
|
||||
dst.append(os.path.relpath(item, sub_dir))
|
||||
return dst
|
||||
|
||||
def do_copy_file(src, dst):
|
||||
import shutil
|
||||
# check source file
|
||||
|
|
Loading…
Reference in New Issue