Rev 9370 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9370 | Rev 9411 | ||
---|---|---|---|
- | 1 | import shutil |
|
- | 2 | ||
1 | def log(s, end = "\n"): |
3 | def log(s, end = "\n"): |
2 | print(s, end = end, flush = True) |
4 | print(s, end = end, flush = True) |
- | 5 | ||
- | 6 | def require_tools(names): |
|
- | 7 | assert(type(names) == list or type(names) == tuple) |
|
- | 8 | for name in names: |
|
- | 9 | assert(type(name) == str) |
|
- | 10 | ||
- | 11 | not_found = [] |
|
- | 12 | for name in names: |
|
- | 13 | if shutil.which(name) is None: |
|
- | 14 | not_found.append(name) |
|
- | 15 | ||
- | 16 | if len(not_found) != 0: |
|
- | 17 | log("Sorry, I can't find some tools:") |
|
- | 18 | for name in not_found: |
|
- | 19 | print(f"- {name}") |
|
- | 20 | exit(1) |