#NEWLINE# def igrep( ip , arg ) : #NEWLINE# #INDENT# ' igrep PAT files...\n    \n    Very dumb file scan, case-insensitive.\n    \n    e.g.\n    \n    igrep "test this" rec:*.py\n    \n    ' #NEWLINE# elems = shlex . split ( arg ) #NEWLINE# ( dummy , pat , fs ) = ( elems [ 0 ] , elems [ 1 ] , mglob . expand ( elems [ 2 : ] ) ) #NEWLINE# res = [ ] #NEWLINE# for f in fs : #NEWLINE# #INDENT# found = False #NEWLINE# for l in open ( f ) : #NEWLINE# #INDENT# if ( pat . lower ( ) in l . lower ( ) ) : #NEWLINE# #INDENT# if ( not res ) : #NEWLINE# #INDENT# print ( '[[' , f , ']]' ) #NEWLINE# found = True #NEWLINE# res . append ( f ) #NEWLINE# #UNINDENT# print ( l . rstrip ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return res