Poodletooth-iLand/dev/tools/findterm/findterm_otp.py

20 lines
392 B
Python
Raw Normal View History

2015-04-10 06:57:49 -05:00
import glob
def processFile(f,t):
data = open(f,'rb').read()
lines = data.replace('\r\n','\n').split('\n')
lines_found = []
for i,x in enumerate(lines):
if t in x:
lines_found.append(i+1)
2015-06-05 18:30:05 -05:00
2015-04-10 06:57:49 -05:00
return lines_found
2015-06-05 18:30:05 -05:00
term = raw_input('> ')
2015-05-29 05:03:48 -05:00
for x in glob.glob('../../../otp/*/*.py'):
2015-04-10 06:57:49 -05:00
r = processFile(x,term)
if r:
print x,r
2015-06-05 18:30:05 -05:00
2015-04-10 06:57:49 -05:00
raw_input('*****')