def get_changes():
 with open(HISTORY) as f:
  lines = f.readlines()
 block = []
 for (i, line) in enumerate(lines):
  line = lines.pop(0)
  if line.startswith('===='):
   break
 lines.pop(0)
 for (i, line) in enumerate(lines):
  line = lines.pop(0)
  line = line.rstrip()
  if re.match('^- \\d+_: ', line):
   (num, _, rest) = line.partition(': ')
   num = ''.join([x for x in num if x.isdigit()])
   line = ('- #%s: %s' % (num, rest))
  if line.startswith('===='):
   break
  block.append(line)
 block.pop((-1))
 while (not block[(-1)]):
  block.pop((-1))
 return '\n'.join(block)

def get_changes ( ) : with open ( HISTORY ) as f : lines = f . readlines ( ) block = [ ] for ( i , line ) in enumerate ( lines ) : line = lines . pop ( 0 ) if line . startswith ( '====' ) : break lines . pop ( 0 ) for ( i , line ) in enumerate ( lines ) : line = lines . pop ( 0 ) line = line . rstrip ( ) if re . match ( '^- \\d+_: ' , line ) : ( num , _ , rest ) = line . partition ( ': ' ) num = '' . join ( [ x for x in num if x . isdigit ( ) ] ) line = ( '- #%s: %s' % ( num , rest ) ) if line . startswith ( '====' ) : break block . append ( line ) block . pop ( ( - 1 ) ) while ( not block [ ( - 1 ) ] ) : block . pop ( ( - 1 ) ) return '\n' . join ( block )
get the most recent changes for this release by parsing history .