[Pkg-mozext-maintainers] Bug#734476: mozilla-devscripts: tool to convert "Version History" pages to changelogs

Jakub Wilk jwilk at debian.org
Tue Jan 7 14:00:27 UTC 2014


Package: mozilla-devscripts
Version: 0.35
Severity: wishlist

I'd like mozilla-devscripts to include a tool that will download 
"Version History"[0] page of an add-on, and then generate upstream 
changelog from it. I've attached prototype that I used to generate 
upstream changelog for openinbrowser.


[0] https://addons.mozilla.org/firefox/addon/${addon}/versions/

-- 
Jakub Wilk
-------------- next part --------------
#!/usr/bin/python3

import argparse
import urllib.request
import xml.etree.cElementTree as etree

def main():
    ap = argparse.ArgumentParser()
    ap.add_argument('extension')
    options = ap.parse_args()
    url = 'https://addons.mozilla.org/en-US/firefox/addon/{ext}/versions/format:rss'.format(ext=options.extension)
    with urllib.request.urlopen(url) as file:
        for event, element in etree.iterparse(file):
            if element.tag != 'item':
                continue
            title = element.find('title').text
            print(title)
            print('=' * len(title))
            descr = element.find('description').text
            print(descr)
            print()

if __name__ == '__main__':
    main()

# vim:ts=4 sw=4 et


More information about the Pkg-mozext-maintainers mailing list