parameters: (cls, changelog_file)
docstring: changelog_file must be a file-like object which returns
          unicode strings, e.g. from StringIO(unicode()) or
          fs.open_text_file_for_reading()
docstring_summary: changelog_file must be a file-like object which returns
          unicode strings, e.g. from StringIO(unicode()) or
          fs.open_text_file_for_reading()
docstring_tokens: changelog_file must be a file - like object which returns unicode strings e . g . from StringIO ( unicode () ) or fs . open_text_file_for_reading ()
function: def parse_entries_from_file(cls, changelog_file):
          """changelog_file must be a file-like object which returns
          unicode strings, e.g. from StringIO(unicode()) or
          fs.open_text_file_for_reading()"""
          date_line_regexp = re.compile(ChangeLogEntry.date_line_regexp)
          rolled_over_regexp = re.compile(ChangeLogEntry.rolled_over_regexp)
  
          # The first line should be a date line.
          revision, first_line = cls._separate_revision_and_line(changelog_file.readline())
          assert(isinstance(first_line, unicode))
          if not date_line_regexp.match(cls.svn_blame_regexp.sub('', first_line)):
              raise StopIteration
  
          entry_lines = [first_line]
          revisions_in_entry = {revision: 1} if revision != None else None
          for line in changelog_file:
              if revisions_in_entry:
                  revision, line = cls._separate_revision_and_line(line)
  
              if rolled_over_regexp.match(line):
                  break
  
              if date_line_regexp.match(line):
                  most_probable_revision = max(revisions_in_entry, key=revisions_in_entry.__getitem__) if revisions_in_entry else None
                  # Remove the extra newline at the end
                  yield ChangeLogEntry(''.join(entry_lines[:-1]), revision=most_probable_revision)
                  entry_lines = []
                  revisions_in_entry = {revision: 0}
  
              entry_lines.append(line)
              if revisions_in_entry:
                  revisions_in_entry[revision] = revisions_in_entry.get(revision, 0) + 1
  
          most_probable_revision = max(revisions_in_entry, key=revisions_in_entry.__getitem__) if revisions_in_entry else None
          yield ChangeLogEntry(''.join(entry_lines[:-1]), revision=most_probable_revision)
function_tokens: def parse_entries_from_file ( cls , changelog_file ) : date_line_regexp = re . compile ( ChangeLogEntry . date_line_regexp ) rolled_over_regexp = re . compile ( ChangeLogEntry . rolled_over_regexp ) # The first line should be a date line. revision , first_line = cls . _separate_revision_and_line ( changelog_file . readline ( ) ) assert ( isinstance ( first_line , unicode ) ) if not date_line_regexp . match ( cls . svn_blame_regexp . sub ( '' , first_line ) ) : raise StopIteration entry_lines = [ first_line ] revisions_in_entry = { revision : 1 } if revision != None else None for line in changelog_file : if revisions_in_entry : revision , line = cls . _separate_revision_and_line ( line ) if rolled_over_regexp . match ( line ) : break if date_line_regexp . match ( line ) : most_probable_revision = max ( revisions_in_entry , key = revisions_in_entry . __getitem__ ) if revisions_in_entry else None # Remove the extra newline at the end yield ChangeLogEntry ( '' . join ( entry_lines [ : - 1 ] ) , revision = most_probable_revision ) entry_lines = [ ] revisions_in_entry = { revision : 0 } entry_lines . append ( line ) if revisions_in_entry : revisions_in_entry [ revision ] = revisions_in_entry . get ( revision , 0 ) + 1 most_probable_revision = max ( revisions_in_entry , key = revisions_in_entry . __getitem__ ) if revisions_in_entry else None yield ChangeLogEntry ( '' . join ( entry_lines [ : - 1 ] ) , revision = most_probable_revision )