/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/generate_release_notes.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-25 11:54:30 UTC
  • mfrom: (6855.4.10 more-bees)
  • Revision ID: breezy.the.bot@gmail.com-20180325115430-75xnlbrmzjoomd83
Add more bees. In particular:

* for file ids
* for revision ids
* for file contents in build_tree_contents()

Merged from https://code.launchpad.net/~jelmer/brz/more-bees/+merge/337919

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
 
87
87
 
88
88
def output_news_file_plain(out_file, news_file_name):
89
 
    f = open(news_file_name, 'rb')
90
 
    try:
 
89
    with open(news_file_name, 'rb') as f:
91
90
        lines = f.readlines()
92
 
    finally:
93
 
        f.close()
94
91
    title = os.path.basename(news_file_name)[len('brz-'):-len('.txt')]
95
92
    for line in lines:
96
93
        if line == '####################\n':
124
121
        preamble = preamble_plain
125
122
        output_news_file = output_news_file_plain
126
123
 
127
 
    out_file = open(out_file_name, 'w')
128
 
    try:
 
124
    with open(out_file_name, 'w') as out_file:
129
125
        out_file.write(preamble)
130
126
        for news_file_name in news_file_names:
131
127
            output_news_file(out_file, news_file_name)
132
 
    finally:
133
 
        out_file.close()
134
128
 
135
129
 
136
130
if __name__ == '__main__':