diff options
| author | [email protected] <[email protected]> | 2011-12-10 13:14:26 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-12-10 13:14:26 +0000 |
| commit | 6bd0252e260f63243ec40f57bb42bdb0c3af1055 (patch) | |
| tree | 21d1f8123d62b0d60176f546a21910837c52a820 /tools | |
| parent | 57e2947cfc180e3b098c0d161bd9fdbdcf0218c0 (diff) | |
update SrcRemove function in building script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1830 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/building.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/building.py b/tools/building.py index 53f6ce2de4..ef77d7760f 100644 --- a/tools/building.py +++ b/tools/building.py @@ -609,13 +609,14 @@ def EndBuilding(target): if GetOption('target') == 'iar': IARProject('project.ewp', Projects) -import copy + def SrcRemove(src, remove): - src_tmp = copy.copy(src) - count = 0 - for i in range(0, len(src_tmp)): - s = os.path.basename(str(src_tmp[i])) - if s in remove: - src.pop(i-count) - count = count + 1 - return src
\ No newline at end of file + if type(src[0]) == type('str'): + for item in src: + if os.path.basename(item) in remove: + src.remove(item) + return + + for item in src: + if os.path.basename(item.rstr()) in remove: + src.remove(item) |
