Includes library modifications to allow access to AIN_4 (AIN_0 / 5)
mbd_os/tools/misc/find_c_includes.py
- Committer:
- bryantaylor
- Date:
- 2016-09-20
- Revision:
- 0:eafc3fd41f75
File content as of revision 0:eafc3fd41f75:
#!/usr/bin/env python import os import re def main(path='.', pattern=r'#include\s+"([^"]*\.(?:c|cpp))"'): pattern = re.compile(pattern) for root, dirs, files in os.walk(path, followlinks=True): for file in files: with open(os.path.join(root, file)) as f: for line in f.read().splitlines(): m = re.search(pattern, line) if m: print os.path.relpath(os.path.join(root, m.group(1))) if __name__ == "__main__": import sys main(*sys.argv[1:])