Created
February 25, 2014 02:19
-
-
Save martin0258/9201439 to your computer and use it in GitHub Desktop.
Generate issue links for release note.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim:fenc=utf-8 | |
# | |
# Copyright © 2014 martinku <martinku@ss-martin-ku> | |
# | |
# Distributed under terms of the MIT license. | |
""" | |
Generate issue links for release note. | |
""" | |
import re | |
# Change the following settings if needed | |
input_file = "v1.1.1-b.md" | |
issue_link_root = "https://github.com/SkysourceRepo/ER-Bonus-System/issues/" | |
with open(input_file) as f: | |
# find all links | |
lines = '\n'.join(f.readlines()) | |
link_matches = re.findall('\[#(\d+)\]', lines) | |
# find unique issues | |
unique_issues = sorted(set(link_matches)) | |
for issue in unique_issues: | |
print "[#%s]: %s" % (issue, issue_link_root + issue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment