diff --git a/scripts/find_all_modules.py b/scripts/find_all_modules.py new file mode 100644 index 0000000..21cfa51 --- /dev/null +++ b/scripts/find_all_modules.py @@ -0,0 +1,34 @@ +import os +import re + +def findfiles(path, regex): + regObj = re.compile(regex) + res = [] + for root, dirs, fnames in os.walk(path): + for fname in fnames: + #print fname + if regObj.match(fname): + res.append(os.path.join(root, fname)) + return res + +def grep(filepath, regex): + regObj = re.compile(regex) + res = [] + with open(filepath) as f: + #print f + for line in f: + #print line + if re.search('addModel',line): + m2 = re.findall(r'\"(.+?)\"',line) + #res.append(line) + if m2: + print m2[0], m2[1] + return res + +headers = findfiles('.', r'.*cpp$') + +#print headers + +for filepath in headers: + res = grep( filepath, r'.*addModel.*"(.*)",') + #print res \ No newline at end of file