/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/check-newsbugs.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-06 02:13:25 UTC
  • mfrom: (7490.7.21 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200506021325-awbmmqu1zyorz7sj
Merge 3.1 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
# Simple script that will check which bugs mentioned in NEWS 
 
1
#!/usr/bin/python3
 
2
# Simple script that will check which bugs mentioned in NEWS
3
3
# are not yet marked Fix Released in Launchpad
4
4
 
5
5
import getopt, re, sys
20
20
options = dict(options)
21
21
 
22
22
if len(args) == 1:
23
 
    print ("Usage: check-newsbugs [--launchpad][--webbrowser] "
24
 
           "doc/en/release-notes/brz-x.y.txt")
 
23
    print("Usage: check-newsbugs [--launchpad][--webbrowser] "
 
24
          "doc/en/release-notes/brz-x.y.txt")
25
25
    print("Options:")
26
26
    print("--launchpad     Print out Launchpad mail commands for closing bugs ")
27
27
    print("                that are already fixed.")
52
52
    :return: list of bug numbers that were closed.
53
53
    """
54
54
    # Pattern to find bug numbers
55
 
    bug_pattern = re.compile("\#([0-9]+)")
 
55
    bug_pattern = re.compile(r"\#([0-9]+)")
56
56
    ret = set()
57
 
    f = open(path, 'r')
58
 
    try:
 
57
    with open(path, 'r') as f:
59
58
        section = ""
60
59
        for l in f.readlines():
61
60
            if l.strip() == "":
70
69
            else:
71
70
                section += l
72
71
        return ret
73
 
    finally:
74
 
        f.close()
75
72
 
76
73
 
77
74
def print_bug_url(bugno):