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.
find_c_includes.py
00001 #!/usr/bin/env python 00002 00003 import os 00004 import re 00005 00006 def main(path='.', pattern=r'#include\s+"([^"]*\.(?:c|cpp))"'): 00007 pattern = re.compile(pattern) 00008 00009 for root, dirs, files in os.walk(path, followlinks=True): 00010 for file in files: 00011 with open(os.path.join(root, file)) as f: 00012 for line in f.read().splitlines(): 00013 m = re.search(pattern, line) 00014 if m: 00015 print os.path.relpath(os.path.join(root, m.group(1))) 00016 00017 00018 if __name__ == "__main__": 00019 import sys 00020 main(*sys.argv[1:]) 00021
Generated on Tue Jul 12 2022 14:23:46 by
