Browse Source

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
bernard.xiong 12 years ago
parent
commit
7cc241301a
2 changed files with 14 additions and 0 deletions
  1. 13 0
      tools/building.py
  2. 1 0
      tools/wizard.py

+ 13 - 0
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 

+ 1 - 0
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 = []