@pipe.func<EOL>def readline(prev, filename=None, mode='<STR_LIT:r>', trim=str.rstrip, start=<NUM_LIT:1>, end=sys.maxsize):
if prev is None:<EOL><INDENT>if filename is None:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>elif is_str_type(filename):<EOL><INDENT>file_list = [filename, ]<EOL><DEDENT>else:<EOL><INDENT>file_list = filename<EOL><DEDENT><DEDENT>else:<EOL><INDENT>file_list = prev<EOL><DEDENT>for fn in file_list:<EOL><INDENT>if isinstance(fn, file_type):<EOL><INDENT>fd = fn<EOL><DEDENT>else:<EOL><INDENT>fd = open(fn, mode)<EOL><DEDENT>try:<EOL><INDENT>if start <= <NUM_LIT:1> and end == sys.maxsize:<EOL><INDENT>for line in fd:<EOL><INDENT>yield trim(line)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for line_no, line in enumerate(fd, <NUM_LIT:1>):<EOL><INDENT>if line_no < start:<EOL><INDENT>continue<EOL><DEDENT>yield trim(line)<EOL>if line_no >= end:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>if fd != fn:<EOL><INDENT>fd.close()<EOL><DEDENT><DEDENT><DEDENT>
This pipe get filenames or file object from previous pipe and read the
    content of file. Then, send the content of file line by line to next pipe.

    The start and end parameters are used to limit the range of reading from file.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param filename: The files to be read. If None, use previous pipe input as filenames.
    :type filename: None|str|unicode|list|tuple
    :param mode: The mode to open file. default is 'r'
    :type mode: str
    :param trim: The function to trim the line before send to next pipe.
    :type trim: function object.
    :param start: if star is specified, only line number larger or equal to start will be sent.
    :type start: integer
    :param end: The last line number to read.
    :type end: integer
    :returns: generator