| 360 | |
| 361 | |
| 362 | def find_files(): |
| 363 | tu = [] |
| 364 | manual = [] |
| 365 | all_files = [] |
| 366 | for root, directories, filenames in os.walk(dir): |
| 367 | for filename in filenames: |
| 368 | all_files.append(os.path.join(root,filename)) |
| 369 | |
| 370 | files = [f for f in all_files if os.path.isfile(f) and f.endswith(rtl_ext)] |
| 371 | for f in files: |
| 372 | base = f[0:-len(rtl_ext)] |
| 373 | short_base = base[0:base.rindex(".")] |
| 374 | if short_base + su_ext in all_files and short_base + obj_ext in all_files: |
| 375 | tu.append(base) |
| 376 | print('Reading: {}{}, {}{}, {}{}'.format(base, rtl_ext, short_base, su_ext, short_base, obj_ext)) |
| 377 | |
| 378 | files = [f for f in all_files if os.path.isfile(f) and f.endswith(manual_ext)] |
| 379 | for f in files: |
| 380 | manual.append(f) |
| 381 | print('Reading: {}'.format(f)) |
| 382 | |
| 383 | # Print some diagnostic messages |
| 384 | if not tu: |
| 385 | print("Could not find any translation units to analyse") |
| 386 | exit(-1) |
| 387 | |
| 388 | return tu, manual |
| 389 | |
| 390 | |
| 391 | def main(): |