From 7cc241301a8c34624cf4af67fbcd265251ef3782 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Sat, 6 Oct 2012 00:12:38 +0000 Subject: [PATCH] Add GlobSubDir() function in building.py; Fix the import issue in wizard.py. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2320 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- tools/building.py | 13 +++++++++++++ tools/wizard.py | 1 + 2 files changed, 14 insertions(+) diff --git a/tools/building.py b/tools/building.py index 1e14ea87c0..ad449b9884 100644 --- a/tools/building.py +++ b/tools/building.py @@ -328,6 +328,19 @@ def GetVersion(): return '0.%d.%d' % (version, subversion) +def GlobSubDir(sub_dir, ext_name): + import os + import glob + + 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) + return src + def do_copy_file(src, dst): import shutil # check source file diff --git a/tools/wizard.py b/tools/wizard.py index 2d0ed9efe8..ff3eb1dac7 100644 --- a/tools/wizard.py +++ b/tools/wizard.py @@ -27,6 +27,7 @@ Return('group') SConscript_bridge = '''# RT-Thread building script for bridge import os +from building import * cwd = GetCurrentDir() objs = []