From 12f08d821c344a78ac18d2c5226f8759056792f9 Mon Sep 17 00:00:00 2001 From: John Cote Date: Fri, 5 Jun 2015 19:30:05 -0400 Subject: [PATCH] Tweak findterm files --- dev/tools/findterm/findterm.py | 6 +++--- dev/tools/findterm/findtermAI.py | 19 +++++++++++++++++++ dev/tools/findterm/findterm_otp.py | 6 +++--- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 dev/tools/findterm/findtermAI.py diff --git a/dev/tools/findterm/findterm.py b/dev/tools/findterm/findterm.py index 990c49ef..5957f503 100644 --- a/dev/tools/findterm/findterm.py +++ b/dev/tools/findterm/findterm.py @@ -7,13 +7,13 @@ def processFile(f,t): for i,x in enumerate(lines): if t in x: lines_found.append(i+1) - + return lines_found -term = raw_input('>') +term = raw_input('> ') for x in glob.glob('../../../toontown/*/*.py'): r = processFile(x,term) if r: print x,r - + raw_input('*****') diff --git a/dev/tools/findterm/findtermAI.py b/dev/tools/findterm/findtermAI.py new file mode 100644 index 00000000..4354e705 --- /dev/null +++ b/dev/tools/findterm/findtermAI.py @@ -0,0 +1,19 @@ +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) + + return lines_found + +term = raw_input('> ') +for x in glob.glob('../../../toontown/*/*AI.py'): + r = processFile(x,term) + if r: + print x,r + +raw_input('*****') diff --git a/dev/tools/findterm/findterm_otp.py b/dev/tools/findterm/findterm_otp.py index 51f36e3d..a44b2178 100644 --- a/dev/tools/findterm/findterm_otp.py +++ b/dev/tools/findterm/findterm_otp.py @@ -7,13 +7,13 @@ def processFile(f,t): for i,x in enumerate(lines): if t in x: lines_found.append(i+1) - + return lines_found -term = raw_input('>') +term = raw_input('> ') for x in glob.glob('../../../otp/*/*.py'): r = processFile(x,term) if r: print x,r - + raw_input('*****')