def create_entry_line_from_text(self, text):
split_line = re.match(self.entry_line_regexp, text)<EOL>if not split_line:<EOL><INDENT>raise ParseError("<STR_LIT>")<EOL><DEDENT>alias = split_line.group('<STR_LIT>')<EOL>start_time = end_time = None<EOL>if split_line.group('<STR_LIT>') is not None:<EOL><INDENT>if split_line.group('<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>start_time = create_time_from_text(split_line.group('<STR_LIT>'))<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ParseError("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>start_time = None<EOL><DEDENT><DEDENT>if split_line.group('<STR_LIT>') is not None:<EOL><INDENT>if split_line.group('<STR_LIT>') == '<STR_LIT:?>':<EOL><INDENT>end_time = None<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>end_time = create_time_from_text(split_line.group('<STR_LIT>'))<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ParseError("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>if split_line.group('<STR_LIT>') is not None:<EOL><INDENT>duration = float(split_line.group('<STR_LIT>'))<EOL><DEDENT>elif start_time or end_time:<EOL><INDENT>duration = (start_time, end_time)<EOL><DEDENT>else:<EOL><INDENT>duration = (None, None)<EOL><DEDENT>description = split_line.group('<STR_LIT:description>')<EOL>if split_line.group('<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>flags = self.extract_flags_from_text(split_line.group('<STR_LIT>'))<EOL><DEDENT>except KeyError as e:<EOL><INDENT>raise ParseError(*e.args)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>flags = set()<EOL><DEDENT>if alias.endswith('<STR_LIT:?>'):<EOL><INDENT>flags.add(Entry.FLAG_IGNORED)<EOL>alias = alias[:-<NUM_LIT:1>]<EOL><DEDENT>if description == '<STR_LIT:?>':<EOL><INDENT>flags.add(Entry.FLAG_IGNORED)<EOL><DEDENT>line = (<EOL>split_line.group('<STR_LIT>') or '<STR_LIT>',<EOL>split_line.group('<STR_LIT>') or '<STR_LIT>',<EOL>split_line.group('<STR_LIT>'),<EOL>split_line.group('<STR_LIT>'),<EOL>split_line.group('<STR_LIT:time>'),<EOL>split_line.group('<STR_LIT>'),<EOL>split_line.group('<STR_LIT:description>'),<EOL>)<EOL>entry_line = Entry(alias, duration, description, flags=flags, text=line)<EOL>return entry_line<EOL>
Try to parse the given text line and extract and entry. Return an :class:`~taxi.timesheet.lines.Entry`
object if parsing is successful, otherwise raise :exc:`~taxi.exceptions.ParseError`.