@imports(['<STR_LIT:time>'])<EOL>def make_lines(handle, follow=False, wait=<NUM_LIT:0.1>):
while True:<EOL><INDENT>line = handle.readline()<EOL>if line:<EOL><INDENT>yield line<EOL><DEDENT>elif follow:<EOL><INDENT>time.sleep(wait)<EOL><DEDENT>else:<EOL><INDENT>raise StopIteration<EOL><DEDENT><DEDENT>
Creates a line generator from a stream (file handle) containing data in
lines.

Arguments:

  - follow(``bool``) [default: ``False``] If ``True`` follows the file after
    it finishes like 'tail -f'.
  - wait(``float``) [default: ``0.1``] time to wait in seconds between file
    polls.