blob: ff9e10db946794c41b2ab4466c5f2ed5dd906149 [file] [log] [blame]
Pratik Vyasc1e6e4c2011-06-08 14:37:15 +05301import os
2
3def replace_code(old, new):
4 txt = os.popen("""grep "%s" ./*/*/*/*.js""" % old).read().split()
5 txt = [t.split(':')[0] for t in txt]
6 txt = list(set(filter(lambda t: t.startswith('./'), txt)))
7 for t in txt:
8 if new:
9 code = open(t,'r').read().replace(old, new)
10 open(t, 'w').write(code)
11 print "Replaced for %s" % t
12 else:
13 print 'Found in %s' % t
14
15if __name__=='__main__':
nabinhait1bd56b12011-07-05 14:41:36 +053016 old = """cur_frm.cscript.get_tips(doc, cdt, cdn);"""
nabinhaitc297df52011-07-05 10:54:05 +053017 new = " "
Pratik Vyasc1e6e4c2011-06-08 14:37:15 +053018 replace_code(old, new)
nabinhaitc297df52011-07-05 10:54:05 +053019