Updated Branches: refs/heads/trunk 5613f0f77 -> f75780f13
Allow filterting contributors by release version. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f75780f1 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f75780f1 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f75780f1 Branch: refs/heads/trunk Commit: f75780f13cbffb992d1bfab7286492201e2a59aa Parents: 5613f0f Author: Tomaz Muraus <[email protected]> Authored: Fri Dec 20 00:41:54 2013 +0100 Committer: Tomaz Muraus <[email protected]> Committed: Fri Dec 20 00:41:54 2013 +0100 ---------------------------------------------------------------------- contrib/generate_contributor_list.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/f75780f1/contrib/generate_contributor_list.py ---------------------------------------------------------------------- diff --git a/contrib/generate_contributor_list.py b/contrib/generate_contributor_list.py index 324da1c..63a7f01 100755 --- a/contrib/generate_contributor_list.py +++ b/contrib/generate_contributor_list.py @@ -30,7 +30,7 @@ JIRA_URL = 'https://issues.apache.org/jira/browse/LIBCLOUD-%s' GITHUB_URL = 'https://github.com/apache/libcloud/pull/%s' -def parse_changes_file(file_path): +def parse_changes_file(file_path, version=None): """ Parse CHANGES file and return a dictionary with contributors. @@ -41,12 +41,22 @@ def parse_changes_file(file_path): contributors_map = defaultdict(set) in_entry = False + active_version = None active_tickets = [] with open(file_path, 'r') as fp: for line in fp: line = line.strip() + match = re.search(r'Changes with Apache Libcloud ' + '(\d+\.\d+\.\d+(-\w+)?).*?$', line) + + if match: + active_version = match.groups()[0] + + if version and active_version != version: + continue + if line.startswith('-') or line.startswith('*)'): in_entry = True active_tickets = [] @@ -124,9 +134,13 @@ if __name__ == '__main__': ' in a single image') parser.add_argument('--changes-path', action='store', help='Path to the changes file') + parser.add_argument('--version', action='store', + help='Only return contributors for the provided ' + 'version') args = parser.parse_args() - contributors_map = parse_changes_file(file_path=args.changes_path) + contributors_map = parse_changes_file(file_path=args.changes_path, + version=args.version) markdown = convert_to_markdown(contributors_map=contributors_map) print(markdown)
