@synchronized<EOL><INDENT>def add_entry(self, date, entry):<DEDENT>
in_date = False<EOL>insert_at = <NUM_LIT:0><EOL>for (lineno, line) in enumerate(self.lines):<EOL><INDENT>if isinstance(line, DateLine) and line.date == date:<EOL><INDENT>in_date = True<EOL>insert_at = lineno<EOL>continue<EOL><DEDENT>if in_date:<EOL><INDENT>if isinstance(line, Entry):<EOL><INDENT>insert_at = lineno<EOL><DEDENT>elif isinstance(line, DateLine):<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>self.lines.insert(insert_at + <NUM_LIT:1>, entry)<EOL>if not isinstance(self.lines[insert_at], Entry):<EOL><INDENT>self.lines.insert(insert_at + <NUM_LIT:1>, TextLine('<STR_LIT>'))<EOL><DEDENT>
Add the given entry to the textual representation.