#NEWLINE# def strFile( p , f , caseSensitive = True ) : #NEWLINE# #INDENT# '\n    Find whether string C{p} occurs in a read()able object C{f}.\n\n    @rtype: C{bool}\n    ' #NEWLINE# buf = '' #NEWLINE# buf_len = max ( len ( p ) , ( 2 ** ( 2 ** ( 2 ** 2 ) ) ) ) #NEWLINE# if ( not caseSensitive ) : #NEWLINE# #INDENT# p = p . lower ( ) #NEWLINE# #UNINDENT# while 1 : #NEWLINE# #INDENT# r = f . read ( ( buf_len - len ( p ) ) ) #NEWLINE# if ( not caseSensitive ) : #NEWLINE# #INDENT# r = r . lower ( ) #NEWLINE# #UNINDENT# bytes_read = len ( r ) #NEWLINE# if ( bytes_read == 0 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# l = ( ( len ( buf ) + bytes_read ) - p ) #NEWLINE# if ( l <= 0 ) : #NEWLINE# #INDENT# buf = ( buf + r ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# buf = ( buf [ l : ] + r ) #NEWLINE# #UNINDENT# if ( buf . find ( p ) != ( - 1 ) ) : #NEWLINE# #INDENT# return True