def parse_line(self, text):
text = text.strip().replace('<STR_LIT:\t>', '<STR_LIT:U+0020>' * <NUM_LIT:4>)<EOL>if len(text) == <NUM_LIT:0> or text.startswith('<STR_LIT:#>'):<EOL><INDENT>parsed_line = TextLine(text)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>date = self.create_date_from_text(text)<EOL><DEDENT>except ValueError:<EOL><INDENT>parsed_line = self.create_entry_line_from_text(text)<EOL><DEDENT>else:<EOL><INDENT>parsed_line = DateLine(date, text)<EOL><DEDENT><DEDENT>return parsed_line<EOL>
Parse the given `text` and return either a :class:`~taxi.timesheet.lines.DateLine`, an
:class:`~taxi.timesheet.lines.Entry`, or a :class:`~taxi.timesheet.lines.TextLine`, or raise
:exc:`taxi.exceptions.ParseError` if the line can't be parser. See the transformation methods
:meth:`create_date_from_text` and :meth:`create_entry_line_from_text` for details about the format the line is
expected to have.