Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame^] | 1 | #!/usr/bin/python3 |
| 2 | |
| 3 | import os |
| 4 | import re |
| 5 | |
| 6 | path = "../" |
| 7 | pattern = "TODO(sensors):" |
| 8 | foundList = [] |
| 9 | |
| 10 | for r,d,f in os.walk(path): |
| 11 | for files in f: |
| 12 | try: |
| 13 | for n,line in enumerate(open(os.path.join(r,files))): |
| 14 | if (pattern in line) and ("checker.py" not in files): |
| 15 | comment = line |
| 16 | comment = comment.replace(pattern, '') |
| 17 | comment = comment.replace('//', '') |
| 18 | comment = comment.strip() |
| 19 | foundList.append("In file %s at line %d: %s" %(files, n+1, comment)) |
| 20 | except (UnicodeDecodeError): |
| 21 | pass |
| 22 | if len(foundList) != 0: |
| 23 | print ("Found " + str(len(foundList)) + " arbitrary values that need to be found manually.\n") |
| 24 | print("Fix these values before running this code on a robot:") |
| 25 | for str in foundList: |
| 26 | print (str) |