def read_and_call_until(uhandle, method, **keywds):
 nlines = 0
 while True:
  line = safe_readline(uhandle)
  if (not _fails_conditions(*(line,), **keywds)):
   uhandle.saveline(line)
   break
  method(line)
  nlines = (nlines + 1)
 return nlines

def read_and_call_until ( uhandle , method , ** keywds ) : nlines = 0 while True : line = safe_readline ( uhandle ) if ( not _fails_conditions ( * ( line , ) , ** keywds ) ) : uhandle . saveline ( line ) break method ( line ) nlines = ( nlines + 1 ) return nlines
read_and_call_until -> number of lines read a line from uhandle and pass it to the method until some condition is true .