the other jimmy / mbed-sdk-tools

Fork of mbed-sdk-tools by mbed official

Committer:
The Other Jimmy
Date:
Wed Jan 04 11:58:24 2017 -0600
Revision:
31:182518299918
Update tools to follow mbed-os tools release 5.3.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
The Other Jimmy 31:182518299918 1 from os import walk
The Other Jimmy 31:182518299918 2 from os.path import join, abspath, dirname, basename, splitext
The Other Jimmy 31:182518299918 3 import sys
The Other Jimmy 31:182518299918 4
The Other Jimmy 31:182518299918 5 ROOT = abspath(join(dirname(__file__), "..", ".."))
The Other Jimmy 31:182518299918 6 sys.path.insert(0, ROOT)
The Other Jimmy 31:182518299918 7
The Other Jimmy 31:182518299918 8 from tools.toolchains.gcc import GCC_ARM
The Other Jimmy 31:182518299918 9 from tools.targets import TARGET_MAP
The Other Jimmy 31:182518299918 10 from argparse import ArgumentParser
The Other Jimmy 31:182518299918 11
The Other Jimmy 31:182518299918 12 if __name__ == "__main__":
The Other Jimmy 31:182518299918 13 parser = ArgumentParser("Find duplicate file names within a directory structure")
The Other Jimmy 31:182518299918 14 parser.add_argument("dirs", help="Directories to search for duplicate file names"
The Other Jimmy 31:182518299918 15 , nargs="*")
The Other Jimmy 31:182518299918 16 parser.add_argument("--silent", help="Supress printing of filenames, just return number of duplicates", action="store_true")
The Other Jimmy 31:182518299918 17 args = parser.parse_args()
The Other Jimmy 31:182518299918 18
The Other Jimmy 31:182518299918 19 toolchain = GCC_ARM(TARGET_MAP["K64F"])
The Other Jimmy 31:182518299918 20
The Other Jimmy 31:182518299918 21 resources = sum([toolchain.scan_resources(d) for d in args.dirs], None)
The Other Jimmy 31:182518299918 22
The Other Jimmy 31:182518299918 23 scanned_files = {}
The Other Jimmy 31:182518299918 24
The Other Jimmy 31:182518299918 25 exit(resources.detect_duplicates(toolchain))
The Other Jimmy 31:182518299918 26