| 11 | |
| 12 | # Find files with extension in path |
| 13 | def findfiles(path, find_ext): |
| 14 | def sorter(f1, f2): |
| 15 | f1 = f1[0].replace(path, "") |
| 16 | f2 = f2[0].replace(path, "") |
| 17 | if f1 == "": |
| 18 | return 1 |
| 19 | elif f2 == "": |
| 20 | return -1 |
| 21 | else: |
| 22 | return helper.cmp(f1.lower(), f2.lower()) |
| 23 | |
| 24 | for root, dirs, files in sorted(os.walk(path, topdown=False), key=functools.cmp_to_key(sorter)): |
| 25 | for file in sorted(files): |
| 26 | file_path = root + "/" + file |
| 27 | file_ext = file.split(".")[-1] |
| 28 | if file_ext in find_ext and not file.startswith("all."): |
| 29 | yield file_path.replace("\\", "/") |
| 30 | |
| 31 | |
| 32 | # Try to find coffeescript compiler in path |