Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510
tools/misc/find_c_includes.py
- Committer:
- group-onsemi
- Date:
- 2017-01-25
- Revision:
- 0:098463de4c5d
File content as of revision 0:098463de4c5d:
#!/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:])